I am doing some work on gvim that will hopefully result in further optimization in rendering and proper usage of ligatures. Since I just opened vim code last night, there is number of building blocks I have to find. Maybe they already exist in gvim, maybe we need to fall back to Pango or some other solution... I don't know yet. Please take a look below and tell me what building blocks we already have.
So having char_u * containing "first 😃😃😃 second" (three smileys
between two words, separated by spaces),
Such string having hex representation:
f i r s t _ [ ] [ ] [ ] _ s e c o n d
66 69 72 73 74 20 f0 9f 98 83 f0 9f 98 83 f0 9f 98 83 20 73 65 63 6f 6e 64
I am looking for a most efficient way to split that into ascii and
non-ascii parts, ideally something like:
1: f i r s t _
66 69 72 73 74 20
2: [ ] [ ] [ ]
f0 9f 98 83 f0 9f 98 83 f0 9f 98 83
3: _ s e c o n d
20 73 65 63 6f 6e 64
Is there something useful and super efficient (this needs to run close
to gui_gtk2_draw_string) that will allow me to split char_u* into
logical ascii/non-ascii parts? Something in mbyte.c maybe?
Alternatively anything that can take *s and tell me the length of next
char/segment will be fine too, I can build actual split strings myself
then.
Reason for asking this is that we are falling back to "goto not_ascii;"
way too soon and in too many cases, for anything that is not plain ascii
or bold or italic. Proper additional splitting will allow us to feed
only specific segments to Pango and use gui.ascii_glyphs in more cases,
thus optimizing output. This is also stepping stone to having proper
ligatures in gvim. So how do I split the string in a super efficient
way?
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/YVL9/syOBEihdbaP%40ryzen.me.
signature.asc
Description: PGP signature
