[cairo] cairo_show_text and Chinese

Robert O'Callahan robert at ocallahan.org
Sun Jul 6 20:18:56 PDT 2008

On Mon, Jul 7, 2008 at 7:34 AM, Logan Mueller <logan.mueller at gmail.com>

> We have a problem rendering Chinese characters with cairo_show_text.
> If we provide a
> UTF-8 string with both ISO and Chinese characters, only the ISO
> characters are rendered,
> and the Chinese characters are skipped over.  cairo_text_extents
> returns the extents as
> if the Chinese characters were not in the string.
> The same UTF-8 string will work correctly with other libraries (not
> Cairo) and Cairo
> works correctly with UTF-8 characters from other character sets (such
> as the Polish
> characters available in UTF-8)
> We are using Cairo 1.4.10.  We are currently stuck with this version.
> Does anyone know
> if this is a common issue, or if there are any bugs tied to this?
> What font are you using? If the font you're using has no glyphs for Chinese
characters, then they won't render. Cairo's text APIs do not perform "font
fallback" to find another font with glyphs for the characters you need.

If you want to render non-ASCII text then you should really stop using the
cairo "toy text" APIs and start using a higher level text API like Pango.
See http://cairographics.org/manual/cairo-Text.html... This should be in the
FAQ too.

"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20080707/50857db5/attachment.html 

More information about the cairo mailing list