[cairo] rendering UTF8 text

Ulrich Mierendorff ulrich.mierendorff at gmx.net
Mon Jun 25 12:52:18 PDT 2007


For one of my projects I render SVGs with libsvg-cairo. These SVGs 
contain some Chinese letters, but they appear just as boxes/error 
symbols on my screen. It looks like if the correct font was not 
installed. But my system (ubuntu linux) has got all fonts, and all other 
programs show the text correctly.

I thought this would be probably a problem with the libsvg-cairo library 
and I due to the fact that I also want to render text independently, I 
thought what would be easier to just use cairo to render text if you 
already use it in your program... (Instead of learning freetype api etc.)

I used the "Hello World" text rendering example from 
http://cairographics.org/FAQ/ and replaced the "Hello World" string with 
some Chinese letters from http://www.lorem-ipsum.info/generator3 : They 
are not shown... Same problem as with the SVGs, just black rectangles. I 
also tried with different font families.

What am I doing wrong?
And is it possible to specifie font-files instead of families?

Thanks in advance.

Kind regards,

Ulrich Mierendorff

More information about the cairo mailing list