changeset 106089:b40edfe3e412

#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.
author Jan Djärv <jan.h.d@swipnet.se>
date Tue, 17 Nov 2009 09:53:45 +0000
parents f0e197e42a50
children e0ed1e2210d7
files src/ChangeLog src/xftfont.c src/xsettings.c
diffstat 3 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Nov 17 09:19:12 2009 +0000
+++ b/src/ChangeLog	Tue Nov 17 09:53:45 2009 +0000
@@ -1,5 +1,10 @@
 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
--- a/src/xftfont.c	Tue Nov 17 09:19:12 2009 +0000
+++ b/src/xftfont.c	Tue Nov 17 09:53:45 2009 +0000
@@ -214,11 +214,14 @@
       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);
--- a/src/xsettings.c	Tue Nov 17 09:19:12 2009 +0000
+++ b/src/xsettings.c	Tue Nov 17 09:53:45 2009 +0000
@@ -310,6 +310,8 @@
             }
           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 @@
               else if (strcmp (sval, "lcddefault") == 0)
                 settings->lcdfilter = FC_LCD_DEFAULT;
             }
+#endif
         }
     }
 
@@ -376,7 +379,10 @@
   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 @@
       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);