Comment 35 for bug 185700

Revision history for this message
In , Adrian Johnson (ajohnson-redneon) wrote :

I had a look at gfxPangoFonts.cpp and the problem is the line

 cairo_font_options_set_hint_metrics(fontOptions, CAIRO_HINT_METRICS_ON);

in CreateScaledFont().

Testing with metrics set to off produced perfect print output. I'm not sure what hint metrics has to do with fontconfig as the above line does not depend on the fontconfig pattern and even the comment above it says this is the one option not recorded in the fontconfig pattern.

This option should really be obtained from cairo_surface_get_font_options() to get the correct metrics option for the surface. If the surface is not available, this should at least be dependent on whether the font is for printing. Hintstyle should also be set to none for printing although this only affects the use of fallback fonts where cairo embeds a font created from the glyph outlines.