Pango Hinting when using freetype backend



I would have suspected, that using the freetype backend for pango will result in the same output rendered to screen as when using the cairo backend.
Testing it by calling:
pango-view --backend=cairo --font="DejaVu Sans" test.txt
and
pango-view --backend=ft2 --font="DejaVu Sans" test.txt
showed that this is not the case. When playing with the hinting parameter "--hinting" it seems like the freetype backend completly ignores hinting. At least when setting hinting=none the cairo backend shows similar results as when using the freetype backend with any hinting setting.

I'm asking because I'm currently try to add the pango library (without cairo because of the big dependencies added by it) to our own software. And the rendering results look a bit blurry.

Calling pango_ft2_font_map_set_resolution and pango_ft2_font_map_set_default_substitute with the following substitute function:

static void substitute_func (FcPattern *pattern, gpointer data G_GNUC_UNUSED)
{
  if (OPT_HINTING != HINT_DEFAULT)
    {
      FcPatternDel (pattern, FC_HINTING);
      FcPatternAddBool (pattern, FC_HINTING, OPT_HINTING != HINT_NONE);

      FcPatternDel (pattern, FC_AUTOHINT);
      FcPatternAddBool (pattern, FC_AUTOHINT, OPT_HINTING == HINT_AUTO);
    }
}

does not seem to make any difference regardless of what DPI and OPT_HINTING I have defined. So after testing the freetype backend with the pango-view example under Ubuntu 13.10 I'm wondering if hinting is configurable (and usable) at all when using the freetype backend.


Any help would be greatly appreciated.

Regards,
    Volker


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]