Commit 6f1d7bcd authored by Tom Callaway's avatar Tom Callaway Committed by Jeremy Huddleston Sequoia

Subpixel LCD text rendering improvements

Reviewed-by: Jeremy Huddleston Sequoia's avatarJeremy Huddleston <jeremyhu@apple.com>
parent 0e0efb8b
......@@ -369,6 +369,10 @@ _XftDefaultInit (Display *dpy)
goto bail1;
if (!_XftDefaultInitInteger (dpy, pat, FC_RGBA))
goto bail1;
#ifdef FC_LCD_FILTER
if (!_XftDefaultInitInteger (dpy, pat, FC_LCD_FILTER))
goto bail1;
#endif
if (!_XftDefaultInitBool (dpy, pat, FC_ANTIALIAS))
goto bail1;
#ifdef FC_EMBOLDEN
......@@ -521,6 +525,14 @@ XftDefaultSubstitute (Display *dpy, int screen, FcPattern *pattern)
XftDefaultGetInteger (dpy, FC_RGBA, screen,
subpixel));
}
#ifdef FC_LCD_FILTER
if (FcPatternGet (pattern, FC_LCD_FILTER, 0, &v) == FcResultNoMatch)
{
FcPatternAddInteger (pattern, FC_LCD_FILTER,
XftDefaultGetInteger (dpy, FC_LCD_FILTER, screen,
FC_LCD_DEFAULT));
}
#endif
if (FcPatternGet (pattern, FC_MINSPACE, 0, &v) == FcResultNoMatch)
{
FcPatternAddBool (pattern, FC_MINSPACE,
......
......@@ -469,6 +469,21 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
goto bail1;
}
#ifdef FC_LCD_FILTER
/*
* Get lcd_filter value
*/
switch (FcPatternGetInteger (pattern, FC_LCD_FILTER, 0, &fi->lcd_filter)) {
case FcResultNoMatch:
fi->lcd_filter = FC_LCD_DEFAULT;
break;
case FcResultMatch:
break;
default:
goto bail1;
}
#endif
/*
* Get matrix and transform values
*/
......
This diff is collapsed.
......@@ -145,6 +145,7 @@ struct _XftFontInfo {
FcBool antialias; /* doing antialiasing */
FcBool embolden; /* force emboldening */
int rgba; /* subpixel order */
int lcd_filter; /* lcd filter */
FT_Matrix matrix; /* glyph transformation matrix */
FcBool transform; /* non-identify matrix? */
FT_Int load_flags; /* glyph load flags */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment