aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2000-05-26 07:33:01 +0000
committerKenichi Handa2000-05-26 07:33:01 +0000
commit2ad001867b5c00ccd3d8542aa7626df98fa74e11 (patch)
tree6cc5672dfd1c05a3fdd2c3d3227bdd84bc530912
parent8a9be3ac66958d3345556b5c1a3c6cad0e2be84a (diff)
downloademacs-2ad001867b5c00ccd3d8542aa7626df98fa74e11.tar.gz
emacs-2ad001867b5c00ccd3d8542aa7626df98fa74e11.zip
Set family names of non-latin charsets in default fontset to "*".
-rw-r--r--lisp/international/fontset.el139
1 files changed, 68 insertions, 71 deletions
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index e72826138d7..efefa72ba7d 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -24,73 +24,75 @@
24 24
25;;; Code: 25;;; Code:
26 26
27;; Set standard REGISTRY of characters in the default fontset to find 27;; Set standard fontname specification of characters in the default
28;; an appropriate font for each charset. This is used to generate a 28;; fontset to find an appropriate font for each charset. This is used
29;; font name for a fontset if the fontset doesn't specify a font name 29;; to generate a font name for a fontset if the fontset doesn't
30;; for a specific character. If the value contains a character `-', 30;; specify a font name for a specific character. The specification
31;; the string before that is embedded in `CHARSET_REGISTRY' field, and 31;; has the form (FAMILY . REGISTRY). FAMILY may be nil, in which
32;; the string after that is embedded in `CHARSET_ENCODING' field. If 32;; case, the family name of default face is used. If REGISTRY
33;; the value does not contain `-', the whole string is embedded in 33;; contains a character `-', the string before that is embedded in
34;; `CHARSET_REGISTRY' field, and a wild card character `*' is embedded 34;; `CHARSET_REGISTRY' field, and the string after that is embedded in
35;; in `CHARSET_ENCODING' field. 35;; `CHARSET_ENCODING' field. If it does not contain `-', the whole
36;; The REGISTRY for ASCII characters are predefined as "ISO8859-1". 36;; string is embedded in `CHARSET_REGISTRY' field, and a wild card
37 37;; character `*' is embedded in `CHARSET_ENCODING' field. The
38(let ((l `((latin-iso8859-1 . "ISO8859-1") 38;; REGISTRY for ASCII characters are predefined as "ISO8859-1".
39 (latin-iso8859-2 . "ISO8859-2") 39
40 (latin-iso8859-3 . "ISO8859-3") 40(let ((l `((latin-iso8859-1 . (nil . "ISO8859-1"))
41 (latin-iso8859-4 . "ISO8859-4") 41 (latin-iso8859-2 . (nil . "ISO8859-2"))
42 (thai-tis620 . "TIS620") 42 (latin-iso8859-3 . (nil . "ISO8859-3"))
43 (greek-iso8859-7 . "ISO8859-7") 43 (latin-iso8859-4 . (nil . "ISO8859-4"))
44 (arabic-iso8859-6 . "ISO8859-6") 44 (thai-tis620 . ("*" . "TIS620"))
45 (hebrew-iso8859-8 . "ISO8859-8") 45 (greek-iso8859-7 . ("*" . "ISO8859-7"))
46 (katakana-jisx0201 . "JISX0201") 46 (arabic-iso8859-6 . ("*" . "ISO8859-6"))
47 (latin-jisx0201 . "JISX0201") 47 (hebrew-iso8859-8 . ("*" . "ISO8859-8"))
48 (cyrillic-iso8859-5 . "ISO8859-5") 48 (katakana-jisx0201 . ("*" . "JISX0201"))
49 (latin-iso8859-9 . "ISO8859-9") 49 (latin-jisx0201 . (nil . "JISX0201"))
50 (japanese-jisx0208-1978 . "JISX0208.1978") 50 (cyrillic-iso8859-5 . ("*" . "ISO8859-5"))
51 (chinese-gb2312 . "GB2312") 51 (latin-iso8859-9 . (nil . "ISO8859-9"))
52 (japanese-jisx0208 . "JISX0208.1983") 52 (japanese-jisx0208-1978 . ("*" . "JISX0208.1978"))
53 (korean-ksc5601 . "KSC5601") 53 (chinese-gb2312 . ("*" . "GB2312"))
54 (japanese-jisx0212 . "JISX0212") 54 (japanese-jisx0208 . ("*" . "JISX0208.1983"))
55 (chinese-cns11643-1 . "CNS11643.1992-1") 55 (korean-ksc5601 . ("*" . "KSC5601"))
56 (chinese-cns11643-2 . "CNS11643.1992-2") 56 (japanese-jisx0212 . ("*" . "JISX0212"))
57 (chinese-cns11643-3 . "CNS11643.1992-3") 57 (chinese-cns11643-1 . ("*" . "CNS11643.1992-1"))
58 (chinese-cns11643-4 . "CNS11643.1992-4") 58 (chinese-cns11643-2 . ("*" . "CNS11643.1992-2"))
59 (chinese-cns11643-5 . "CNS11643.1992-5") 59 (chinese-cns11643-3 . ("*" . "CNS11643.1992-3"))
60 (chinese-cns11643-6 . "CNS11643.1992-6") 60 (chinese-cns11643-4 . ("*" . "CNS11643.1992-4"))
61 (chinese-cns11643-7 . "CNS11643.1992-7") 61 (chinese-cns11643-5 . ("*" . "CNS11643.1992-5"))
62 (chinese-big5-1 . "Big5") 62 (chinese-cns11643-6 . ("*" . "CNS11643.1992-6"))
63 (chinese-big5-2 . "Big5") 63 (chinese-cns11643-7 . ("*" . "CNS11643.1992-7"))
64 (chinese-sisheng . "sisheng_cwnn") 64 (chinese-big5-1 . ("*" . "Big5"))
65 (vietnamese-viscii-lower . "VISCII1.1") 65 (chinese-big5-2 . ("*" . "Big5"))
66 (vietnamese-viscii-upper . "VISCII1.1") 66 (chinese-sisheng . (nil . "sisheng_cwnn"))
67 (arabic-digit . "MuleArabic-0") 67 (vietnamese-viscii-lower . (nil . "VISCII1.1"))
68 (arabic-1-column . "MuleArabic-1") 68 (vietnamese-viscii-upper . (nil . "VISCII1.1"))
69 (arabic-2-column . "MuleArabic-2") 69 (arabic-digit . ("*" . "MuleArabic-0"))
70 (ipa . "MuleIPA") 70 (arabic-1-column . ("*" . "MuleArabic-1"))
71 (ethiopic . "Ethiopic-Unicode") 71 (arabic-2-column . ("*" . "MuleArabic-2"))
72 (ascii-right-to-left . "ISO8859-1") 72 (ipa . (nil . "MuleIPA"))
73 (indian-is13194 . "IS13194-Devanagari") 73 (ethiopic . ("*" . "Ethiopic-Unicode"))
74 (indian-2-column . "MuleIndian-2") 74 (ascii-right-to-left . (nil . "ISO8859-1"))
75 (indian-1-column . "MuleIndian-1") 75 (indian-is13194 . ("*" . "IS13194-Devanagari"))
76 (lao . "MuleLao-1") 76 (indian-2-column . ("*" . "MuleIndian-2"))
77 (tibetan . "MuleTibetan-0") 77 (indian-1-column . ("*" . "MuleIndian-1"))
78 (tibetan-1-column . "MuleTibetan-1") 78 (lao . ("*" . "MuleLao-1"))
79 (latin-iso8859-14 . "ISO8859-14") 79 (tibetan . ("*" . "MuleTibetan-0"))
80 (latin-iso8859-15 . "ISO8859-15") 80 (tibetan-1-column . ("*" . "MuleTibetan-1"))
81 (mule-unicode-0100-24ff . "ISO10646-1") 81 (latin-iso8859-14 . (nil . "ISO8859-14"))
82 (japanese-jisx0213-1 . "JISX0213") 82 (latin-iso8859-15 . (nil . "ISO8859-15"))
83 (japanese-jisx0213-2 . "JISX0213") 83 (mule-unicode-0100-24ff . (nil . "ISO10646-1"))
84 (japanese-jisx0213-1 . ("*" . "JISX0213"))
85 (japanese-jisx0213-2 . ("*" . "JISX0213"))
84 )) 86 ))
85 charset registry arg) 87 charset font-spec arg)
86 (while l 88 (while l
87 (setq charset (car (car l)) registry (cdr (car l)) l (cdr l)) 89 (setq charset (car (car l)) font-spec (cdr (car l)) l (cdr l))
88 (or (string-match "-" registry) 90 (or (string-match "-" (cdr font-spec))
89 (setq registry (concat registry "*"))) 91 (setcdr font-spec (concat (cdr font-spec) "*")))
90 (if (symbolp charset) 92 (if (symbolp charset)
91 (setq arg (make-char charset)) 93 (setq arg (make-char charset))
92 (setq arg charset)) 94 (setq arg charset))
93 (set-fontset-font t arg registry))) 95 (set-fontset-font "fontset-default" arg font-spec)))
94 96
95;; Set arguments in `font-encoding-alist' (which see). 97;; Set arguments in `font-encoding-alist' (which see).
96(defun set-font-encoding (pattern charset encoding) 98(defun set-font-encoding (pattern charset encoding)
@@ -283,15 +285,10 @@ variable `x-font-name-charset-alist'), add that information to FONTLIST."
283 285
284 ;; If font for ASCII is not specified, add it. 286 ;; If font for ASCII is not specified, add it.
285 (unless ascii-font 287 (unless ascii-font
286 (let ((registry (cdr (fontset-font t 0))) 288 (aset xlfd-fields xlfd-regexp-registry-subnum "iso8859")
287 (encoding nil)) 289 (aset xlfd-fields xlfd-regexp-encoding-subnum "1")
288 (if (string-match "-" registry) 290 (setq ascii-font (x-compose-font-name xlfd-fields))
289 (setq encoding (substring registry (match-end 0)) 291 (setq fontlist (cons (cons 'ascii ascii-font) fontlist)))
290 registry (substring registry 0 (match-beginning 0))))
291 (aset xlfd-fields xlfd-regexp-registry-subnum registry)
292 (aset xlfd-fields xlfd-regexp-encoding-subnum encoding)
293 (setq ascii-font (x-compose-font-name xlfd-fields))
294 (setq fontlist (cons (cons 'ascii ascii-font) fontlist))))
295 292
296 ;; If the font for ASCII also supports the other charsets, and 293 ;; If the font for ASCII also supports the other charsets, and
297 ;; they are not specified in FONTLIST, add them. 294 ;; they are not specified in FONTLIST, add them.