Commit 21050de1 authored by Jan Djärv's avatar Jan Djärv

* xftfont.c (xftfont_fix_match): Older versions of fontconfig does

not have FC_LCD_*.  #define them if not there.
parent e268e987
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.
not have FC_LCD_*. #define them if not there.
* xsettings.c (parse_xft_settings, apply_xft_settings): Ditto
......
......@@ -214,14 +214,15 @@ xftfont_fix_match (pat, match)
FcPatternDel (match, FC_HINT_STYLE);
FcPatternAddInteger (match, FC_HINT_STYLE, i);
}
#ifdef FC_LCD_FILTER
#ifndef FC_LCD_FILTER
/* Older fontconfig versions don't have FC_LCD_FILTER. */
#define FC_LCD_FILTER "lcdfilter"
#endif
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);
......
......@@ -105,6 +105,17 @@ something_changedCB (client, cnxn_id, entry, user_data)
#ifdef HAVE_XFT
/* Older fontconfig versions don't have FC_LCD_*. */
#ifndef FC_LCD_NONE
#define FC_LCD_NONE 0
#endif
#ifndef FC_LCD_DEFAULT
#define FC_LCD_DEFAULT 1
#endif
#ifndef FC_LCD_FILTER
#define FC_LCD_FILTER "lcdfilter"
#endif
/* Find the window that contains the XSETTINGS property values. */
static void
......@@ -310,8 +321,6 @@ 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)
......@@ -319,7 +328,6 @@ parse_xft_settings (prop, bytes, settings)
else if (strcmp (sval, "lcddefault") == 0)
settings->lcdfilter = FC_LCD_DEFAULT;
}
#endif
}
}
......@@ -379,10 +387,7 @@ 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);
......@@ -404,7 +409,6 @@ 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)
{
......@@ -412,7 +416,6 @@ apply_xft_settings (dpyinfo, send_event_p)
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