--- pango-1.2.0/pango/pangoft2.c 2002-12-07 07:05:48.000000000 +0100 +++ pango-1.2.0.slighthint/pango/pangoft2.c 2002-12-23 02:37:38.000000000 +0100 @@ -204,6 +204,8 @@ FcPattern *pattern; FcChar8 *filename; FcBool hinting, autohint; + FT_ULong hint_flags; + int hintstyle; int id; pattern = ft2font->font_pattern; @@ -219,8 +221,22 @@ if (FcPatternGetBool (pattern, 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: + hint_flags = FT_HINT_NO_INTEGER_STEM | FT_HINT_NO_VSTEM_ALIGN; + break; + case FC_HINT_MEDIUM: + hint_flags = FT_HINT_NO_INTEGER_STEM; + break; + default: + hint_flags = 0; + } /* force autohinting if requested */ if (FcPatternGetBool (pattern, FC_AUTOHINT, 0, &autohint) != FcResultMatch) @@ -244,7 +260,7 @@ } g_assert (ft2font->face); - + if (!set_unicode_charmap (ft2font->face)) { g_warning ("Unable to load unicode charmap from font file %s", filename); @@ -261,6 +277,8 @@ 0, 0); if (error) g_warning ("Error in FT_Set_Char_Size: %d", error); + + FT_Set_Hint_Flags (ft2font->face, hint_flags); } return ft2font->face;