[cairo-bugs] [Bug 25118] New: hinting for CAIRO_HINT_STYLE_MEDIUM is wrong

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Nov 16 05:19:14 PST 2009


http://bugs.freedesktop.org/show_bug.cgi?id=25118

           Summary: hinting for CAIRO_HINT_STYLE_MEDIUM is wrong
           Product: cairo
           Version: 1.9.5
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: freetype font backend
        AssignedTo: david at freetype.org
        ReportedBy: pierre-bugzilla at ossman.eu
         QAContact: cairo-bugs at cairographics.org


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.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the cairo-bugs mailing list