Commit a6eb20d8 authored by Jan Djärv's avatar Jan Djärv

#ifdef on FC_LCD_FILTER.

* xftfont.c (xftfont_fix_match): Older versions of fontconfig does
not have FC_LCD_FILTER.  #ifdef it.

* xsettings.c (parse_xft_settings, apply_xft_settings): Ditto

* xftfont.c (xftfont_fix_match): New function.
(xftfont_open): Call XftDefaultSubstitute before XftFontMatch.
Call xftfont_fix_match after XftFontMatch.
parent ad413b35
2009-11-17 Jan Djärv <jan.h.d@swipnet.se>
* xftfont.c (xftfont_fix_match): Older versions of fontconfig does
not have FC_LCD_FILTER. #ifdef it.
* xsettings.c (parse_xft_settings, apply_xft_settings): Ditto
* xterm.h (struct x_display_info): Add atoms and Window for xsettings.
* xterm.c (handle_one_xevent): Call xft_settings_event for
......
......@@ -214,11 +214,14 @@ xftfont_fix_match (pat, match)
FcPatternDel (match, FC_HINT_STYLE);
FcPatternAddInteger (match, FC_HINT_STYLE, i);
}
#ifdef FC_LCD_FILTER
/* Older fontconfig versions don't have FC_LCD_FILTER. */
if (FcResultMatch == FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &i))
{
FcPatternDel (match, FC_LCD_FILTER);
FcPatternAddInteger (match, FC_LCD_FILTER, i);
}
#endif
if (FcResultMatch == FcPatternGetInteger (pat, FC_RGBA, 0, &i))
{
FcPatternDel (match, FC_RGBA);
......
......@@ -310,6 +310,8 @@ parse_xft_settings (prop, bytes, settings)
}
else if (strcmp (name, "Xft/DPI") == 0)
settings->dpi = (double)ival/1024.0;
#ifdef FC_LCD_FILTER
/* Older fontconfig versions don't have FC_LCD_FILTER. */
else if (strcmp (name, "Xft/lcdfilter") == 0)
{
if (strcmp (sval, "none") == 0)
......@@ -317,6 +319,7 @@ parse_xft_settings (prop, bytes, settings)
else if (strcmp (sval, "lcddefault") == 0)
settings->lcdfilter = FC_LCD_DEFAULT;
}
#endif
}
}
......@@ -376,7 +379,10 @@ apply_xft_settings (dpyinfo, send_event_p)
FcPatternGetBool (pat, FC_ANTIALIAS, 0, &oldsettings.aa);
FcPatternGetBool (pat, FC_HINTING, 0, &oldsettings.hinting);
FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &oldsettings.hintstyle);
#ifdef FC_LCD_FILTER
/* Older fontconfig versions don't have FC_LCD_FILTER. */
FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &oldsettings.lcdfilter);
#endif
FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba);
FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi);
......@@ -398,12 +404,15 @@ apply_xft_settings (dpyinfo, send_event_p)
FcPatternAddInteger (pat, FC_RGBA, settings.rgba);
++changed;
}
#ifdef FC_LCD_FILTER
/* Older fontconfig versions don't have FC_LCD_FILTER. */
if (oldsettings.lcdfilter != settings.lcdfilter)
{
FcPatternDel (pat, FC_LCD_FILTER);
FcPatternAddInteger (pat, FC_LCD_FILTER, settings.lcdfilter);
++changed;
}
#endif
if (oldsettings.hintstyle != settings.hintstyle)
{
FcPatternDel (pat, FC_HINT_STYLE);
......
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