[cairo] Fonts and characters in pdf/image surfaces

Timothée Lecomte timothee.lecomte at ens.fr
Fri Feb 23 02:02:55 PST 2007


Dear all,

I have been enjoying the possibility to generate pdf files from my
cairo-based application (gnuplot with cairo terminal) with the same code
as the one used for generic image surfaces. It's great to save so much
code !

So far, non-text elements are rendered almost exactly the same in the pdf
as in the image surface, but I do encounter an issue with text. I am using
pango to select the font options and output to the cairo surface.

For an image surface (and for an xlib surface too, I guess), pango has
some sort of fallback mechanism if the select font does not contain the
character I want to draw. For example, I want to display a Japanese
character, and I select the "Bitstream Vera Sans" font which does not
contain it, and I get a bitmapped character obviously coming from another
font.
My problem is that this fallback mechanism does not seem to exist for pdf
surfaces. Instead of a bitmapped Japanese character, there is no displayed
character.

Is there a way to have this behaviour uniform on all surfaces ?

Thank you for your help.

Best regards,
Timothée Lecomte

P.S.: The versions that I am using are:
cairo 1.3.12
pango 1.4.10
fontconfig 2.4.2
freetype 2.3.1
looking at the pdf with evince 0.6.1 / poppler 0.5.4




More information about the cairo mailing list