summaryrefslogtreecommitdiff
path: root/src/fontset.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2001-02-24 02:45:00 +0000
committerKenichi Handa <handa@m17n.org>2001-02-24 02:45:00 +0000
commit41d79f4d2b18fd016b5dceb73b90a01d94d61409 (patch)
tree79324162abc4795e24fd289996af13fcbfc5d4d3 /src/fontset.c
parent66c56ed161e7a30bb22b27b20de54f0d86813476 (diff)
downloademacs-41d79f4d2b18fd016b5dceb73b90a01d94d61409.tar.gz
(Fnew_fontset): Fix handling of the case that an
element of FONTLIST is a cons of family and registry.
Diffstat (limited to 'src/fontset.c')
-rw-r--r--src/fontset.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 51980e69b78..5797c8d3dfa 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -899,10 +899,14 @@ FONTLIST is an alist of charsets vs corresponding font name patterns.")
tem = XCAR (tail);
if (!CONSP (tem)
|| (charset = get_charset_id (XCAR (tem))) < 0
- || !STRINGP (XCDR (tem)))
- error ("Elements of fontlist must be a cons of charset and font name");
+ || (!STRINGP (XCDR (tem)) && !CONSP (XCDR (tem))))
+ error ("Elements of fontlist must be a cons of charset and font name pattern");
- tem = Fdowncase (XCDR (tem));
+ tem = XCDR (tem);
+ if (STRINGP (tem))
+ tem = Fdowncase (tem);
+ else
+ tem = Fcons (Fdowncase (Fcar (tem)), Fdowncase (Fcdr (tem)));
if (charset == CHARSET_ASCII)
ascii_font = tem;
else
@@ -920,7 +924,10 @@ FONTLIST is an alist of charsets vs corresponding font name patterns.")
for (; CONSP (elements); elements = XCDR (elements))
{
elt = XCAR (elements);
- tem = Fcons (XCAR (elt), font_family_registry (XCDR (elt), 0));
+ tem = XCDR (elt);
+ if (STRINGP (tem))
+ tem = font_family_registry (tem, 0);
+ tem = Fcons (XCAR (elt), tem);
FONTSET_SET (fontset, XINT (XCAR (elt)), tem);
}