aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2004-02-13 02:17:24 +0000
committerKenichi Handa2004-02-13 02:17:24 +0000
commit57e13af9da81ad2d3e120ec182651d014dcef2d1 (patch)
treec166c22ea456e96e811a76efc73d1665fbedb2dd /src
parent45a830cfb4968322345c7f7191dcd99aa4ae7160 (diff)
downloademacs-57e13af9da81ad2d3e120ec182651d014dcef2d1.tar.gz
emacs-57e13af9da81ad2d3e120ec182651d014dcef2d1.zip
(Fset_fontset_font): Fix previous change.
Diffstat (limited to 'src')
-rw-r--r--src/fontset.c44
1 files changed, 32 insertions, 12 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 3451ce459f5..43ff5372add 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -84,16 +84,17 @@ EXFUN (Fclear_face_cache, 1);
84 where FAMILY, WEIGHT, SLANT, SWIDTH, ADSTYLE, REGISTRY, and 84 where FAMILY, WEIGHT, SLANT, SWIDTH, ADSTYLE, REGISTRY, and
85 FONT-NAME are strings. 85 FONT-NAME are strings.
86 86
87 ENCODING is a charset ID or a char-table that can convert 87 ENCODING is a charset ID that can convert characters to glyph codes
88 characters to glyph codes of the corresponding font. 88 of the corresponding font.
89 89
90 REPERTORY is a charset ID or nil. If REPERTORY is a charset ID, 90 REPERTORY is a charset ID, a char-table, or nil. If REPERTORY is a
91 the repertory of the charset exactly matches with that of the font. 91 charset ID, the repertory of the charset exactly matches with that
92 If REPERTORY is nil, we consult with the font itself to get the 92 of the font. If REPERTORY is a char-table, all characters who have
93 repertory. 93 a non-nil value in the table are supported. If REPERTORY is nil,
94 we consult with the font itself to get the repertory.
94 95
95 ENCODING and REPERTORY are extracted from the variable 96 ENCODING and REPERTORY are extracted from the variable
96 Vfont_encoding_alist by using a font name generated form FONT-SPEC 97 Vfont_encoding_alist by using a font name generated from FONT-SPEC
97 (if it is a vector) or FONT-NAME as a key. 98 (if it is a vector) or FONT-NAME as a key.
98 99
99 100
@@ -615,6 +616,13 @@ fontset_face (fontset, c, face, id)
615 /* This font can't display C. */ 616 /* This font can't display C. */
616 continue; 617 continue;
617 } 618 }
619 else if (CHAR_TABLE_P (AREF (font_def, 2)))
620 {
621 /* The repertory is specified by a char table. */
622 if (NILP (CHAR_TABLE_REF (AREF (font_def, 2), c)))
623 /* This font can't display C. */
624 continue;
625 }
618 else 626 else
619 { 627 {
620 Lisp_Object slot; 628 Lisp_Object slot;
@@ -1003,9 +1011,8 @@ find_font_encoding (fontname)
1003 : CONSP (XCDR (elt)) && CHARSETP (XCAR (XCDR (elt))))) 1011 : CONSP (XCDR (elt)) && CHARSETP (XCAR (XCDR (elt)))))
1004 return (XCDR (elt)); 1012 return (XCDR (elt));
1005 } 1013 }
1006 /* We don't know the encoding of this font. Let's assume Unicode 1014 /* We don't know the encoding of this font. */
1007 encoding. */ 1015 return Qnil;
1008 return Qunicode;
1009} 1016}
1010 1017
1011 1018
@@ -1383,12 +1390,25 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
1383 encoding = find_font_encoding ((char *) SDATA (font_spec)); 1390 encoding = find_font_encoding ((char *) SDATA (font_spec));
1384 else 1391 else
1385 encoding = find_font_encoding ((char *) SDATA (registry)); 1392 encoding = find_font_encoding ((char *) SDATA (registry));
1393 if (NILP (encoding))
1394 /* We don't know how to use this font. */
1395 return Qnil;
1386 if (SYMBOLP (encoding)) 1396 if (SYMBOLP (encoding))
1387 encoding = repertory = CHARSET_SYMBOL_ID (encoding); 1397 {
1398 CHECK_CHARSET (encoding);
1399 encoding = repertory = CHARSET_SYMBOL_ID (encoding);
1400 }
1388 else 1401 else
1389 { 1402 {
1390 repertory = XCDR (encoding); 1403 repertory = XCDR (encoding);
1391 encoding = CHARSET_SYMBOL_ID (XCAR (encoding)); 1404 encoding = XCAR (encoding);
1405 CHECK_CHARSET (encoding);
1406 encoding = CHARSET_SYMBOL_ID (encoding);
1407 if (! NILP (repertory) && SYMBOLP (repertory))
1408 {
1409 CHECK_CHARSET (repertory);
1410 repertory = CHARSET_SYMBOL_ID (repertory);
1411 }
1392 } 1412 }
1393 font_def = Fmake_vector (make_number (3), font_spec); 1413 font_def = Fmake_vector (make_number (3), font_spec);
1394 ASET (font_def, 1, encoding); 1414 ASET (font_def, 1, encoding);