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.
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.