summaryrefslogtreecommitdiff
path: root/pango/pangoft2.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-01-18 05:37:19 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-01-18 05:37:19 +0000
commit217f405cf45ad6793b2796bfada37c1642007a93 (patch)
tree8bd5507747e1b4d7b13888f554d9bf522847b832 /pango/pangoft2.c
parentd24eaa5a519e173a87dea1b08506458ab45ac89d (diff)
downloadpango-217f405cf45ad6793b2796bfada37c1642007a93.tar.gz
Respect FC_HINT_STYLE. Patch has been in Fedora for ages.
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. svn path=/trunk/; revision=2174
Diffstat (limited to 'pango/pangoft2.c')
-rw-r--r--pango/pangoft2.c18
1 files changed, 16 insertions, 2 deletions
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,