diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | pango/pangoft2.c | 18 |
2 files changed, 21 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2007-01-18 Behdad Esfahbod <behdad@gnome.org> + + * pango/pangoft2.c (pango_ft2_font_get_face): Respect FC_HINT_STYLE. + Patch has been in Fedora for ages. + 2007-01-17 Behdad Esfahbod <behdad@gnome.org> * === Released 1.15.4 === diff --git a/pango/pangoft2.c b/pango/pangoft2.c index 5430c323..25144dbf 100644 --- a/pango/pangoft2.c +++ b/pango/pangoft2.c @@ -173,6 +173,7 @@ pango_ft2_font_get_face (PangoFont *font) FcPattern *pattern; FcChar8 *filename; FcBool antialias, hinting, autohint; + int hintstyle; int id; if (G_UNLIKELY (!PANGO_FT2_IS_FONT (font))) @@ -206,8 +207,21 @@ pango_ft2_font_get_face (PangoFont *font) FC_HINTING, 0, &hinting) != FcResultMatch) hinting = FcTrue; - if (!hinting) - ft2font->load_flags |= FT_LOAD_NO_HINTING; + if (FcPatternGetInteger (pattern, FC_HINT_STYLE, 0, &hintstyle) != FcResultMatch) + hintstyle = FC_HINT_FULL; + + if (!hinting || hintstyle == FC_HINT_NONE) + ft2font->load_flags |= FT_LOAD_NO_HINTING; + + switch (hintstyle) { + case FC_HINT_SLIGHT: + case FC_HINT_MEDIUM: + ft2font->load_flags |= FT_LOAD_TARGET_LIGHT; + break; + default: + ft2font->load_flags |= FT_LOAD_TARGET_NORMAL; + break; + } /* force autohinting if requested */ if (FcPatternGetBool (pattern, |