aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2000-05-26 07:27:30 +0000
committerKenichi Handa2000-05-26 07:27:30 +0000
commit8a9be3ac66958d3345556b5c1a3c6cad0e2be84a (patch)
tree28b69d8604f08276f6a22d994cbb342d168b246c /src
parentdf2fbcebeb19bbe0e783595a7014a681bfe31a5d (diff)
downloademacs-8a9be3ac66958d3345556b5c1a3c6cad0e2be84a.tar.gz
emacs-8a9be3ac66958d3345556b5c1a3c6cad0e2be84a.zip
(check_registry_encoding): This function deleted.
(Fset_fontset_font): Remove the adhoc condition for the default fontset. Allow cons in FONTNAME.
Diffstat (limited to 'src')
-rw-r--r--src/fontset.c47
1 files changed, 16 insertions, 31 deletions
diff --git a/src/fontset.c b/src/fontset.c
index c713b3bbd84..fba4831c3fb 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -946,26 +946,6 @@ clear_fontset_elements (fontset)
946} 946}
947 947
948 948
949/* Return 1 iff REGISTRY is a valid string as the font registry and
950 encoding. It is valid if it doesn't start with `-' and the number
951 of `-' in the string is at most 1. */
952
953static int
954check_registry_encoding (registry)
955 Lisp_Object registry;
956{
957 unsigned char *str = XSTRING (registry)->data;
958 unsigned char *p = str;
959 int i;
960
961 if (!*p || *p++ == '-')
962 return 0;
963 for (i = 0; *p; p++)
964 if (*p == '-') i++;
965 return (i < 2);
966}
967
968
969/* Check validity of NAME as a fontset name and return the 949/* Check validity of NAME as a fontset name and return the
970 corresponding fontset. If not valid, signal an error. 950 corresponding fontset. If not valid, signal an error.
971 If NAME is t, return Vdefault_fontset. */ 951 If NAME is t, return Vdefault_fontset. */
@@ -993,9 +973,8 @@ CHARACTER may be a cons; (FROM . TO), where FROM and TO are\n\
993non-generic characters. In that case, use FONTNAME\n\ 973non-generic characters. In that case, use FONTNAME\n\
994for all characters in the range FROM and TO (inclusive).\n\ 974for all characters in the range FROM and TO (inclusive).\n\
995\n\ 975\n\
996If NAME is t, an entry in the default fontset is modified.\n\ 976FONTNAME may be a cons; (FAMILY . REGISTRY), where FAMILY is a family\n\
997In that case, FONTNAME should be a registry and encoding name\n\ 977name of a font, REGSITRY is a registry name of a font.")
998of a font for CHARACTER.")
999 (name, character, fontname, frame) 978 (name, character, fontname, frame)
1000 Lisp_Object name, character, fontname, frame; 979 Lisp_Object name, character, fontname, frame;
1001{ 980{
@@ -1003,6 +982,7 @@ of a font for CHARACTER.")
1003 Lisp_Object realized; 982 Lisp_Object realized;
1004 int from, to; 983 int from, to;
1005 int id; 984 int id;
985 Lisp_Object family, registry;
1006 986
1007 fontset = check_fontset_name (name); 987 fontset = check_fontset_name (name);
1008 988
@@ -1038,17 +1018,22 @@ of a font for CHARACTER.")
1038 error ("Can't change font for a single byte character"); 1018 error ("Can't change font for a single byte character");
1039 } 1019 }
1040 1020
1041 CHECK_STRING (fontname, 2); 1021 if (STRINGP (fontname))
1042 fontname = Fdowncase (fontname);
1043 if (EQ (fontset, Vdefault_fontset))
1044 { 1022 {
1045 if (!check_registry_encoding (fontname)) 1023 fontname = Fdowncase (fontname);
1046 error ("Invalid registry and encoding name: %s", 1024 elt = Fcons (make_number (from), font_family_registry (fontname));
1047 XSTRING (fontname)->data);
1048 elt = Fcons (make_number (from), Fcons (Qnil, fontname));
1049 } 1025 }
1050 else 1026 else
1051 elt = Fcons (make_number (from), font_family_registry (fontname)); 1027 {
1028 CHECK_CONS (fontname, 2);
1029 family = XCAR (fontname);
1030 registry = XCDR (fontname);
1031 if (!NILP (family))
1032 CHECK_STRING (family, 2);
1033 if (!NILP (registry))
1034 CHECK_STRING (registry, 2);
1035 elt = Fcons (make_number (from), Fcons (family, registry));
1036 }
1052 1037
1053 /* The arg FRAME is kept for backward compatibility. We only check 1038 /* The arg FRAME is kept for backward compatibility. We only check
1054 the validity. */ 1039 the validity. */