changeset 29501:f901ec87b147

(Fset_fontset_font): The arg CHARACTER may be a charset.
author Kenichi Handa <handa@m17n.org>
date Thu, 08 Jun 2000 01:19:16 +0000
parents c527f79f1399
children dda1305444a6
files src/fontset.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/fontset.c	Thu Jun 08 00:21:15 2000 +0000
+++ b/src/fontset.c	Thu Jun 08 01:19:16 2000 +0000
@@ -972,6 +972,8 @@
 CHARACTER may be a cons; (FROM . TO), where FROM and TO are\n\
 non-generic characters.  In that case, use FONTNAME\n\
 for all characters in the range FROM and TO (inclusive).\n\
+CHARACTER may be a charset.   In that case, use FONTNAME\n\
+for all character in the charsets.\n\
 \n\
 FONTNAME may be a cons; (FAMILY . REGISTRY), where FAMILY is a family\n\
 name of a font, REGSITRY is a registry name of a font.")
@@ -1000,6 +1002,14 @@
 	  && (SINGLE_BYTE_CHAR_P (from) || SINGLE_BYTE_CHAR_P (to)))
 	error ("Can't change font for a single byte character");
     }
+  else if (SYMBOLP (character))
+    {
+      elt = Fget (character, Qcharset);
+      if (!VECTORP (elt) || ASIZE (elt) < 1 || !NATNUMP (AREF (elt, 0)))
+	error ("Invalid charset: %s", (XSYMBOL (character)->name)->data);
+      from = MAKE_CHAR (XINT (AREF (elt, 0)), 0, 0);
+      to = from;
+    }
   else
     {
       CHECK_NUMBER (character, 1);