Subject: bug#6303: Acknowledgement (23.2; Win32 Antialiased fonts)

From: Damyan Pepper <[email-masked]>
Date: Thu, 3 Jun 2010 12:56:36 +0100

Attached is a bzr bundle that should fix this issue.
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: dpepper@sw-gbbr-brsd015-20100603115304-efdx2p1rxkr33nrw
# target_branch: http://bzr.savannah.gnu.org/r/emacs/trunk/
# testament_sha1: 10916b73a779dc2471a1329e7952048079784c8e
# timestamp: 2010-06-03 12:53:47 +0100
# base_revision_id: [email-masked]
# 
# Begin patch
=== modified file 'src/ChangeLog'
--- src/ChangeLog	2010-06-03 05:50:48 +0000
+++ src/ChangeLog	2010-06-03 11:53:04 +0000
@@ -1,3 +1,7 @@
+2010-06-03  Damyan Pepper  <[email-masked]>
+
+	* w32font.c (w32font_filter_properties): New function.
+
 2010-06-03  Glenn Morris  <[email-masked]>
 
 	* m/template.h (NO_SOCK_SIGIO): Remove, no longer used.

=== modified file 'src/w32font.c'
--- src/w32font.c	2010-01-13 08:35:10 +0000
+++ src/w32font.c	2010-06-03 11:53:04 +0000
@@ -2446,6 +2446,59 @@
   return DECODE_SYSTEM (build_string (buf));
 }
 
+static const char *w32font_booleans [] = {
+  NULL,
+};
+
+static const char *w32font_non_booleans [] = {
+  ":script",
+  ":antialias",
+  NULL,
+};
+
+static void
+w32font_filter_properties (font, alist)
+    Lisp_Object font;
+    Lisp_Object alist;
+{
+  Lisp_Object it;
+  int i;
+  
+  /* Set boolean values to Qt or Qnil */
+  for (i = 0; w32font_booleans[i] != NULL; ++i)
+    for (it = alist; ! NILP (it); it = XCDR (it))
+      {
+        Lisp_Object key = XCAR (XCAR (it));
+        Lisp_Object val = XCDR (XCAR (it));
+        char *keystr = SDATA (SYMBOL_NAME (key));
+
+        if (strcmp (w32font_booleans[i], keystr) == 0)
+          {
+            char *str = SYMBOLP (val) ? SDATA (SYMBOL_NAME (val)) : NULL;
+            if (INTEGERP (val)) str = XINT (val) != 0 ? "true" : "false";
+            if (str == NULL) str = "true";
+
+            val = Qt;
+            if (strcmp ("false", str) == 0 || strcmp ("False", str) == 0
+                || strcmp ("FALSE", str) == 0 || strcmp ("FcFalse", str) == 0
+                || strcmp ("off", str) == 0 || strcmp ("OFF", str) == 0
+                || strcmp ("Off", str) == 0)
+              val = Qnil;
+            Ffont_put (font, key, val);
+          }
+      }
+
+  for (i = 0; w32font_non_booleans[i] != NULL; ++i)
+    for (it = alist; ! NILP (it); it = XCDR (it))
+      {
+        Lisp_Object key = XCAR (XCAR (it));
+        Lisp_Object val = XCDR (XCAR (it));
+        char *keystr = SDATA (SYMBOL_NAME (key));
+        if (strcmp (w32font_non_booleans[i], keystr) == 0)
+          Ffont_put (font, key, val);
+      }
+}
+
 struct font_driver w32font_driver =
   {
     0, /* Qgdi */
@@ -2475,7 +2528,7 @@
     NULL, /* shape */
     NULL, /* check */
     NULL, /* get_variation_glyphs */
-    NULL, /* filter_properties */
+    w32font_filter_properties,
   };

# Begin bundle