changeset 95359:f6580a4c58da

(font_parse_family_registry): Use Ffont_put to validate foundry and family. (font_delete_unmatched): Don't check spacing. (font_list_entities): Add spacing to the spec to list fonts.
author Kenichi Handa <handa@m17n.org>
date Wed, 28 May 2008 11:47:01 +0000
parents 9c54d4f00cf6
children f472b6b1baa8
files src/font.c
diffstat 1 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/font.c	Wed May 28 11:45:29 2008 +0000
+++ b/src/font.c	Wed May 28 11:47:01 2008 +0000
@@ -1574,11 +1574,10 @@
 	{
 	  if ((*p0 != '*' || p1 - p0 > 1)
 	      && NILP (AREF (font_spec, FONT_FOUNDRY_INDEX)))
-	    ASET (font_spec, FONT_FOUNDRY_INDEX,
-		  font_intern_prop (p0, p1 - p0));
+	    Ffont_put (font_spec, QCfoundry, font_intern_prop (p0, p1 - p0));
 	  p1++;
 	  len -= p1 - p0;
-	  ASET (font_spec, FONT_FAMILY_INDEX, font_intern_prop (p1, len));
+	  Ffont_put (font_spec, QCfamily, font_intern_prop (p1, len));
 	}
       else
 	ASET (font_spec, FONT_FAMILY_INDEX, Fintern (family, Qnil));
@@ -2378,11 +2377,6 @@
 		  : diff > FONT_PIXEL_SIZE_QUANTUM))
 	    prop = FONT_SPEC_MAX;
 	}
-      if (prop < FONT_SPEC_MAX
-	  && INTEGERP (AREF (spec, FONT_SPACING_INDEX))
-	  && ! EQ (AREF (spec, FONT_SPACING_INDEX),
-		   AREF (entity, FONT_SPACING_INDEX)))
-	prop = FONT_SPEC_MAX;
       if (prop < FONT_SPEC_MAX)
 	val = Fcons (entity, val);
     }
@@ -2430,12 +2424,13 @@
   ftype = AREF (spec, FONT_TYPE_INDEX);
   for (i = 1; i <= FONT_REGISTRY_INDEX; i++)
     ASET (scratch_font_spec, i, AREF (spec, i));
-  for (; i < FONT_EXTRA_INDEX; i++)
+  for (i = FONT_DPI_INDEX; i < FONT_EXTRA_INDEX; i += 2)
     {
       ASET (scratch_font_spec, i, Qnil);
       if (! NILP (AREF (spec, i)))
 	need_filtering = 1;
     }
+  ASET (scratch_font_spec, FONT_SPACING_INDEX, AREF (spec, FONT_SPACING_INDEX));
   ASET (scratch_font_spec, FONT_EXTRA_INDEX, AREF (spec, FONT_EXTRA_INDEX));
 
   vec = alloca (sizeof (Lisp_Object) * num_font_drivers * n_family);