(In reply to comment #3)
> If I understand postscript and pdf surfaces correctly, they usually only
> position a glyph, without rendering it, essentially making a guess about how
> the glyph will be rendered on the final device. We should probably guess the
> rendering options to use for measuring rather than looking at fontconfig
> settings.
PS/PDF can position each individual glyph or draw strings of glyphs where each glyph is positioned at its natural glyph advance. All hinting should be disabled when generating PDF/PS output as it is a device independent format and no assumptions can be made about what devices it will be rendered on.
The cairo PDF and PS surfaces default to all hinting off:
> When fonts can't be embedded, I assume the glyph is rendered to an image with
> pixels. In this case we probably should use (some of) the fontconfig
> settings, though I'm not sure it's worth the effort.
I'm not sure what you mean by "When fonts can't be embedded" as cairo PDF/PS always embeds (and subsets) the fonts used. If subsetting fails it will fallback to embedding a font generated from the unhinted outlines of the glyphs. Only bitmap fonts result in a embedded bitmap font generated from the glyphs rendered at 72dpi.
(In reply to comment #3)
> If I understand postscript and pdf surfaces correctly, they usually only
> position a glyph, without rendering it, essentially making a guess about how
> the glyph will be rendered on the final device. We should probably guess the
> rendering options to use for measuring rather than looking at fontconfig
> settings.
PS/PDF can position each individual glyph or draw strings of glyphs where each glyph is positioned at its natural glyph advance. All hinting should be disabled when generating PDF/PS output as it is a device independent format and no assumptions can be made about what devices it will be rendered on.
The cairo PDF and PS surfaces default to all hinting off:
static void pdf_surface_ get_font_ options (void *abstract_surface,
cairo_ font_options_ t *options) font_options_ init_default (options);
_cairo_
{
_cairo_
cairo_ font_options_ set_hint_ style (options, CAIRO_HINT_ STYLE_NONE) ; font_options_ set_hint_ metrics (options, CAIRO_HINT_ METRICS_ OFF); font_options_ set_antialias (options, CAIRO_ANTIALIAS _GRAY);
cairo_
cairo_
}
> When fonts can't be embedded, I assume the glyph is rendered to an image with
> pixels. In this case we probably should use (some of) the fontconfig
> settings, though I'm not sure it's worth the effort.
I'm not sure what you mean by "When fonts can't be embedded" as cairo PDF/PS always embeds (and subsets) the fonts used. If subsetting fails it will fallback to embedding a font generated from the unhinted outlines of the glyphs. Only bitmap fonts result in a embedded bitmap font generated from the glyphs rendered at 72dpi.