changeset 95504:00bdff60fc10

(font_prop_validate_spacing): Handle uppercase symbols.
author Kenichi Handa <handa@m17n.org>
date Tue, 03 Jun 2008 05:57:56 +0000
parents 1699a530f6a3
children e80f4eb078ee
files src/font.c
diffstat 1 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/font.c	Tue Jun 03 05:57:28 2008 +0000
+++ b/src/font.c	Tue Jun 03 05:57:56 2008 +0000
@@ -537,14 +537,19 @@
 {
   if (NILP (val) || (NATNUMP (val) && XINT (val) <= FONT_SPACING_CHARCELL))
     return val;
-  if (EQ (val, Qc))
-    return make_number (FONT_SPACING_CHARCELL);
-  if (EQ (val, Qm))
-    return make_number (FONT_SPACING_MONO);
-  if (EQ (val, Qp))
-    return make_number (FONT_SPACING_PROPORTIONAL);
-  if (EQ (val, Qd))
-    return make_number (FONT_SPACING_DUAL);
+  if (SYMBOLP (val) && SBYTES (SYMBOL_NAME (val)) == 1)
+    {
+      char spacing = SDATA (SYMBOL_NAME (val))[0];
+
+      if (spacing == 'c' || spacing == 'C')
+	return make_number (FONT_SPACING_CHARCELL);
+      if (spacing == 'm' || spacing == 'M')
+	return make_number (FONT_SPACING_MONO);
+      if (spacing == 'P' || spacing == 'P')
+	return make_number (FONT_SPACING_PROPORTIONAL);
+      if (spacing == 'd' || spacing == 'D')
+	return make_number (FONT_SPACING_DUAL);
+    }
   return Qerror;
 }