]> git.eshelyaron.com Git - emacs.git/commitdiff
(font_find_for_lface): If registry is NULL, try iso8859-1 and ascii-0.
authorKenichi Handa <handa@m17n.org>
Fri, 13 Jun 2008 12:29:55 +0000 (12:29 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 13 Jun 2008 12:29:55 +0000 (12:29 +0000)
src/ChangeLog
src/font.c

index 2aa8145d2e13bd7687c91c7fa02f4a53bca1c224..88aa859b8e076a79165ee8b8dc2aa8f36730856c 100644 (file)
@@ -39,7 +39,7 @@
        (font_update_lface): Don't parse "foundry-family" form here.
        Handle FONT_FOUNDRY_INDEX.
        (font_find_for_lface): Likewise.  Handle alternate families here.
-       If registry is NULL, try iso8859-1 and ascii-0.
+       If registry is nil, try iso8859-1 and ascii-0.
        (font_open_for_lface): Pay attention to size in ENTITY.
        (font_open_by_name): Simplify by calling font_load_for_lface.
        (free_font_driver_list): Delete it.
index 47eeac3175c64efe3c53cbd2225812179f766566..ee1f7e4dd1088dd447f28dfc706665387c656920 100644 (file)
@@ -2896,9 +2896,19 @@ font_find_for_lface (f, attrs, spec, c)
 {
   Lisp_Object work;
   Lisp_Object frame, entities, val, props[FONT_REGISTRY_INDEX + 1] ;
-  Lisp_Object size, foundry[3], *family;
+  Lisp_Object size, foundry[3], *family, registry[3];
   int pixel_size;
-  int i, j, result;
+  int i, j, k, result;
+
+  registry[0] = AREF (spec, FONT_REGISTRY_INDEX);
+  if (NILP (registry[0]))
+    {
+      registry[0] = Qiso8859_1;
+      registry[1] = Qascii_0;
+      registry[2] = null_vector;
+    }
+  else
+    registry[1] = null_vector;
 
   if (c >= 0 && ! NILP (AREF (spec, FONT_REGISTRY_INDEX)))
     {
@@ -2978,21 +2988,23 @@ font_find_for_lface (f, attrs, spec, c)
        }
     }
 
-  for (j = 0; SYMBOLP (family[j]); j++)
+  for (i = 0; SYMBOLP (family[i]); i++)
     {
-      ASET (work, FONT_FAMILY_INDEX, family[j]);
-      for (i = 0; SYMBOLP (foundry[i]); i++)
+      ASET (work, FONT_FAMILY_INDEX, family[i]);
+      for (j = 0; SYMBOLP (foundry[j]); j++)
        {
-         ASET (work, FONT_FOUNDRY_INDEX, foundry[i]);
-         entities = font_list_entities (frame, work);
-         if (ASIZE (entities) > 0)
-           break;
+         ASET (work, FONT_FOUNDRY_INDEX, foundry[j]);
+         for (k = 0; SYMBOLP (registry[k]); k++)
+           {
+             ASET (work, FONT_REGISTRY_INDEX, registry[j]);
+             entities = font_list_entities (frame, work);
+             if (ASIZE (entities) > 0)
+               goto found;
+           }
        }
-      if (ASIZE (entities) > 0)
-       break;
     }
-  if (ASIZE (entities) == 0)
-    return Qnil;
+  return Qnil;
+ found:
   if (ASIZE (entities) == 1)
     {
       if (c < 0)