changeset 36370:751cb07c5f11

(Fnew_fontset): Fix handling of the case that an element of FONTLIST is a cons of family and registry.
author Kenichi Handa <handa@m17n.org>
date Sat, 24 Feb 2001 02:45:00 +0000
parents 8563da6180ae
children f6bb3ed752b4
files src/fontset.c
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/fontset.c	Sat Feb 24 02:44:38 2001 +0000
+++ b/src/fontset.c	Sat Feb 24 02:45:00 2001 +0000
@@ -899,10 +899,14 @@
       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 @@
   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);
     }