[cairo] Rendering UTF-8 and non-standard text

Behdad Esfahbod behdad at behdad.org
Wed Jan 23 09:13:08 PST 2008


On Wed, 2008-01-23 at 10:57 -0500, robertk54 at aol.com wrote:
> I am trying to render 'non-standard' text.  For example, using a UTF-8
> string of hebrew text hardcoded in my source file. The text appears
> correctly in the code, characters are properly ordered right to left.
> However, when I render them using a hebrew font for some reason the
> characters are reversed.  I tried setting the locale but this has no
> affect.  Do I need to render each character one at a time or should I
> be able to render the string properly?

Hi!

Like it was already pointed out by Carl, you should use Pango.  Really.

If for some reason you can't, and you only want to render simple Latin
and Hebrew text with no advanced features (kerning, ligatures, etc), you
can try your luck with fribidi's fribidi_log2vis() function before using
cairo_show_text().  But seriously, just use Pango.

> Thanks,
> Bob


-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759



More information about the cairo mailing list