[cairo] About cairo_show_text and UTF-8...

Bill Spitzak spitzak at d2.com
Mon Jan 9 13:42:35 PST 2006



Behdad Esfahbod wrote:
> On Fri, 6 Jan 2006, Bill Spitzak wrote:
> 
>>I don't understand this. All I want is the first 0x10ffff glyph indicies
>>to always draw something that has some relationship to the Unicode
>>glyphs.
> 
> What are those glyphs usefule for?  Almost all writing systems
> have a nontrivial unichar->glyph matching (even Latin, for
> ligatures for example)

The original poster that started this discussion clearly stated that 
they saw a rectangle where they expected an accented character. The 
glyphs are "useful" in that it fixes precisely the problem he complained 
about! It is okay that it is the "wrong glyph", I can guarantee you that 
most people will say it is less wrong than the rectangle glyph!

> All this talks about expanding the toy api scares me seriously.
> There's one true thing and that's cairo cannot renderin Arabic
> and Indic text unless cairo becomes Pango.  We are not idiots
> making Pango more complex than needed.  If Pango seems too compex
> to you, then you are under-estimating the complexity of Unicode
> text rendering.

I think the "toy" API should draw all the glyhps possible in a UTF-8 
string, adjacent to each other, using the x-width of the characters to 
move to the next origin. It does not do ligatures, compositing 
characters, bidi, or anything else. I am fully aware that it does not 
draw Arabic right. It does not draw even English right. I KNOW!!!!

It does not require Pango. All I want is to have a complete set of 
glyphs. I want to write a *small* program that draws a full unicode 
table (something Plan9 had in 1986!) I want to write an editor that can 
edit Unicode strings and control the order of the resulting bytes! If I 
can understand it, maybe I will start experimenting with complex layout. 
But without the ability to spit out a string and figure out what 
characters are in it, it is NOT going to happen!


More information about the cairo mailing list