[cairo] Serious concerns about cairo
Bill Spitzak
spitzak at d2.com
Mon Sep 25 13:27:20 PDT 2006
Mike Emmel wrote:
> Add drawing operations at least for ucs2 chars. No one doing advanced text
> layout works with utf8 you can't internally.
I BEG TO DIFFER!
Please don't use "wide characters" in the api. The sooner we stamp this
abonimation out, the better.
It really is not that hard to use UTF-8 in buffers. Finding the next
glyph means looking for the next byte that does not start with 10.
Certainly easier than finding the next word. And I really doubt your
word processer does not have a find-the-next word function.
And think: do you *really* need the ability to jump to character N
without first examining the N-1 characters before that. REALLY? I think
you may be mistaken. Remember that you can store the offset IN BYTES
from the start of any buffer in exactly the same amount of space as it
takes to store the offset in "glyphs".
Another thing is that you seem to be ignoring "surrogate pairs". These
basically mean that utf-16 is as hard or worse than utf-8 to handle,
except the unusual cases are much more rare and thus the code will not
get tested well.
And don't forget "combining characters". This means that if youre
"advanced text layout" is thinking about glyphs at all, then you are
screwing up.
Please don't dismiss UTF-8. We will all be much better off the sooner
everybody switches to it.
More information about the cairo
mailing list