The way cairo maps CAIRO_HINT_STYLE_MEDIUM to Freetype settings is different from other libraries, which makes things look strange when you have some apps using Cairo for rendering and some using something else (like Xft). The offending code is in cairo-ft-font.c:_cairo_ft_options_merge(): ... switch (options->base.hint_style) { case CAIRO_HINT_STYLE_NONE: load_flags |= FT_LOAD_NO_HINTING; break; case CAIRO_HINT_STYLE_SLIGHT: load_target = FT_LOAD_TARGET_LIGHT; break; case CAIRO_HINT_STYLE_MEDIUM: break; case CAIRO_HINT_STYLE_FULL: case CAIRO_HINT_STYLE_DEFAULT: ... All other implementations I've found map FT_LOAD_TARGET_LIGHT to both "slight" and "medium". E.g. Xft: if (FC_HINT_NONE < hint_style && hint_style < FC_HINT_FULL) { fi->load_flags |= FT_LOAD_TARGET_LIGHT; } Pango: switch (hintstyle) { case FC_HINT_SLIGHT: case FC_HINT_MEDIUM: ft2font->load_flags |= FT_LOAD_TARGET_LIGHT; break; One entertaining effect of this is gnome-appearance-properties which uses Xft to render the font examples, but then GTK+ uses Cairo for the actual font rendering, resulting in the examples showing something other than what you will get.
Behdad, Can you comment on this? Is this an obvious bug in cairo that we should just fix? -Carl
Had enough time to mull this over? :)
The problem is, even if you're right, changing this at this point will break stuff. Since Xft is hardly in use these days, I don't see any reason to change this. As it is, cairo's HINT_LIGHT, HINT_MEDIUM, and HINT_FULL each achieve a different rendering. Merging two of those into one sounds like a regression to me.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.