[cairo] Serious concerns about cairo
mike.emmel at gmail.com
Tue Sep 26 08:14:56 PDT 2006
On 9/26/06, James Cloos <cloos at jhcloos.com> wrote:
> >>>>> "Mike" == Mike Emmel <mike.emmel at gmail.com> writes:
> >>>>> "Bill" == Bill Spitzak <spitzak at d2.com> writes:
> Mike> Add drawing operations at least for ucs2 chars. No one doing
> Mike> advanced text layout works with utf8 you can't internally.
> Bill> Please don't use "wide characters" in the api. The sooner we
> Bill> stamp this abonimation out, the better.
> Mostly agreed. Cairo should use utf8. (In general, though, utf32
> is not so abominable. That 16 bit nonsense, OTOH, ....)
> (And, one should note, glibc uses int32_t for wide chars; ie utf32
> rather than that utf16 junk.)
> Bill> Finding the next glyph means looking for the next byte that
> Bill> does not start with 10.
> s/byte/octet and, most importantly, s/next glyph/next code point/
> As Bill mentions later, not all code points are glyphs. There are
> combining characters, variation selectors, joiner characters, etc.
> In short, if your working with the UCS you need to think in terms
> of character sequences rather than in terms of characters.
Agreed but considering the cost of shaping
complex strings I'ts worthwhile to scan the incoming string for
complex sequences and break it up into shaped portions and probably
parts that remain utf8 since the glyphs would map one to one. For the
portions of the string that are mapped one to one with a glyph I need
not shape it but can rely on find the glyph from a simple cache at
runtime. The other parts need to go through the shaper.
A simple complexity ratio can tell me when its worthwhile to keep any
of the string as utf8 or bail and shape all of it.
In my experience the biggest problems is not all the cool capabilities to handle
complex strings but the lack of fast paths in cases where the problem is simple.
Even if I have to scan the string twice to optimize the rendering its
then sending it to the shaper. Related but also easily handled is the
the glyph but this is another point I would need to split if the string.
So do you see problems with this approach ?
> James Cloos <cloos at jhcloos.com> OpenPGP: 0xED7DAEA6
More information about the cairo