Mercurial > emacs
annotate lisp/international/fontset.el @ 89325:58d5f88f985b
(x-complement-fontset-spec): If a fontname doesn't conform to XLFD
format, try to get XLFD name by x-list-fonts.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 06 Jan 2003 01:12:14 +0000 |
parents | 865b111141b6 |
children | 8f8c7d4c2e6e |
rev | line source |
---|---|
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36368
diff
changeset
|
1 ;;; fontset.el --- commands for handling fontset |
17052 | 2 |
18377
8b4a66c66dd6
Change copyright notice.
Richard M. Stallman <rms@gnu.org>
parents:
18350
diff
changeset
|
3 ;; Copyright (C) 1995, 1997 Electrotechnical Laboratory, JAPAN. |
8b4a66c66dd6
Change copyright notice.
Richard M. Stallman <rms@gnu.org>
parents:
18350
diff
changeset
|
4 ;; Licensed to the Free Software Foundation. |
40250
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
5 ;; Copyright (C) 2001 Free Software Foundation, Inc. |
17052 | 6 |
89274 | 7 ;; Keywords: mule, i18n, fontset |
17052 | 8 |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
17071 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
17052 | 25 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36368
diff
changeset
|
26 ;;; Commentary: |
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36368
diff
changeset
|
27 |
17052 | 28 ;;; Code: |
29 | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
30 ;; Setup font-encoding-alist for all known encodings. |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
31 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
32 (setq font-encoding-alist |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
33 '(("iso8859-1$" . iso-8859-1) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
34 ("iso8859-2$" . iso-8859-2) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
35 ("iso8859-3$" . iso-8859-3) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
36 ("iso8859-4$" . iso-8859-4) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
37 ("iso8859-5$" . iso-8859-5) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
38 ("iso8859-6$" . iso-8859-6) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
39 ("iso8859-7$" . iso-8859-7) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
40 ("iso8859-8$" . iso-8859-8) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
41 ("iso8859-9$" . iso-8859-9) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
42 ("iso8859-10$" . iso-8859-10) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
43 ("iso8859-11$" . iso-8859-11) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
44 ("iso8859-13$" . iso-8859-13) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
45 ("iso8859-14$" . iso-8859-14) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
46 ("iso8859-15$" . iso-8859-15) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
47 ("gb2312.1980" . chinese-gb2312) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
48 ("jisx0208.1978" . japanese-jisx0208-1978) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
49 ("jisx0208" . japanese-jisx0208) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
50 ("jisx0201" . jisx0201) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
51 ("jisx0212" . japanese-jisx0212) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
52 ("ksc5601.1987" . korean-ksc5601) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
53 ("cns11643.1992.*1" . chinese-cns11643-1) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
54 ("cns11643.1992.*2" . chinese-cns11643-2) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
55 ("cns11643.1992.*3" . chinese-cns11643-3) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
56 ("cns11643.1992.*4" . chinese-cns11643-4) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
57 ("cns11643.1992.*5" . chinese-cns11643-5) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
58 ("cns11643.1992.*6" . chinese-cns11643-6) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
59 ("cns11643.1992.*7" . chinese-cns11643-7) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
60 ("big5" . big5) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
61 ("sisheng_cwnn" . chinese-sisheng) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
62 ("viscii" . viscii) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
63 ("tis620" . tis620-2533) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
64 ("mulearabic-0" . arabic-digit) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
65 ("mulearabic-1" . arabic-1-column) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
66 ("mulearabic-2" . arabic-2-column) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
67 ("muleipa" . ipa) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
68 ("ethiopic-unicode" . ethiopic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
69 ("is13194-devanagari" . indian-is13194) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
70 ("devanagari-cdac" . devanagari-glyph) |
89274 | 71 ;; These would be necessary for supporting the complete set of Indian |
72 ;; scripts. See also mule-conf.el. | |
73 ;; ("sanskrit-cdac" . sanskrit-glyph) | |
74 ;; ("bengali-cdac" . bengali-glyph) | |
75 ;; ("assamese-cdac" . assamese-glyph) | |
76 ;; ("punjabi-cdac" . punjabi-glyph) | |
77 ;; ("gujarati-cdac" . gujarati-glyph) | |
78 ;; ("oriya-cdac" . oriya-glyph) | |
79 ;; ("tamil-cdac" . tamil-glyph) | |
80 ;; ("telugu-cdac" . telugu-glyph) | |
81 ;; ("kannada-cdac" . kannada-glyph) | |
82 ;; ("malayalam-cdac" . malayalam-glyph) | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
83 ("muleindian-2" . indian-2-column) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
84 ("muleindian-1" . indian-1-column) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
85 ("mulelao-1" . mule-lao) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
86 ("muletibetan-2" . tibetan) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
87 ("muletibetan-1" . tibetan-1-column) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
88 ("jisx0213.2000-1" . japanese-jisx0213-1) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
89 ("jisx0213.2000-2" . japanese-jisx0213-2) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
90 ("abobe-symbol" . symbol) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
91 ("iso10646-1" . (unicode . nil)) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
92 ("iso10646.indian-1" . (unicode . nil)))) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
93 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
94 |
29234
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
95 ;; Set standard fontname specification of characters in the default |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
96 ;; fontset to find an appropriate font for each script/charset. The |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
97 ;; specification has the form ((SCRIPT FONT-SPEC ...) ...), where |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
98 ;; FONT-SPEC is: |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
99 ;; a vector [ FAMILY WEIGHT SLANT ADSTYLE REGISTRY ], |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
100 ;; or a cons (FAMILY . REGISTRY), |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
101 ;; or a string FONT-NAME. |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
102 ;; |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
103 ;; FAMILY, WEIGHT, SLANT, and ADSTYLE may be nil, in which case, the |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
104 ;; the corresponding name of default face is used. If REGISTRY |
29234
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
105 ;; contains a character `-', the string before that is embedded in |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
106 ;; `CHARSET_REGISTRY' field, and the string after that is embedded in |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
107 ;; `CHARSET_ENCODING' field. If it does not contain `-', the whole |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
108 ;; string is embedded in `CHARSET_REGISTRY' field, and a wild card |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
109 ;; character `*' is embedded in `CHARSET_ENCODING' field. |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
110 ;; |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
111 ;; SCRIPT is a symbol that appears as an element of the char table |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
112 ;; `char-script-table'. SCRIPT may be a charset specifying the range |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
113 ;; of characters. |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
114 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
115 (new-fontset |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
116 "fontset-default" |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
117 '( ;; for each script |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
118 (latin (nil . "ISO8859-1") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
119 (nil . "ISO8859-2") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
120 (nil . "ISO8859-3") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
121 (nil . "ISO8859-4") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
122 (nil . "ISO8859-9") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
123 (nil . "ISO8859-10") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
124 (nil . "ISO8859-13") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
125 (nil . "ISO8859-14") |
89274 | 126 (nil . "ISO8859-15") |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
127 (nil . "VISCII1.1-1")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
128 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
129 (thai (nil . "TIS620*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
130 (nil . "ISO8859-11")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
131 |
89258
b6c2beacc874
("fontset-default"): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
89143
diff
changeset
|
132 (devanagari (nil . "iso10646.indian-1")) |
b6c2beacc874
("fontset-default"): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
89143
diff
changeset
|
133 |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
134 (lao (nil . "MuleLao-1")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
135 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
136 ;; both for script and charset. |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
137 (tibetan (nil . "muletibetan-2")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
138 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
139 ;; both for script and charset. |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
140 (ethiopic (nil . "ethiopic-unicode")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
141 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
142 (greek (nil . "ISO8859-7")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
143 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
144 (cyrillic (nil . "ISO8859-5")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
145 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
146 (arabic (nil . "MuleArabic-0") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
147 (nil . "MuleArabic-1") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
148 (nil . "MuleArabic-2") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
149 (nil . "ISO8859-6")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
150 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
151 (hebrew (nil . "ISO8859-8")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
152 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
153 (kana (nil . "JISX0208*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
154 (nil . "GB2312.1980-0") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
155 (nil . "KSC5601.1987*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
156 (nil . "JISX0201*")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
157 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
158 (bopomofo (nil . "sisheng_cwnn-0")) |
17052 | 159 |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
160 (han (nil . "GB2312.1980-0") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
161 (nil . "JISX0208*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
162 (nil . "JISX0212*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
163 (nil . "big5*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
164 (nil . "KSC5601.1987*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
165 (nil . "CNS11643.1992-1") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
166 (nil . "CNS11643.1992-2") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
167 (nil . "CNS11643.1992-3") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
168 (nil . "CNS11643.1992-4") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
169 (nil . "CNS11643.1992-5") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
170 (nil . "CNS11643.1992-6") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
171 (nil . "CNS11643.1992-7") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
172 (nil . "gbk-0") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
173 (nil . "JISX0213.2000-1") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
174 (nil . "JISX0213.2000-2")) |
88405 | 175 |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
176 (cjk-misc (nil . "GB2312.1980-0") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
177 (nil . "JISX0208*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
178 (nil . "JISX0212*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
179 (nil . "big5*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
180 (nil . "KSC5601.1987*") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
181 (nil . "CNS11643.1992-1") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
182 (nil . "CNS11643.1992-2") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
183 (nil . "CNS11643.1992-3") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
184 (nil . "CNS11643.1992-4") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
185 (nil . "CNS11643.1992-5") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
186 (nil . "CNS11643.1992-6") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
187 (nil . "CNS11643.1992-7") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
188 (nil . "gbk-0") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
189 (nil . "JISX0213.2000-1") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
190 (nil . "JISX0213.2000-2")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
191 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
192 (hangul (nil . "KSC5601.1987-0")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
193 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
194 ;; for each charset |
89004
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
195 (ascii (nil . "ISO8859-1")) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
196 (arabic-digit ("*" . "MuleArabic-0")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
197 (arabic-1-column ("*" . "MuleArabic-1")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
198 (arabic-2-column ("*" . "MuleArabic-2")) |
89268
09a99ad41f97
("fontset-default"): Add an entry for `indian-is13194' charset.
Kenichi Handa <handa@m17n.org>
parents:
89258
diff
changeset
|
199 (indian-is13194 (nil . "is13194-devanagari")) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
200 (indian-1-column ("*" . "muleindian-2")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
201 (devanagari-glyph ("altsys-dv_ttsurekh" . "devanagari-cdac")) |
89274 | 202 ;; These would be necessary for supporting the complete set of Indian |
203 ;; scripts. | |
204 ;; fixme: family name | |
205 ;; (sanskrit-glyph ("*" . "sanskrit-cdac")) | |
206 ;; (bengali-glyph ("*" . "bengali-cdac")) | |
207 ;; (assamese-glyph ("*" . "assamese-cdac")) | |
208 ;; (punjabi-glyph ("*" . "punjabi-cdac")) | |
209 ;; (gujarati-glyph ("*" . "gujarati-cdac")) | |
210 ;; (oriya-glyph ("*" . "oriya-cdac")) | |
211 ;; (tamil-glyph ("*" . "tamil-cdac")) | |
212 ;; (telugu-glyph ("*" . "telugu-cdac")) | |
213 ;; (kannada-glyph ("*" . "kannada-cdac")) | |
89258
b6c2beacc874
("fontset-default"): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
89143
diff
changeset
|
214 (malayalam-glyph ("altsys-ml_ttkarthika" . "malayalam-cdac")) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
215 (ipa (nil . "MuleIPA-1")) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
216 )) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
217 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
218 ;; Append Unicode fonts. |
89274 | 219 ;; This may find fonts with more variants (bold, italic) but which don't cover |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
220 ;; many characters. |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
221 (set-fontset-font "fontset-default" '(#x00A0 . #xFFFF) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
222 '(nil . "iso10646-1") nil 'append) |
89274 | 223 ;; These may find fonts that cover many characters but with fewer variants. |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
224 (set-fontset-font "fontset-default" '(#x00A0 . #xFFFF) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
225 '("gnu-unifont" . "iso10646-1") nil 'append) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
226 (set-fontset-font "fontset-default" '(#x00A0 . #xFFFF) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
227 '("mutt-clearlyu" . "iso10646-1") nil 'append) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
228 |
89274 | 229 ;; These are the registered registries/encodings from |
230 ;; ftp://ftp.x.org/pub/DOCS/registry 2001/06/01 | |
17052 | 231 |
89274 | 232 ;; Name Reference |
233 ;; ---- --------- | |
234 ;; "DEC" [27] | |
235 ;; registry prefix | |
236 ;; "DEC.CNS11643.1986-2" [53] | |
237 ;; CNS11643 2-plane using the encoding | |
238 ;; suggested in that standard | |
239 ;; "DEC.DTSCS.1990-2" [54] | |
240 ;; DEC Taiwan Supplemental Character Set | |
241 ;; "fujitsu.u90x01.1991-0" [87] | |
242 ;; "fujitsu.u90x03.1991-0" [87] | |
243 ;; "GB2312.1980-0" [39],[12] | |
244 ;; China (PRC) Hanzi, GL encoding | |
245 ;; "GB2312.1980-1" [39] | |
246 ;; (deprecated) | |
247 ;; China (PRC) Hanzi, GR encoding | |
248 ;; "HP-Arabic8" [36] | |
249 ;; HPARABIC8 8-bit character set | |
250 ;; "HP-East8" [36] | |
251 ;; HPEAST8 8-bit character set | |
252 ;; "HP-Greek8" [36] | |
253 ;; HPGREEK8 8-bit character set | |
254 ;; "HP-Hebrew8" [36] | |
255 ;; HPHEBREW8 8-bit character set | |
256 ;; "HP-Japanese15" [36] | |
257 ;; HPJAPAN15 15-bit characer set, | |
258 ;; modified from industry defacto | |
259 ;; standard Shift-JIS | |
260 ;; "HP-Kana8" [36] | |
261 ;; HPKANA8 8-bit character set | |
262 ;; "HP-Korean15" [36] | |
263 ;; HPKOREAN15 15-bit character set | |
264 ;; "HP-Roman8" [36] | |
265 ;; HPROMAN8 8-bit character set | |
266 ;; "HP-SChinese15" [36] | |
267 ;; HPSCHINA15 15-bit character set for | |
268 ;; support of Simplified Chinese | |
269 ;; "HP-TChinese15" [36] | |
270 ;; HPTCHINA15 15-bit character set for | |
271 ;; support of Traditional Chinese | |
272 ;; "HP-Turkish8" [36] | |
273 ;; HPTURKISH8 8-bit character set | |
274 ;; "IPSYS" [59] | |
275 ;; registry prefix | |
276 ;; "IPSYS.IE-1" [59] | |
277 ;; "ISO2022"<REG>"-"<ENC> [44] | |
278 ;; "ISO646.1991-IRV" [107] | |
279 ;; ISO 646 International Reference Version | |
280 ;; "ISO8859-1" [15],[12] | |
281 ;; ISO Latin alphabet No. 1 | |
282 ;; "ISO8859-2" [15],[12] | |
283 ;; ISO Latin alphabet No. 2 | |
284 ;; "ISO8859-3" [15],[12] | |
285 ;; ISO Latin alphabet No. 3 | |
286 ;; "ISO8859-4" [15],[12] | |
287 ;; ISO Latin alphabet No. 4 | |
288 ;; "ISO8859-5" [15],[12] | |
289 ;; ISO Latin/Cyrillic alphabet | |
290 ;; "ISO8859-6" [15],[12] | |
291 ;; ISO Latin/Arabic alphabet | |
292 ;; "ISO8859-7" [15],[12] | |
293 ;; ISO Latin/Greek alphabet | |
294 ;; "ISO8859-8" [15],[12] | |
295 ;; ISO Latin/Hebrew alphabet | |
296 ;; "ISO8859-9" [15],[12] | |
297 ;; ISO Latin alphabet No. 5 | |
298 ;; "ISO8859-10" [15],[12] | |
299 ;; ISO Latin alphabet No. 6 | |
300 ;; "ISO8859-13" [15],[12] | |
301 ;; ISO Latin alphabet No. 7 | |
302 ;; "ISO8859-14" [15],[12] | |
303 ;; ISO Latin alphabet No. 8 | |
304 ;; "ISO8859-15" [15],[12] | |
305 ;; ISO Latin alphabet No. 9 | |
306 ;; "FCD8859-15" [7] | |
307 ;; (deprecated) | |
308 ;; ISO Latin alphabet No. 9, Final Committee Draft | |
309 ;; "ISO10646-1" [133] | |
310 ;; Unicode Universal Multiple-Octet Coded Character Set | |
311 ;; "ISO10646-MES" [133] | |
312 ;; (deprecated) | |
313 ;; Unicode Minimum European Subset | |
314 ;; "JISX0201.1976-0" [38],[12] | |
315 ;; 8-Bit Alphanumeric-Katakana Code | |
316 ;; "JISX0208.1983-0" [40],[12] | |
317 ;; Japanese Graphic Character Set, | |
318 ;; GL encoding | |
319 ;; "JISX0208.1990-0" [71] | |
320 ;; Japanese Graphic Character Set, | |
321 ;; GL encoding | |
322 ;; "JISX0208.1983-1" [40] | |
323 ;; (deprecated) | |
324 ;; Japanese Graphic Character Set, | |
325 ;; GR encoding | |
326 ;; "JISX0212.1990-0" [72] | |
327 ;; Supplementary Japanese Graphic Character Set, | |
328 ;; GL encoding | |
329 ;; "KOI8-R" [119] | |
330 ;; Cyrillic alphabet | |
331 ;; "KSC5601.1987-0" [41],[12] | |
332 ;; Korean Graphic Character Set, | |
333 ;; GL encoding | |
334 ;; "KSC5601.1987-1" [41] | |
335 ;; (deprecated) | |
336 ;; Korean Graphic Character Set, | |
337 ;; GR encoding | |
338 ;; "omron_CNS11643-0" [45] | |
339 ;; "omron_CNS11643-1" [45] | |
340 ;; "omron_BIG5-0" [45] | |
341 ;; "omron_BIG5-1" [45] | |
342 ;; "wn.tamil.1993" [103] | |
343 | |
88405 | 344 (defun set-font-encoding (pattern charset) |
89274 | 345 "Set arguments in `font-encoding-alist' (which see)." |
17052 | 346 (let ((slot (assoc pattern font-encoding-alist))) |
347 (if slot | |
88405 | 348 (setcdr slot charset) |
17052 | 349 (setq font-encoding-alist |
88405 | 350 (cons (cons pattern charset) font-encoding-alist))))) |
32646
43edadfecb51
Use registry "MuleTibetan-2" for Tibetan.
Kenichi Handa <handa@m17n.org>
parents:
29427
diff
changeset
|
351 |
17052 | 352 ;; Setting for suppressing XLoadQueryFont on big fonts. |
353 (setq x-pixel-size-width-font-regexp | |
354 "gb2312\\|jisx0208\\|ksc5601\\|cns11643\\|big5") | |
355 | |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
356 ;; These fonts require vertical centering. |
26886
8a6d8101919e
(vertical-centering-font-regexp): New
Kenichi Handa <handa@m17n.org>
parents:
26013
diff
changeset
|
357 (setq vertical-centering-font-regexp |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
358 "gb2312\\|jisx0208\\|jisx0212\\|ksc5601\\|cns11643\\|big5") |
26886
8a6d8101919e
(vertical-centering-font-regexp): New
Kenichi Handa <handa@m17n.org>
parents:
26013
diff
changeset
|
359 |
89258
b6c2beacc874
("fontset-default"): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
89143
diff
changeset
|
360 ;; We must adjust the size of these fonts. |
b6c2beacc874
("fontset-default"): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
89143
diff
changeset
|
361 (setq face-resizing-fonts '(("-cdac$" . 1.3))) |
b6c2beacc874
("fontset-default"): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
89143
diff
changeset
|
362 |
b6c2beacc874
("fontset-default"): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
89143
diff
changeset
|
363 |
88405 | 364 (defvar x-font-name-charset-alist nil |
365 "This variable has no meaning now. Just kept for backward compatibility.") | |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
366 |
17052 | 367 ;;; XLFD (X Logical Font Description) format handler. |
368 | |
369 ;; Define XLFD's field index numbers. ; field name | |
88405 | 370 (defconst xlfd-regexp-family-subnum 0) ; FOUNDRY and FAMILY |
371 (defconst xlfd-regexp-weight-subnum 1) ; WEIGHT_NAME | |
372 (defconst xlfd-regexp-slant-subnum 2) ; SLANT | |
373 (defconst xlfd-regexp-swidth-subnum 3) ; SETWIDTH_NAME | |
374 (defconst xlfd-regexp-adstyle-subnum 4) ; ADD_STYLE_NAME | |
375 (defconst xlfd-regexp-pixelsize-subnum 5) ; PIXEL_SIZE | |
376 (defconst xlfd-regexp-pointsize-subnum 6) ; POINT_SIZE | |
377 (defconst xlfd-regexp-resx-subnum 7) ; RESOLUTION_X | |
378 (defconst xlfd-regexp-resy-subnum 8) ; RESOLUTION_Y | |
379 (defconst xlfd-regexp-spacing-subnum 8) ; SPACING | |
380 (defconst xlfd-regexp-avgwidth-subnum 10) ; AVERAGE_WIDTH | |
381 (defconst xlfd-regexp-registry-subnum 11) ; REGISTRY and ENCODING | |
17052 | 382 |
383 ;; Regular expression matching against a fontname which conforms to | |
384 ;; XLFD (X Logical Font Description). All fields in XLFD should be | |
385 ;; not be omitted (but can be a wild card) to be matched. | |
386 (defconst xlfd-tight-regexp | |
387 "^\ | |
88405 | 388 -\\([^-]*-[^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)\ |
17052 | 389 -\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)\ |
88405 | 390 -\\([^-]*\\)-\\([^-]*\\)-\\([^-]*-[^-]*\\)$") |
391 | |
392 ;; Regular expression matching against a fontname which conforms to | |
393 ;; XLFD (X Logical Font Description). All fields in XLFD from FOUNDRY | |
89274 | 394 ;; to ADSTYLE, REGISTRY, and ENCODING should be not be omitted (but |
88405 | 395 ;; can be a wild card) to be matched. |
396 (defconst xlfd-style-regexp | |
397 "^\ | |
398 -\\([^-]*-[^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-.*\ | |
399 -\\([^-]*-[^-]*\\)$") | |
17052 | 400 |
401 ;; List of field numbers of XLFD whose values are numeric. | |
402 (defconst xlfd-regexp-numeric-subnums | |
88405 | 403 (list xlfd-regexp-pixelsize-subnum ;5 |
404 xlfd-regexp-pointsize-subnum ;6 | |
405 xlfd-regexp-resx-subnum ;7 | |
406 xlfd-regexp-resy-subnum ;8 | |
407 xlfd-regexp-avgwidth-subnum ;10 | |
17052 | 408 )) |
409 | |
410 (defun x-decompose-font-name (pattern) | |
89274 | 411 "Decompose PATTERN into XLFD fields and return vector of the fields. |
88405 | 412 The length of the vector is 12. |
17052 | 413 |
414 If PATTERN doesn't conform to XLFD, try to get a full XLFD name from | |
415 X server and use the information of the full name to decompose | |
416 PATTERN. If no full XLFD name is gotten, return nil." | |
417 (let (xlfd-fields fontname) | |
418 (if (string-match xlfd-tight-regexp pattern) | |
88405 | 419 (progn |
420 (setq xlfd-fields (make-vector 12 nil)) | |
421 (dotimes (i 12) | |
422 (aset xlfd-fields i (match-string (1+ i) pattern))) | |
423 (dotimes (i 12) | |
424 (if (string-match "^[*-]+$" (aref xlfd-fields i)) | |
425 (aset xlfd-fields i nil))) | |
17052 | 426 xlfd-fields) |
427 (setq fontname (condition-case nil | |
428 (x-resolve-font-name pattern) | |
429 (error))) | |
430 (if (and fontname | |
431 (string-match xlfd-tight-regexp fontname)) | |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
432 ;; We get a full XLFD name. |
17052 | 433 (let ((len (length pattern)) |
434 (i 0) | |
435 l) | |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
436 ;; Setup xlfd-fields by the full XLFD name. Each element |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
437 ;; should be a cons of matched index and matched string. |
88405 | 438 (setq xlfd-fields (make-vector 12 nil)) |
439 (dotimes (i 12) | |
17052 | 440 (aset xlfd-fields i |
441 (cons (match-beginning (1+ i)) | |
88405 | 442 (match-string (1+ i) fontname)))) |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
443 |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
444 ;; Replace wild cards in PATTERN by regexp codes. |
17052 | 445 (setq i 0) |
446 (while (< i len) | |
447 (let ((ch (aref pattern i))) | |
448 (if (= ch ??) | |
449 (setq pattern (concat (substring pattern 0 i) | |
450 "\\(.\\)" | |
451 (substring pattern (1+ i))) | |
452 len (+ len 4) | |
453 i (+ i 4)) | |
454 (if (= ch ?*) | |
455 (setq pattern (concat (substring pattern 0 i) | |
456 "\\(.*\\)" | |
457 (substring pattern (1+ i))) | |
458 len (+ len 5) | |
459 i (+ i 5)) | |
460 (setq i (1+ i)))))) | |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
461 |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
462 ;; Set each element of xlfd-fields to proper strings. |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
463 (if (string-match pattern fontname) |
89274 | 464 ;; The regular expression PATTERN matches the full XLFD |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
465 ;; name. Set elements that correspond to a wild card |
88405 | 466 ;; in PATTERN to nil, set the other elements to the |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
467 ;; exact strings in PATTERN. |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
468 (let ((l (cdr (cdr (match-data))))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
469 (setq i 0) |
88405 | 470 (while (< i 12) |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
471 (if (or (null l) (< (car (aref xlfd-fields i)) (car l))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
472 (progn |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
473 (aset xlfd-fields i (cdr (aref xlfd-fields i))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
474 (setq i (1+ i))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
475 (if (< (car (aref xlfd-fields i)) (car (cdr l))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
476 (progn |
88405 | 477 (aset xlfd-fields i nil) |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
478 (setq i (1+ i))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
479 (setq l (cdr (cdr l))))))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
480 ;; Set each element of xlfd-fields to the exact string |
89274 | 481 ;; in the corresponding fields in full XLFD name. |
88405 | 482 (dotimes (i 12) |
483 (aset xlfd-fields i (cdr (aref xlfd-fields i))))) | |
17052 | 484 xlfd-fields))))) |
485 | |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
486 (defun x-compose-font-name (fields &optional reduce) |
89274 | 487 "Compose X fontname from FIELDS. |
88405 | 488 FIELDS is a vector of XLFD fields, the length 12. |
17177
9e550b522bc0
(x-charset-registries): Change entry for Ethiopic.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
489 If a field is nil, wild-card letter `*' is embedded. |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
490 Optional argument REDUCE is always ignored. It exists just for |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
491 backward compatibility." |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
492 (concat "-" (mapconcat (lambda (x) (or x "*")) fields "-"))) |
23205
22df54cdb841
(resolved-ascii-font): New variable.
Kenichi Handa <handa@m17n.org>
parents:
23196
diff
changeset
|
493 |
40250
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
494 (defun x-must-resolve-font-name (xlfd-fields) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
495 "Like `x-resolve-font-name', but always return a font name. |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
496 XLFD-FIELDS is a vector of XLFD (X Logical Font Description) fields. |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
497 If no font matching XLFD-FIELDS is available, successively replace |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
498 parts of the font name pattern with \"*\" until some font is found. |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
499 Value is name of that font." |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
500 (let ((ascii-font nil) (index 0)) |
88405 | 501 (while (and (null ascii-font) (<= index xlfd-regexp-registry-subnum)) |
40250
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
502 (let ((pattern (x-compose-font-name xlfd-fields))) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
503 (condition-case nil |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
504 (setq ascii-font (x-resolve-font-name pattern)) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
505 (error |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
506 (message "Warning: no fonts matching `%s' available" pattern) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
507 (aset xlfd-fields index "*") |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
508 (setq index (1+ index)))))) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
509 (unless ascii-font |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
510 (error "No fonts founds")) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
511 ascii-font)) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
512 |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
513 |
17052 | 514 (defun x-complement-fontset-spec (xlfd-fields fontlist) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
515 "Complement FONTLIST for charsets based on XLFD-FIELDS and return it. |
17052 | 516 XLFD-FIELDS is a vector of XLFD (X Logical Font Description) fields. |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
517 FONTLIST is an alist of charsets vs the corresponding font names. |
17052 | 518 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
519 The fonts are complemented as below. |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
520 |
88405 | 521 At first, if FONTLIST doesn't specify a font for ASCII charset, |
522 generate a font name for the charset from XLFD-FIELDS, and add that | |
523 information to FONTLIST. | |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
524 |
88405 | 525 Then, replace font names with the corresponding XLFD field vectors |
526 while substituting default field names for wild cards if they match | |
527 `xlfd-style-regexp'. The default field names are decided by | |
528 XLFD-FIELDS." | |
529 (let* ((default-spec (vector (aref xlfd-fields xlfd-regexp-family-subnum) | |
530 (aref xlfd-fields xlfd-regexp-weight-subnum) | |
531 (aref xlfd-fields xlfd-regexp-slant-subnum) | |
532 (aref xlfd-fields xlfd-regexp-swidth-subnum) | |
533 (aref xlfd-fields xlfd-regexp-adstyle-subnum) | |
534 (aref xlfd-fields xlfd-regexp-registry-subnum))) | |
535 (slot (assq 'ascii fontlist)) | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
536 (ascii-font (cadr slot)) |
88405 | 537 xlfd-ascii) |
34917
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
538 (if ascii-font |
88405 | 539 (progn |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
540 (setq ascii-font (x-resolve-font-name ascii-font)) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
541 (setcar (cdr slot) ascii-font) |
88405 | 542 (setq xlfd-ascii (x-decompose-font-name ascii-font)) |
543 (dotimes (i 11) | |
544 (or (aref xlfd-fields i) | |
545 (aset xlfd-fields i (aref xlfd-ascii i))))) | |
34917
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
546 ;; If font for ASCII is not specified, add it. |
88405 | 547 (setq xlfd-ascii (copy-sequence xlfd-fields)) |
548 (aset xlfd-ascii xlfd-regexp-registry-subnum "iso8859-1") | |
549 (setq ascii-font (x-must-resolve-font-name xlfd-ascii)) | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
550 (setq fontlist (cons (list 'ascii ascii-font) fontlist))) |
18350
3f4364889538
(x-charset-registries): Name changed for consistency:
Kenichi Handa <handa@m17n.org>
parents:
17989
diff
changeset
|
551 |
88405 | 552 (dolist (elt fontlist) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
553 (let ((name (cadr elt)) |
88405 | 554 font-spec) |
89325
58d5f88f985b
(x-complement-fontset-spec): If a fontname doesn't conform to XLFD
Kenichi Handa <handa@m17n.org>
parents:
89274
diff
changeset
|
555 (when (or (string-match xlfd-style-regexp name) |
58d5f88f985b
(x-complement-fontset-spec): If a fontname doesn't conform to XLFD
Kenichi Handa <handa@m17n.org>
parents:
89274
diff
changeset
|
556 (and (setq name (car (x-list-fonts name nil nil 1))) |
58d5f88f985b
(x-complement-fontset-spec): If a fontname doesn't conform to XLFD
Kenichi Handa <handa@m17n.org>
parents:
89274
diff
changeset
|
557 (string-match xlfd-style-regexp name))) |
88405 | 558 (setq font-spec (make-vector 6 nil)) |
559 (dotimes (i 6) | |
560 (aset font-spec i (match-string (1+ i) name))) | |
561 (dotimes (i 6) | |
562 (if (string-match "^[*-]+$" (aref font-spec i)) | |
563 (aset font-spec i (aref default-spec i)))) | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
564 (setcar (cdr elt) font-spec)))) |
88405 | 565 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
566 fontlist)) |
17052 | 567 |
19049
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
568 (defun fontset-name-p (fontset) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
569 "Return non-nil if FONTSET is valid as fontset name. |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
570 A valid fontset name should conform to XLFD (X Logical Font Description) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
571 with \"fontset\" in `<CHARSET_REGISTRY> field." |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
572 (and (string-match xlfd-tight-regexp fontset) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
573 (string= (match-string (1+ xlfd-regexp-registry-subnum) fontset) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
574 "fontset"))) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
575 |
17052 | 576 (defun generate-fontset-menu () |
89274 | 577 "Return list to be appended to `x-fixed-font-alist'. |
578 Done when `mouse-set-font' is called." | |
89127
3e0204a3fcb8
(generate-fontset-menu): Exclude the defualt fontset.
Kenichi Handa <handa@m17n.org>
parents:
89004
diff
changeset
|
579 (let (l) |
3e0204a3fcb8
(generate-fontset-menu): Exclude the defualt fontset.
Kenichi Handa <handa@m17n.org>
parents:
89004
diff
changeset
|
580 (dolist (fontset (fontset-list)) |
3e0204a3fcb8
(generate-fontset-menu): Exclude the defualt fontset.
Kenichi Handa <handa@m17n.org>
parents:
89004
diff
changeset
|
581 (or (string-match "fontset-default$" fontset) |
3e0204a3fcb8
(generate-fontset-menu): Exclude the defualt fontset.
Kenichi Handa <handa@m17n.org>
parents:
89004
diff
changeset
|
582 (push (list (fontset-plain-name fontset) fontset) l))) |
24160
ab814ec4995e
(generate-fontset-menu): Return a
Kenichi Handa <handa@m17n.org>
parents:
24153
diff
changeset
|
583 (cons "Fontset" |
89127
3e0204a3fcb8
(generate-fontset-menu): Exclude the defualt fontset.
Kenichi Handa <handa@m17n.org>
parents:
89004
diff
changeset
|
584 (sort l #'(lambda (x y) (string< (car x) (car y))))))) |
17052 | 585 |
586 (defun fontset-plain-name (fontset) | |
587 "Return a plain and descriptive name of FONTSET." | |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
588 (if (not (setq fontset (query-fontset fontset))) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
589 (error "Invalid fontset: %s" fontset)) |
17052 | 590 (let ((xlfd-fields (x-decompose-font-name fontset))) |
591 (if xlfd-fields | |
89004
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
592 (let ((family (aref xlfd-fields xlfd-regexp-family-subnum)) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
593 (weight (aref xlfd-fields xlfd-regexp-weight-subnum)) |
17052 | 594 (slant (aref xlfd-fields xlfd-regexp-slant-subnum)) |
595 (swidth (aref xlfd-fields xlfd-regexp-swidth-subnum)) | |
596 (size (aref xlfd-fields xlfd-regexp-pixelsize-subnum)) | |
88405 | 597 (nickname (aref xlfd-fields xlfd-regexp-registry-subnum)) |
17052 | 598 name) |
88405 | 599 (if (not (string-match "^fontset-\\(.*\\)$" nickname)) |
89004
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
600 (setq nickname family) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
601 (setq nickname (match-string 1 nickname))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
602 (if (and size (> (string-to-int size) 0)) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
603 (setq name (format "%s: %s-dot" nickname size)) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
604 (setq name nickname)) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
605 (and weight |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
606 (cond ((string-match "^medium$" weight) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
607 (setq name (concat name " " "medium"))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
608 ((string-match "^bold$\\|^demibold$" weight) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
609 (setq name (concat name " " weight))))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
610 (and slant |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
611 (cond ((string-match "^i$" slant) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
612 (setq name (concat name " " "italic"))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
613 ((string-match "^o$" slant) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
614 (setq name (concat name " " "slant"))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
615 ((string-match "^ri$" slant) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
616 (setq name (concat name " " "reverse italic"))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
617 ((string-match "^ro$" slant) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
618 (setq name (concat name " " "reverse slant"))))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
619 name) |
17052 | 620 fontset))) |
621 | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
622 (defvar charset-script-alist |
89143
7b8bd597892a
(charset-script-alist): Fix script names.
Kenichi Handa <handa@m17n.org>
parents:
89127
diff
changeset
|
623 '((ascii . latin) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
624 (latin-iso8859-1 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
625 (latin-iso8859-2 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
626 (latin-iso8859-3 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
627 (latin-iso8859-4 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
628 (latin-iso8859-9 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
629 (latin-iso8859-10 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
630 (latin-iso8859-13 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
631 (latin-iso8859-14 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
632 (latin-iso8859-15 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
633 (latin-iso8859-16 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
634 (latin-jisx0201 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
635 (thai-tis620 . thai) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
636 (cyrillic-iso8859-5 . cyrillic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
637 (arabic-iso8859-6 . arabic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
638 (greek-iso8859-7 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
639 (hebrew-iso8859-8 . latin) |
89143
7b8bd597892a
(charset-script-alist): Fix script names.
Kenichi Handa <handa@m17n.org>
parents:
89127
diff
changeset
|
640 (katakana-jisx0201 . kana) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
641 (chinese-gb2312 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
642 (chinese-big5-1 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
643 (chinese-big5-2 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
644 (chinese-cns11643-1 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
645 (chinese-cns11643-2 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
646 (chinese-cns11643-3 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
647 (chinese-cns11643-4 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
648 (chinese-cns11643-5 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
649 (chinese-cns11643-6 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
650 (chinese-cns11643-7 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
651 (japanese-jisx0208 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
652 (japanese-jisx0208-1978 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
653 (japanese-jisx0212 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
654 (japanese-jisx0213-1 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
655 (japanese-jisx0213-2 . han) |
89143
7b8bd597892a
(charset-script-alist): Fix script names.
Kenichi Handa <handa@m17n.org>
parents:
89127
diff
changeset
|
656 (korean-ksc5601 . hangul) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
657 (chinese-sisheng . bopomofo) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
658 (vietnamese-viscii-lower . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
659 (vietnamese-viscii-upper . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
660 (arabic-digit . arabic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
661 (arabic-1-column . arabic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
662 (arabic-2-column . arabic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
663 (indian-is13194 . devanagari) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
664 (indian-glyph . devanagari) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
665 (indian-1-column . devanagari) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
666 (indian-2-column . devanagari) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
667 (tibetan-1-column . tibetan)) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
668 "Alist of charsets vs the corresponding most appropriate scripts. |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
669 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
670 This alist is used by the function `create-fontset-from-fontset-spec' |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
671 to map charsets to scripts.") |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
672 |
22128
8f7a59fc78db
(create-fontset-from-fontset-spec): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents:
19771
diff
changeset
|
673 ;;;###autoload |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
674 (defun create-fontset-from-fontset-spec (fontset-spec |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
675 &optional style-variant noerror) |
17052 | 676 "Create a fontset from fontset specification string FONTSET-SPEC. |
677 FONTSET-SPEC is a string of the format: | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
678 FONTSET-NAME,SCRIPT-NAME0:FONT-NAME0,SCRIPT-NAME1:FONT-NAME1, ... |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
679 Any number of SPACE, TAB, and NEWLINE can be put before and after commas. |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
680 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
681 Optional 2nd argument is ignored. It exists just for backward |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
682 compatibility. |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
683 |
18719
de8249499f33
(create-fontset-from-fontset-spec): Typo in doc-string fixed.
Kenichi Handa <handa@m17n.org>
parents:
18714
diff
changeset
|
684 If this function attempts to create already existing fontset, error is |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
685 signaled unless the optional 3rd argument NOERROR is non-nil. |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
686 |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
687 It returns a name of the created fontset. |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
688 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
689 For backward compatibility, SCRIPT-NAME may be a charset name, in |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
690 which case, the corresponding script is decided by the variable |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
691 `charset-script-alist' (which see)." |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
692 (if (not (string-match "^[^,]+" fontset-spec)) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
693 (error "Invalid fontset spec: %s" fontset-spec)) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
694 (let ((idx (match-end 0)) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
695 (name (match-string 0 fontset-spec)) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
696 xlfd-fields script fontlist ascii-font) |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
697 (if (query-fontset name) |
89274 | 698 (or noerror |
23655
8aa7d51024b2
(create-fontset-from-fontset-spec): Give correct arg to `error'.
Kenichi Handa <handa@m17n.org>
parents:
23205
diff
changeset
|
699 (error "Fontset \"%s\" already exists" name)) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
700 (setq xlfd-fields (x-decompose-font-name name)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
701 (or xlfd-fields |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
702 (error "Fontset \"%s\" not conforming to XLFD" name)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
703 |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
704 ;; At first, extract pairs of charset and fontname from FONTSET-SPEC. |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
705 (while (string-match "[, \t\n]*\\([^:]+\\):\\([^,]+\\)" fontset-spec idx) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
706 (setq idx (match-end 0)) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
707 (setq script (intern (match-string 1 fontset-spec))) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
708 (if (or (memq script (char-table-extra-slot char-script-table 0)) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
709 (setq script (cdr (assq script charset-script-alist)))) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
710 (setq fontlist (cons (list script (match-string 2 fontset-spec)) |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
711 fontlist)))) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
712 (setq ascii-font (cadr (assq 'ascii fontlist))) |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
713 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
714 ;; Complement FONTLIST. |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
715 (setq fontlist (x-complement-fontset-spec xlfd-fields fontlist)) |
88405 | 716 (setq name (x-compose-font-name xlfd-fields)) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
717 (new-fontset name fontlist) |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
718 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
719 ;; Define the short name alias. |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
720 (if (and (string-match "fontset-.*$" name) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
721 (not (assoc name fontset-alias-alist))) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
722 (let ((alias (match-string 0 name))) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
723 (or (rassoc alias fontset-alias-alist) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
724 (setq fontset-alias-alist |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
725 (cons (cons name alias) fontset-alias-alist))))) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
726 |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
727 ;; Define the ASCII font name alias. |
34917
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
728 (or ascii-font |
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
729 (setq ascii-font (cdr (assq 'ascii fontlist)))) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
730 (or (rassoc ascii-font fontset-alias-alist) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
731 (setq fontset-alias-alist |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
732 (cons (cons name ascii-font) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
733 fontset-alias-alist)))) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
734 |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
735 name)) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
736 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
737 (defun create-fontset-from-ascii-font (font &optional resolved-font |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
738 fontset-name) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
739 "Create a fontset from an ASCII font FONT. |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
740 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
741 Optional 1st arg RESOLVED-FONT is a resolved name of FONT. If |
89274 | 742 omitted, `x-resolve-font-name' is called to get the resolved name. At |
743 this time, if FONT is not available, an error is signaled. | |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
744 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
745 Optional 2nd arg FONTSET-NAME is a string to be used in |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
746 `<CHARSET_ENCODING>' fields of a new fontset name. If it is omitted, |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
747 an appropriate name is generated automatically. |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
748 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
749 It returns a name of the created fontset." |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
750 (setq font (downcase font)) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
751 (setq resolved-font |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
752 (downcase (or resolved-font (x-resolve-font-name font)))) |
88405 | 753 (let ((xlfd (x-decompose-font-name resolved-font)) |
754 fontset) | |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
755 (if fontset-name |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
756 (setq fontset-name (downcase fontset-name)) |
89004
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
757 (if (query-fontset "fontset-startup") |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
758 (setq fontset-name |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
759 (subst-char-in-string |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
760 ?- ?_ (aref xlfd xlfd-regexp-registry-subnum) t)) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
761 (setq fontset-name "startup"))) |
88405 | 762 (aset xlfd xlfd-regexp-registry-subnum |
763 (format "fontset-%s" fontset-name)) | |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
764 (setq fontset (x-compose-font-name xlfd)) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
765 (or (query-fontset fontset) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
766 (create-fontset-from-fontset-spec (concat fontset ", ascii:" font))))) |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
767 |
17052 | 768 |
17842
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
769 ;; Create standard fontset from 16 dots fonts which are the most widely |
17989
8a264cfe3768
(x-complement-fontset-spec): Add font names which are
Kenichi Handa <handa@m17n.org>
parents:
17842
diff
changeset
|
770 ;; installed fonts. Fonts for Chinese-GB, Korean, and Chinese-CNS are |
8a264cfe3768
(x-complement-fontset-spec): Add font names which are
Kenichi Handa <handa@m17n.org>
parents:
17842
diff
changeset
|
771 ;; specified here because FAMILY of those fonts are not "fixed" in |
8a264cfe3768
(x-complement-fontset-spec): Add font names which are
Kenichi Handa <handa@m17n.org>
parents:
17842
diff
changeset
|
772 ;; many cases. |
17842
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
773 (defvar standard-fontset-spec |
88405 | 774 (purecopy "-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard") |
17842
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
775 "String of fontset spec of the standard fontset. |
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
776 You have the biggest chance to display international characters |
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
777 with correct glyphs by using the standard fontset. |
17052 | 778 See the documentation of `create-fontset-from-fontset-spec' for the format.") |
779 | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
780 |
17052 | 781 ;; Create fontsets from X resources of the name `fontset-N (class |
782 ;; Fontset-N)' where N is integer 0, 1, ... | |
783 ;; The values of the resources the string of the same format as | |
17842
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
784 ;; `standard-fontset-spec'. |
17052 | 785 |
786 (defun create-fontset-from-x-resource () | |
787 (let ((idx 0) | |
788 fontset-spec) | |
27534
eeb998860456
(standard-fontset-spec): Purecopy it.
Dave Love <fx@gnu.org>
parents:
26886
diff
changeset
|
789 (while (setq fontset-spec (x-get-resource (format "fontset-%d" idx) |
eeb998860456
(standard-fontset-spec): Purecopy it.
Dave Love <fx@gnu.org>
parents:
26886
diff
changeset
|
790 (format "Fontset-%d" idx))) |
24153
729affdf2ca1
(create-fontset-from-x-resource): Make style variants.
Kenichi Handa <handa@m17n.org>
parents:
23890
diff
changeset
|
791 (create-fontset-from-fontset-spec fontset-spec t 'noerror) |
17052 | 792 (setq idx (1+ idx))))) |
793 | |
794 ;; | |
795 (provide 'fontset) | |
796 | |
797 ;;; fontset.el ends here |