aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2008-06-13 12:29:55 +0000
committerKenichi Handa2008-06-13 12:29:55 +0000
commitd0a477766dfa024f121e05c0de22fbb6833a113c (patch)
tree20277bf2e0c76a457eda311ea760f4bc595a5213 /src
parenta2e860b3db5a169d5c2560675e27982b49e836a4 (diff)
downloademacs-d0a477766dfa024f121e05c0de22fbb6833a113c.tar.gz
emacs-d0a477766dfa024f121e05c0de22fbb6833a113c.zip
(font_find_for_lface): If registry is NULL, try iso8859-1 and ascii-0.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog2
-rw-r--r--src/font.c38
2 files changed, 26 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2aa8145d2e1..88aa859b8e0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -39,7 +39,7 @@
39 (font_update_lface): Don't parse "foundry-family" form here. 39 (font_update_lface): Don't parse "foundry-family" form here.
40 Handle FONT_FOUNDRY_INDEX. 40 Handle FONT_FOUNDRY_INDEX.
41 (font_find_for_lface): Likewise. Handle alternate families here. 41 (font_find_for_lface): Likewise. Handle alternate families here.
42 If registry is NULL, try iso8859-1 and ascii-0. 42 If registry is nil, try iso8859-1 and ascii-0.
43 (font_open_for_lface): Pay attention to size in ENTITY. 43 (font_open_for_lface): Pay attention to size in ENTITY.
44 (font_open_by_name): Simplify by calling font_load_for_lface. 44 (font_open_by_name): Simplify by calling font_load_for_lface.
45 (free_font_driver_list): Delete it. 45 (free_font_driver_list): Delete it.
diff --git a/src/font.c b/src/font.c
index 47eeac3175c..ee1f7e4dd10 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2896,9 +2896,19 @@ font_find_for_lface (f, attrs, spec, c)
2896{ 2896{
2897 Lisp_Object work; 2897 Lisp_Object work;
2898 Lisp_Object frame, entities, val, props[FONT_REGISTRY_INDEX + 1] ; 2898 Lisp_Object frame, entities, val, props[FONT_REGISTRY_INDEX + 1] ;
2899 Lisp_Object size, foundry[3], *family; 2899 Lisp_Object size, foundry[3], *family, registry[3];
2900 int pixel_size; 2900 int pixel_size;
2901 int i, j, result; 2901 int i, j, k, result;
2902
2903 registry[0] = AREF (spec, FONT_REGISTRY_INDEX);
2904 if (NILP (registry[0]))
2905 {
2906 registry[0] = Qiso8859_1;
2907 registry[1] = Qascii_0;
2908 registry[2] = null_vector;
2909 }
2910 else
2911 registry[1] = null_vector;
2902 2912
2903 if (c >= 0 && ! NILP (AREF (spec, FONT_REGISTRY_INDEX))) 2913 if (c >= 0 && ! NILP (AREF (spec, FONT_REGISTRY_INDEX)))
2904 { 2914 {
@@ -2978,21 +2988,23 @@ font_find_for_lface (f, attrs, spec, c)
2978 } 2988 }
2979 } 2989 }
2980 2990
2981 for (j = 0; SYMBOLP (family[j]); j++) 2991 for (i = 0; SYMBOLP (family[i]); i++)
2982 { 2992 {
2983 ASET (work, FONT_FAMILY_INDEX, family[j]); 2993 ASET (work, FONT_FAMILY_INDEX, family[i]);
2984 for (i = 0; SYMBOLP (foundry[i]); i++) 2994 for (j = 0; SYMBOLP (foundry[j]); j++)
2985 { 2995 {
2986 ASET (work, FONT_FOUNDRY_INDEX, foundry[i]); 2996 ASET (work, FONT_FOUNDRY_INDEX, foundry[j]);
2987 entities = font_list_entities (frame, work); 2997 for (k = 0; SYMBOLP (registry[k]); k++)
2988 if (ASIZE (entities) > 0) 2998 {
2989 break; 2999 ASET (work, FONT_REGISTRY_INDEX, registry[j]);
3000 entities = font_list_entities (frame, work);
3001 if (ASIZE (entities) > 0)
3002 goto found;
3003 }
2990 } 3004 }
2991 if (ASIZE (entities) > 0)
2992 break;
2993 } 3005 }
2994 if (ASIZE (entities) == 0) 3006 return Qnil;
2995 return Qnil; 3007 found:
2996 if (ASIZE (entities) == 1) 3008 if (ASIZE (entities) == 1)
2997 { 3009 {
2998 if (c < 0) 3010 if (c < 0)