Mercurial > emacs
annotate lisp/international/fontset.el @ 90533:8a8e69664178
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 343-356)
- Update from CVS
- Update for ERC 5.1.3.
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 113-115)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-90
author | Miles Bader <miles@gnu.org> |
---|---|
date | Wed, 19 Jul 2006 00:42:56 +0000 |
parents | fb8ab271951f |
children | d9cb37754a26 |
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 |
62274 | 3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. |
4 ;; Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003 | |
5 ;; National Institute of Advanced Industrial Science and Technology (AIST) | |
6 ;; Registration Number H14PRO021 | |
90420
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
7 ;; Copyright (C) 2003, 2006 |
89483 | 8 ;; National Institute of Advanced Industrial Science and Technology (AIST) |
9 ;; Registration Number H13PRO009 | |
17052 | 10 |
89274 | 11 ;; Keywords: mule, i18n, fontset |
17052 | 12 |
13 ;; This file is part of GNU Emacs. | |
14 | |
15 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
16 ;; it under the terms of the GNU General Public License as published by | |
17 ;; the Free Software Foundation; either version 2, or (at your option) | |
18 ;; any later version. | |
19 | |
20 ;; GNU Emacs is distributed in the hope that it will be useful, | |
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 ;; GNU General Public License for more details. | |
24 | |
25 ;; You should have received a copy of the GNU General Public License | |
17071 | 26 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64085 | 27 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
28 ;; Boston, MA 02110-1301, USA. | |
17052 | 29 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36368
diff
changeset
|
30 ;;; Commentary: |
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36368
diff
changeset
|
31 |
17052 | 32 ;;; Code: |
33 | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
34 ;; 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
|
35 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
36 (setq font-encoding-alist |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
37 '(("iso8859-1$" . iso-8859-1) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
38 ("iso8859-2$" . iso-8859-2) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
39 ("iso8859-3$" . iso-8859-3) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
40 ("iso8859-4$" . iso-8859-4) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
41 ("iso8859-5$" . iso-8859-5) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
42 ("iso8859-6$" . iso-8859-6) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
43 ("iso8859-7$" . iso-8859-7) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
44 ("iso8859-8$" . iso-8859-8) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
45 ("iso8859-9$" . iso-8859-9) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
46 ("iso8859-10$" . iso-8859-10) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
47 ("iso8859-11$" . iso-8859-11) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
48 ("iso8859-13$" . iso-8859-13) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
49 ("iso8859-14$" . iso-8859-14) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
50 ("iso8859-15$" . iso-8859-15) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
51 ("gb2312.1980" . chinese-gb2312) |
90005
0c0b009323eb
(font-encoding-alist): Add gbk.
Kenichi Handa <handa@m17n.org>
parents:
89909
diff
changeset
|
52 ("gbk" . chinese-gbk) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
53 ("jisx0208.1978" . japanese-jisx0208-1978) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
54 ("jisx0208" . japanese-jisx0208) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
55 ("jisx0201" . jisx0201) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
56 ("jisx0212" . japanese-jisx0212) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
57 ("ksc5601.1987" . korean-ksc5601) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
58 ("cns11643.1992.*1" . chinese-cns11643-1) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
59 ("cns11643.1992.*2" . chinese-cns11643-2) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
60 ("cns11643.1992.*3" . chinese-cns11643-3) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
61 ("cns11643.1992.*4" . chinese-cns11643-4) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
62 ("cns11643.1992.*5" . chinese-cns11643-5) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
63 ("cns11643.1992.*6" . chinese-cns11643-6) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
64 ("cns11643.1992.*7" . chinese-cns11643-7) |
89809
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
65 ("cns11643.92p1-0" . chinese-cns11643-1) |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
66 ("cns11643.92p2-0" . chinese-cns11643-2) |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
67 ("cns11643.92p3-0" . chinese-cns11643-3) |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
68 ("cns11643.92p4-0" . chinese-cns11643-4) |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
69 ("cns11643.92p5-0" . chinese-cns11643-5) |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
70 ("cns11643.92p6-0" . chinese-cns11643-6) |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
71 ("cns11643.92p7-0" . chinese-cns11643-7) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
72 ("big5" . big5) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
73 ("sisheng_cwnn" . chinese-sisheng) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
74 ("viscii" . viscii) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
75 ("tis620" . tis620-2533) |
90091
4a0f91659a65
(font-encoding-alist): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
90005
diff
changeset
|
76 ("microsoft-cp1251" . windows-1251) |
90420
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
77 ("koi8-r" . koi8-r) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
78 ("mulearabic-0" . arabic-digit) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
79 ("mulearabic-1" . arabic-1-column) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
80 ("mulearabic-2" . arabic-2-column) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
81 ("muleipa" . ipa) |
90504
8de7c6bf6944
(font-encoding-alist): Fix for
Kenichi Handa <handa@m17n.org>
parents:
90493
diff
changeset
|
82 ("ethiopic-unicode" . (unicode-bmp . ethiopic)) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
83 ("is13194-devanagari" . indian-is13194) |
89483 | 84 ("Devanagari-CDAC" . devanagari-cdac) |
85 ("Sanskrit-CDAC" . sanskrit-cdac) | |
86 ("Bengali-CDAC" . bengali-cdac) | |
87 ("Assamese-CDAC" . assamese-cdac) | |
88 ("Punjabi-CDAC" . punjabi-cdac) | |
89 ("Gujarati-CDAC" . gujarati-cdac) | |
90 ("Oriya-CDAC" . oriya-cdac) | |
91 ("Tamil-CDAC" . tamil-cdac) | |
92 ("Telugu-CDAC" . telugu-cdac) | |
93 ("Kannada-CDAC" . kannada-cdac) | |
94 ("Malayalam-CDAC" . malayalam-cdac) | |
95 ("Devanagari-Akruti" . devanagari-akruti) | |
96 ("Bengali-Akruti" . bengali-akruti) | |
97 ("Punjabi-Akruti" . punjabi-akruti) | |
98 ("Gujarati-Akruti" . gujarati-akruti) | |
99 ("Oriya-Akruti" . oriya-akruti) | |
100 ("Tamil-Akruti" . tamil-akruti) | |
101 ("Telugu-Akruti" . telugu-akruti) | |
102 ("Kannada-Akruti" . kannada-akruti) | |
103 ("Malayalam-Akruti" . malayalam-akruti) | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
104 ("muleindian-2" . indian-2-column) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
105 ("muleindian-1" . indian-1-column) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
106 ("mulelao-1" . mule-lao) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
107 ("muletibetan-2" . tibetan) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
108 ("muletibetan-1" . tibetan-1-column) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
109 ("jisx0213.2000-1" . japanese-jisx0213-1) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
110 ("jisx0213.2000-2" . japanese-jisx0213-2) |
89802
16421a824d49
(font-encoding-alist): Register "JISX0213.2004-1".
Kenichi Handa <handa@m17n.org>
parents:
89800
diff
changeset
|
111 ("jisx0213.2004-1" . japanese-jisx0213.2004-1) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
112 ("abobe-symbol" . symbol) |
89825
513b9f207900
(font-encoding-alist): Register "iso10646-2" for unicode-sip.
Kenichi Handa <handa@m17n.org>
parents:
89809
diff
changeset
|
113 ("iso10646-1$" . (unicode-bmp . nil)) |
513b9f207900
(font-encoding-alist): Register "iso10646-2" for unicode-sip.
Kenichi Handa <handa@m17n.org>
parents:
89809
diff
changeset
|
114 ("iso10646.indian-1" . (unicode-bmp . nil)))) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
115 |
90420
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
116 (setq script-representative-chars |
90493
c5c4ee67b82e
(script-representative-chars): Add an
Kenichi Handa <handa@m17n.org>
parents:
90420
diff
changeset
|
117 '((latin ?A ?Z ?a ?z) |
c5c4ee67b82e
(script-representative-chars): Add an
Kenichi Handa <handa@m17n.org>
parents:
90420
diff
changeset
|
118 (greek #x3A9) |
90420
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
119 (coptic #x3E2) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
120 (cyrillic #x42F) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
121 (armenian #x531) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
122 (hebrew #x5D0) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
123 (arabic #x628) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
124 (syriac #x710) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
125 (thaana #x78C) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
126 (devanagari #x915) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
127 (bengali #x995) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
128 (gurmukhi #xA15) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
129 (gujarati #xA95) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
130 (oriya #xB15) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
131 (tamil #xB95) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
132 (telugu #xC15) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
133 (kannada #xC95) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
134 (malayalam #xD15) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
135 (sinhala #xD95) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
136 (thai #xE17) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
137 (lao #xEA5) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
138 (tibetan #xF40) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
139 (myanmar #x1000) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
140 (georgian #x10D3) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
141 (ethiopic #x1208) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
142 (cherokee #x13B6) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
143 (canadian-aboriginal #x14C0) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
144 (ogham #x168F) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
145 (runic #x16A0) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
146 (khmer #x1780) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
147 (mongolian #x1826) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
148 (braille #x2800) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
149 (ideographic-description #x2FF0) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
150 (cjk-misc #x300E) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
151 (kana #x304B) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
152 (bopomofo #x3105) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
153 (kanbun #x319D) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
154 (han #x5B57) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
155 (yi #xA288) |
8a1866284f74
(font-encoding-alist): Add koi8-4.
Kenichi Handa <handa@m17n.org>
parents:
90348
diff
changeset
|
156 (hangul #xAC00))) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
157 |
90512
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
158 (setq otf-script-alist |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
159 '((arab . arabic) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
160 (armn . armenian) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
161 (bali . balinese) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
162 (beng . bengali) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
163 (bopo . bopomofo) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
164 (brai . braille) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
165 (bugi . buginese) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
166 (buhd . buhid) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
167 (cans . canadian_aboliginal) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
168 (cher . cherokee) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
169 (copt . coptic) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
170 (xsux . cuneiform) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
171 (cyrl . cyrillic) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
172 (cprt . cypriot) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
173 (dsrt . deseret) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
174 (deva . devanagari) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
175 (ethi . ethiopic) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
176 (geor . georgian) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
177 (glag . glagolitic) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
178 (goth . gothic) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
179 (grek . greek) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
180 (gujr . gujarati) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
181 (guru . gurmukhi) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
182 (hani . han) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
183 (hang . hangul) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
184 (hano . hanunoo) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
185 (hebr . hebrew) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
186 (kana . kana) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
187 (knda . kannada) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
188 (khar . kharoshthi) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
189 (khmr . khmer) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
190 (lao . lao) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
191 (latn . latin) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
192 (limb . limbu) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
193 (linb . linear_b) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
194 (mlym . malayalam) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
195 (mong . mongolian) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
196 (mymr . myanmar) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
197 (ogam . ogham) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
198 (ital . old_italic) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
199 (xpeo . old_persian) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
200 (orya . oriya) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
201 (osma . osmanya) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
202 (phag . phags-pa) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
203 (phnx . phoenician) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
204 (runr . runic) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
205 (shaw . shavian) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
206 (sinh . sinhala) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
207 (sylo . syloti_nagri) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
208 (syrc . syriac) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
209 (tglg . tagalog) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
210 (tagb . tagbanwa) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
211 (taml . tamil) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
212 (tale . tai_le) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
213 (telu . telugu) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
214 (thaa . thaana) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
215 (thai . thai) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
216 (tibt . tibetan) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
217 (tfng . tifinagh) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
218 (ugar . ugaritic) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
219 (yi . yi))) |
fb8ab271951f
(otf-script-alist): Set it.
Kenichi Handa <handa@m17n.org>
parents:
90504
diff
changeset
|
220 |
29234
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
221 ;; 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
|
222 ;; 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
|
223 ;; 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
|
224 ;; FONT-SPEC is: |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
225 ;; a vector [ FAMILY WEIGHT SLANT ADSTYLE REGISTRY ], |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
226 ;; or a cons (FAMILY . REGISTRY), |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
227 ;; or a string FONT-NAME. |
89483 | 228 ;; |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
229 ;; 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
|
230 ;; 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
|
231 ;; 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
|
232 ;; `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
|
233 ;; `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
|
234 ;; 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
|
235 ;; character `*' is embedded in `CHARSET_ENCODING' field. |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
236 ;; |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
237 ;; 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
|
238 ;; `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
|
239 ;; of characters. |
17052 | 240 |
49287
5cb7e7103296
Don't setup the default fontset and
Kenichi Handa <handa@m17n.org>
parents:
47711
diff
changeset
|
241 (defun setup-default-fontset () |
5cb7e7103296
Don't setup the default fontset and
Kenichi Handa <handa@m17n.org>
parents:
47711
diff
changeset
|
242 "Setup the default fontset." |
89483 | 243 (new-fontset |
244 "fontset-default" | |
245 '(;; for each script | |
246 (latin (nil . "ISO8859-1") | |
247 (nil . "ISO8859-2") | |
248 (nil . "ISO8859-3") | |
249 (nil . "ISO8859-4") | |
250 (nil . "ISO8859-9") | |
251 (nil . "ISO8859-10") | |
252 (nil . "ISO8859-13") | |
253 (nil . "ISO8859-14") | |
254 (nil . "ISO8859-15") | |
255 (nil . "VISCII1.1-1")) | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
256 |
89483 | 257 (thai (nil . "TIS620*") |
258 (nil . "ISO8859-11")) | |
259 | |
260 (devanagari (nil . "iso10646.indian-1")) | |
261 | |
262 (lao (nil . "MuleLao-1")) | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
263 |
89483 | 264 ;; both for script and charset. |
265 (tibetan (nil . "muletibetan-2")) | |
89258
b6c2beacc874
("fontset-default"): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
89143
diff
changeset
|
266 |
89483 | 267 ;; both for script and charset. |
268 (ethiopic (nil . "ethiopic-unicode")) | |
269 | |
270 (greek (nil . "ISO8859-7")) | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
271 |
90091
4a0f91659a65
(font-encoding-alist): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
90005
diff
changeset
|
272 (cyrillic (nil . "ISO8859-5") |
4a0f91659a65
(font-encoding-alist): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
90005
diff
changeset
|
273 (nil . "microsoft-cp1251") |
4a0f91659a65
(font-encoding-alist): Add an entry for
Kenichi Handa <handa@m17n.org>
parents:
90005
diff
changeset
|
274 (nil . "koi8-r")) |
89483 | 275 |
276 (arabic (nil . "MuleArabic-0") | |
277 (nil . "MuleArabic-1") | |
278 (nil . "MuleArabic-2") | |
279 (nil . "ISO8859-6")) | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
280 |
89483 | 281 (hebrew (nil . "ISO8859-8")) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
282 |
89483 | 283 (kana (nil . "JISX0208*") |
284 (nil . "GB2312.1980-0") | |
285 (nil . "KSC5601.1987*") | |
89806
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
286 (nil . "JISX0201*") |
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
287 (nil . "JISX0213.2000-1") |
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
288 (nil . "JISX0213.2004-1")) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
289 |
89483 | 290 (bopomofo (nil . "sisheng_cwnn-0")) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
291 |
89483 | 292 (han (nil . "GB2312.1980-0") |
293 (nil . "JISX0208*") | |
294 (nil . "JISX0212*") | |
295 (nil . "big5*") | |
296 (nil . "KSC5601.1987*") | |
297 (nil . "CNS11643.1992-1") | |
298 (nil . "CNS11643.1992-2") | |
299 (nil . "CNS11643.1992-3") | |
300 (nil . "CNS11643.1992-4") | |
301 (nil . "CNS11643.1992-5") | |
302 (nil . "CNS11643.1992-6") | |
303 (nil . "CNS11643.1992-7") | |
304 (nil . "gbk-0") | |
305 (nil . "JISX0213.2000-1") | |
89800
6458a4233000
(setup-default-fontset): Register "JISX0213.2004-1".
Kenichi Handa <handa@m17n.org>
parents:
89636
diff
changeset
|
306 (nil . "JISX0213.2000-2") |
6458a4233000
(setup-default-fontset): Register "JISX0213.2004-1".
Kenichi Handa <handa@m17n.org>
parents:
89636
diff
changeset
|
307 (nil . "JISX0213.2004-1")) |
17052 | 308 |
89483 | 309 (cjk-misc (nil . "GB2312.1980-0") |
310 (nil . "JISX0208*") | |
311 (nil . "JISX0212*") | |
312 (nil . "big5*") | |
313 (nil . "KSC5601.1987*") | |
314 (nil . "CNS11643.1992-1") | |
315 (nil . "CNS11643.1992-2") | |
316 (nil . "CNS11643.1992-3") | |
317 (nil . "CNS11643.1992-4") | |
318 (nil . "CNS11643.1992-5") | |
319 (nil . "CNS11643.1992-6") | |
320 (nil . "CNS11643.1992-7") | |
321 (nil . "gbk-0") | |
322 (nil . "JISX0213.2000-1") | |
323 (nil . "JISX0213.2000-2")) | |
88405 | 324 |
89483 | 325 (hangul (nil . "KSC5601.1987-0")) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
326 |
89483 | 327 ;; for each charset |
328 (ascii (nil . "ISO8859-1")) | |
329 (arabic-digit ("*" . "MuleArabic-0")) | |
330 (arabic-1-column ("*" . "MuleArabic-1")) | |
331 (arabic-2-column ("*" . "MuleArabic-2")) | |
332 (indian-is13194 (nil . "is13194-devanagari")) | |
333 (indian-1-column ("*" . "muleindian-2")) | |
334 ;; Indian CDAC | |
335 (devanagari-cdac (nil . "Devanagari-CDAC")) | |
336 (sanskrit-cdac (nil . "Sanskrit-CDAC")) | |
337 (bengali-cdac (nil . "Bengali-CDAC")) | |
338 (assamese-cdac (nil . "Assamese-CDAC")) | |
339 (punjabi-cdac (nil . "Punjabi-CDAC")) | |
340 (gujarati-cdac (nil . "Gujarati-CDAC")) | |
341 (oriya-cdac (nil . "Oriya-CDAC")) | |
342 (tamil-cdac (nil . "Tamil-CDAC")) | |
343 (telugu-cdac (nil . "Telugu-CDAC")) | |
344 (kannada-cdac (nil . "Kannada-CDAC")) | |
345 (malayalam-cdac (nil . "Malayalam-CDAC")) | |
346 ;; Indian AKRUTI | |
347 (devanagari-akruti (nil . "Devanagari-Akruti")) | |
348 (bengali-akruti (nil . "Bengali-Akruti")) | |
349 (punjabi-akruti (nil . "Punjabi-Akruti")) | |
350 (gujarati-akruti (nil . "Gujarati-Akruti")) | |
351 (oriya-akruti (nil . "Oriya-Akruti")) | |
352 (tamil-akruti (nil . "Tamil-Akruti")) | |
353 (telugu-akruti (nil . "Telugu-Akruti")) | |
354 (kannada-akruti (nil . "Kannada-Akruti")) | |
355 (malayalam-akruti (nil . "Malayalam-Akruti")) | |
356 ;;(devanagari-glyph ("altsys-dv_ttsurekh" . "devanagari-cdac")) | |
357 ;;(malayalam-glyph ("altsys-ml_ttkarthika" . "malayalam-cdac")) | |
358 (ipa (nil . "MuleIPA-1")) | |
17052 | 359 |
89806
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
360 ;; Fallback fonts |
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
361 (nil (nil . "gb2312.1980") |
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
362 (nil . "jisx0208") |
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
363 (nil . "ksc5601.1987") |
89809
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
364 (nil . "CNS11643.1992-1") |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
365 (nil . "CNS11643.1992-2") |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
366 (nil . "CNS11643.1992-3") |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
367 (nil . "CNS11643.1992-4") |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
368 (nil . "CNS11643.1992-5") |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
369 (nil . "CNS11643.1992-6") |
c03a2732d0fd
(font-encoding-alist): Add entries for
Kenichi Handa <handa@m17n.org>
parents:
89806
diff
changeset
|
370 (nil . "CNS11643.1992-7") |
89806
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
371 (nil . "big5") |
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
372 (nil . "jisx0213.2000-1") |
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
373 (nil . "jisx0213.2004-1") |
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
374 (nil . "jisx0212")) |
89483 | 375 )) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
376 |
89483 | 377 ;; Append Unicode fonts. |
378 ;; This may find fonts with more variants (bold, italic) but which | |
379 ;; don't cover many characters. | |
89806
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
380 (set-fontset-font "fontset-default" nil |
89483 | 381 '(nil . "iso10646-1") nil 'append) |
382 ;; These may find fonts that cover many characters but with fewer | |
383 ;; variants. | |
89806
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
384 (set-fontset-font "fontset-default" nil |
89483 | 385 '("gnu-unifont" . "iso10646-1") nil 'append) |
89806
960bd3cc1872
(setup-default-fontset): Delete the
Kenichi Handa <handa@m17n.org>
parents:
89802
diff
changeset
|
386 (set-fontset-font "fontset-default" nil |
89483 | 387 '("mutt-clearlyu" . "iso10646-1") nil 'append)) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
388 |
89274 | 389 ;; These are the registered registries/encodings from |
390 ;; ftp://ftp.x.org/pub/DOCS/registry 2001/06/01 | |
17052 | 391 |
89274 | 392 ;; Name Reference |
393 ;; ---- --------- | |
394 ;; "DEC" [27] | |
395 ;; registry prefix | |
396 ;; "DEC.CNS11643.1986-2" [53] | |
397 ;; CNS11643 2-plane using the encoding | |
398 ;; suggested in that standard | |
399 ;; "DEC.DTSCS.1990-2" [54] | |
400 ;; DEC Taiwan Supplemental Character Set | |
401 ;; "fujitsu.u90x01.1991-0" [87] | |
402 ;; "fujitsu.u90x03.1991-0" [87] | |
403 ;; "GB2312.1980-0" [39],[12] | |
404 ;; China (PRC) Hanzi, GL encoding | |
405 ;; "GB2312.1980-1" [39] | |
406 ;; (deprecated) | |
407 ;; China (PRC) Hanzi, GR encoding | |
408 ;; "HP-Arabic8" [36] | |
409 ;; HPARABIC8 8-bit character set | |
410 ;; "HP-East8" [36] | |
411 ;; HPEAST8 8-bit character set | |
412 ;; "HP-Greek8" [36] | |
413 ;; HPGREEK8 8-bit character set | |
414 ;; "HP-Hebrew8" [36] | |
415 ;; HPHEBREW8 8-bit character set | |
416 ;; "HP-Japanese15" [36] | |
417 ;; HPJAPAN15 15-bit characer set, | |
418 ;; modified from industry defacto | |
419 ;; standard Shift-JIS | |
420 ;; "HP-Kana8" [36] | |
421 ;; HPKANA8 8-bit character set | |
422 ;; "HP-Korean15" [36] | |
423 ;; HPKOREAN15 15-bit character set | |
424 ;; "HP-Roman8" [36] | |
425 ;; HPROMAN8 8-bit character set | |
426 ;; "HP-SChinese15" [36] | |
427 ;; HPSCHINA15 15-bit character set for | |
428 ;; support of Simplified Chinese | |
429 ;; "HP-TChinese15" [36] | |
430 ;; HPTCHINA15 15-bit character set for | |
431 ;; support of Traditional Chinese | |
432 ;; "HP-Turkish8" [36] | |
433 ;; HPTURKISH8 8-bit character set | |
434 ;; "IPSYS" [59] | |
435 ;; registry prefix | |
436 ;; "IPSYS.IE-1" [59] | |
437 ;; "ISO2022"<REG>"-"<ENC> [44] | |
438 ;; "ISO646.1991-IRV" [107] | |
439 ;; ISO 646 International Reference Version | |
440 ;; "ISO8859-1" [15],[12] | |
441 ;; ISO Latin alphabet No. 1 | |
442 ;; "ISO8859-2" [15],[12] | |
443 ;; ISO Latin alphabet No. 2 | |
444 ;; "ISO8859-3" [15],[12] | |
445 ;; ISO Latin alphabet No. 3 | |
446 ;; "ISO8859-4" [15],[12] | |
447 ;; ISO Latin alphabet No. 4 | |
448 ;; "ISO8859-5" [15],[12] | |
449 ;; ISO Latin/Cyrillic alphabet | |
450 ;; "ISO8859-6" [15],[12] | |
451 ;; ISO Latin/Arabic alphabet | |
452 ;; "ISO8859-7" [15],[12] | |
453 ;; ISO Latin/Greek alphabet | |
454 ;; "ISO8859-8" [15],[12] | |
455 ;; ISO Latin/Hebrew alphabet | |
456 ;; "ISO8859-9" [15],[12] | |
457 ;; ISO Latin alphabet No. 5 | |
458 ;; "ISO8859-10" [15],[12] | |
459 ;; ISO Latin alphabet No. 6 | |
460 ;; "ISO8859-13" [15],[12] | |
461 ;; ISO Latin alphabet No. 7 | |
462 ;; "ISO8859-14" [15],[12] | |
463 ;; ISO Latin alphabet No. 8 | |
464 ;; "ISO8859-15" [15],[12] | |
465 ;; ISO Latin alphabet No. 9 | |
466 ;; "FCD8859-15" [7] | |
467 ;; (deprecated) | |
468 ;; ISO Latin alphabet No. 9, Final Committee Draft | |
469 ;; "ISO10646-1" [133] | |
470 ;; Unicode Universal Multiple-Octet Coded Character Set | |
471 ;; "ISO10646-MES" [133] | |
472 ;; (deprecated) | |
473 ;; Unicode Minimum European Subset | |
474 ;; "JISX0201.1976-0" [38],[12] | |
475 ;; 8-Bit Alphanumeric-Katakana Code | |
476 ;; "JISX0208.1983-0" [40],[12] | |
477 ;; Japanese Graphic Character Set, | |
478 ;; GL encoding | |
479 ;; "JISX0208.1990-0" [71] | |
480 ;; Japanese Graphic Character Set, | |
481 ;; GL encoding | |
482 ;; "JISX0208.1983-1" [40] | |
483 ;; (deprecated) | |
484 ;; Japanese Graphic Character Set, | |
485 ;; GR encoding | |
486 ;; "JISX0212.1990-0" [72] | |
487 ;; Supplementary Japanese Graphic Character Set, | |
488 ;; GL encoding | |
489 ;; "KOI8-R" [119] | |
490 ;; Cyrillic alphabet | |
491 ;; "KSC5601.1987-0" [41],[12] | |
492 ;; Korean Graphic Character Set, | |
493 ;; GL encoding | |
494 ;; "KSC5601.1987-1" [41] | |
495 ;; (deprecated) | |
496 ;; Korean Graphic Character Set, | |
497 ;; GR encoding | |
498 ;; "omron_CNS11643-0" [45] | |
499 ;; "omron_CNS11643-1" [45] | |
500 ;; "omron_BIG5-0" [45] | |
501 ;; "omron_BIG5-1" [45] | |
502 ;; "wn.tamil.1993" [103] | |
503 | |
88405 | 504 (defun set-font-encoding (pattern charset) |
89274 | 505 "Set arguments in `font-encoding-alist' (which see)." |
17052 | 506 (let ((slot (assoc pattern font-encoding-alist))) |
507 (if slot | |
88405 | 508 (setcdr slot charset) |
17052 | 509 (setq font-encoding-alist |
88405 | 510 (cons (cons pattern charset) font-encoding-alist))))) |
32646
43edadfecb51
Use registry "MuleTibetan-2" for Tibetan.
Kenichi Handa <handa@m17n.org>
parents:
29427
diff
changeset
|
511 |
17052 | 512 ;; Setting for suppressing XLoadQueryFont on big fonts. |
513 (setq x-pixel-size-width-font-regexp | |
514 "gb2312\\|jisx0208\\|ksc5601\\|cns11643\\|big5") | |
515 | |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
516 ;; These fonts require vertical centering. |
26886
8a6d8101919e
(vertical-centering-font-regexp): New
Kenichi Handa <handa@m17n.org>
parents:
26013
diff
changeset
|
517 (setq vertical-centering-font-regexp |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
518 "gb2312\\|jisx0208\\|jisx0212\\|ksc5601\\|cns11643\\|big5") |
26886
8a6d8101919e
(vertical-centering-font-regexp): New
Kenichi Handa <handa@m17n.org>
parents:
26013
diff
changeset
|
519 |
50516
125da3e3e9af
Specify rescale ratio 1.3 for CDAC fonts.
Kenichi Handa <handa@m17n.org>
parents:
50257
diff
changeset
|
520 ;; CDAC fonts are actually smaller than their design sizes. |
125da3e3e9af
Specify rescale ratio 1.3 for CDAC fonts.
Kenichi Handa <handa@m17n.org>
parents:
50257
diff
changeset
|
521 (setq face-font-rescale-alist |
125da3e3e9af
Specify rescale ratio 1.3 for CDAC fonts.
Kenichi Handa <handa@m17n.org>
parents:
50257
diff
changeset
|
522 '(("-cdac$" . 1.3))) |
125da3e3e9af
Specify rescale ratio 1.3 for CDAC fonts.
Kenichi Handa <handa@m17n.org>
parents:
50257
diff
changeset
|
523 |
88405 | 524 (defvar x-font-name-charset-alist nil |
525 "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
|
526 |
17052 | 527 ;;; XLFD (X Logical Font Description) format handler. |
528 | |
529 ;; Define XLFD's field index numbers. ; field name | |
88405 | 530 (defconst xlfd-regexp-family-subnum 0) ; FOUNDRY and FAMILY |
531 (defconst xlfd-regexp-weight-subnum 1) ; WEIGHT_NAME | |
532 (defconst xlfd-regexp-slant-subnum 2) ; SLANT | |
533 (defconst xlfd-regexp-swidth-subnum 3) ; SETWIDTH_NAME | |
534 (defconst xlfd-regexp-adstyle-subnum 4) ; ADD_STYLE_NAME | |
535 (defconst xlfd-regexp-pixelsize-subnum 5) ; PIXEL_SIZE | |
536 (defconst xlfd-regexp-pointsize-subnum 6) ; POINT_SIZE | |
537 (defconst xlfd-regexp-resx-subnum 7) ; RESOLUTION_X | |
538 (defconst xlfd-regexp-resy-subnum 8) ; RESOLUTION_Y | |
539 (defconst xlfd-regexp-spacing-subnum 8) ; SPACING | |
540 (defconst xlfd-regexp-avgwidth-subnum 10) ; AVERAGE_WIDTH | |
541 (defconst xlfd-regexp-registry-subnum 11) ; REGISTRY and ENCODING | |
17052 | 542 |
543 ;; Regular expression matching against a fontname which conforms to | |
544 ;; XLFD (X Logical Font Description). All fields in XLFD should be | |
545 ;; not be omitted (but can be a wild card) to be matched. | |
546 (defconst xlfd-tight-regexp | |
547 "^\ | |
88405 | 548 -\\([^-]*-[^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)\ |
17052 | 549 -\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)\ |
88405 | 550 -\\([^-]*\\)-\\([^-]*\\)-\\([^-]*-[^-]*\\)$") |
551 | |
552 ;; Regular expression matching against a fontname which conforms to | |
553 ;; XLFD (X Logical Font Description). All fields in XLFD from FOUNDRY | |
89274 | 554 ;; to ADSTYLE, REGISTRY, and ENCODING should be not be omitted (but |
88405 | 555 ;; can be a wild card) to be matched. |
556 (defconst xlfd-style-regexp | |
557 "^\ | |
558 -\\([^-]*-[^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-.*\ | |
559 -\\([^-]*-[^-]*\\)$") | |
17052 | 560 |
561 ;; List of field numbers of XLFD whose values are numeric. | |
562 (defconst xlfd-regexp-numeric-subnums | |
88405 | 563 (list xlfd-regexp-pixelsize-subnum ;5 |
564 xlfd-regexp-pointsize-subnum ;6 | |
565 xlfd-regexp-resx-subnum ;7 | |
566 xlfd-regexp-resy-subnum ;8 | |
567 xlfd-regexp-avgwidth-subnum ;10 | |
17052 | 568 )) |
569 | |
570 (defun x-decompose-font-name (pattern) | |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
571 "Decompose PATTERN into XLFD fields and return a vector of the fields. |
88405 | 572 The length of the vector is 12. |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
573 The FOUNDRY and FAMILY fields are concatinated and stored in the first |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
574 element of the vector. |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
575 The REGISTRY and ENCODING fields are concatinated and stored in the last |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
576 element of the vector. |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
577 |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
578 Return nil if PATTERN doesn't conform to XLFD." |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
579 (if (string-match xlfd-tight-regexp pattern) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
580 (let ((xlfd-fields (make-vector 12 nil))) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
581 (dotimes (i 12) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
582 (aset xlfd-fields i (match-string (1+ i) pattern))) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
583 (dotimes (i 12) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
584 (if (string-match "^[*-]+$" (aref xlfd-fields i)) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
585 (aset xlfd-fields i nil))) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
586 xlfd-fields))) |
17177
9e550b522bc0
(x-charset-registries): Change entry for Ethiopic.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
587 |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
588 (defun x-compose-font-name (fields &optional reduce) |
89274 | 589 "Compose X fontname from FIELDS. |
88405 | 590 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
|
591 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
|
592 Optional argument REDUCE is always ignored. It exists just for |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
593 backward compatibility." |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
594 (concat "-" (mapconcat (lambda (x) (or x "*")) fields "-"))) |
23205
22df54cdb841
(resolved-ascii-font): New variable.
Kenichi Handa <handa@m17n.org>
parents:
23196
diff
changeset
|
595 |
40250
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
596 (defun x-must-resolve-font-name (xlfd-fields) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
597 "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
|
598 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
|
599 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
|
600 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
|
601 Value is name of that font." |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
602 (let ((ascii-font nil) (index 0)) |
88405 | 603 (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
|
604 (let ((pattern (x-compose-font-name xlfd-fields))) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
605 (condition-case nil |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
606 (setq ascii-font (x-resolve-font-name pattern)) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
607 (error |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
608 (message "Warning: no fonts matching `%s' available" pattern) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
609 (aset xlfd-fields index "*") |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
610 (setq index (1+ index)))))) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
611 (unless ascii-font |
50581
4daf1ecf4381
(create-fontset-from-ascii-font): Doc fix.
John Paul Wallington <jpw@pobox.com>
parents:
50516
diff
changeset
|
612 (error "No fonts found")) |
40250
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
613 ascii-font)) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
614 |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
615 |
17052 | 616 (defun x-complement-fontset-spec (xlfd-fields fontlist) |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
617 "Complement elements of FONTLIST based on XLFD-FIELDS. |
17052 | 618 XLFD-FIELDS is a vector of XLFD (X Logical Font Description) fields. |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
619 FONTLIST is an alist of script names vs the corresponding font names. |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
620 |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
621 The font names are complemented as below. |
18350
3f4364889538
(x-charset-registries): Name changed for consistency:
Kenichi Handa <handa@m17n.org>
parents:
17989
diff
changeset
|
622 |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
623 If a font name matches `xlfd-style-regexp', each field of wild card is |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
624 replaced by the corresponding fields in XLFD-FIELDS." |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
625 (let ((default-spec (vector (aref xlfd-fields xlfd-regexp-family-subnum) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
626 (aref xlfd-fields xlfd-regexp-weight-subnum) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
627 (aref xlfd-fields xlfd-regexp-slant-subnum) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
628 (aref xlfd-fields xlfd-regexp-swidth-subnum) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
629 (aref xlfd-fields xlfd-regexp-adstyle-subnum) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
630 (aref xlfd-fields xlfd-regexp-registry-subnum)))) |
88405 | 631 (dolist (elt fontlist) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
632 (let ((name (cadr elt)) |
88405 | 633 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
|
634 (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
|
635 (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
|
636 (string-match xlfd-style-regexp name))) |
88405 | 637 (setq font-spec (make-vector 6 nil)) |
638 (dotimes (i 6) | |
639 (aset font-spec i (match-string (1+ i) name))) | |
89900
7ad4af87a4d4
(x-complement-fontset-spec): Don't
Kenichi Handa <handa@m17n.org>
parents:
89830
diff
changeset
|
640 (dotimes (i 5) |
88405 | 641 (if (string-match "^[*-]+$" (aref font-spec i)) |
642 (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
|
643 (setcar (cdr elt) font-spec)))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49287
diff
changeset
|
644 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
645 fontlist)) |
17052 | 646 |
19049
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
647 (defun fontset-name-p (fontset) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
648 "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
|
649 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
|
650 with \"fontset\" in `<CHARSET_REGISTRY> field." |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
651 (and (string-match xlfd-tight-regexp fontset) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
652 (string= (match-string (1+ xlfd-regexp-registry-subnum) fontset) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
653 "fontset"))) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
654 |
17052 | 655 (defun generate-fontset-menu () |
89274 | 656 "Return list to be appended to `x-fixed-font-alist'. |
657 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
|
658 (let (l) |
3e0204a3fcb8
(generate-fontset-menu): Exclude the defualt fontset.
Kenichi Handa <handa@m17n.org>
parents:
89004
diff
changeset
|
659 (dolist (fontset (fontset-list)) |
3e0204a3fcb8
(generate-fontset-menu): Exclude the defualt fontset.
Kenichi Handa <handa@m17n.org>
parents:
89004
diff
changeset
|
660 (or (string-match "fontset-default$" fontset) |
3e0204a3fcb8
(generate-fontset-menu): Exclude the defualt fontset.
Kenichi Handa <handa@m17n.org>
parents:
89004
diff
changeset
|
661 (push (list (fontset-plain-name fontset) fontset) l))) |
24160
ab814ec4995e
(generate-fontset-menu): Return a
Kenichi Handa <handa@m17n.org>
parents:
24153
diff
changeset
|
662 (cons "Fontset" |
89127
3e0204a3fcb8
(generate-fontset-menu): Exclude the defualt fontset.
Kenichi Handa <handa@m17n.org>
parents:
89004
diff
changeset
|
663 (sort l #'(lambda (x y) (string< (car x) (car y))))))) |
17052 | 664 |
665 (defun fontset-plain-name (fontset) | |
666 "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
|
667 (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
|
668 (error "Invalid fontset: %s" fontset)) |
17052 | 669 (let ((xlfd-fields (x-decompose-font-name fontset))) |
670 (if xlfd-fields | |
89004
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
671 (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
|
672 (weight (aref xlfd-fields xlfd-regexp-weight-subnum)) |
17052 | 673 (slant (aref xlfd-fields xlfd-regexp-slant-subnum)) |
674 (swidth (aref xlfd-fields xlfd-regexp-swidth-subnum)) | |
675 (size (aref xlfd-fields xlfd-regexp-pixelsize-subnum)) | |
88405 | 676 (nickname (aref xlfd-fields xlfd-regexp-registry-subnum)) |
17052 | 677 name) |
88405 | 678 (if (not (string-match "^fontset-\\(.*\\)$" nickname)) |
89004
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
679 (setq nickname family) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
680 (setq nickname (match-string 1 nickname))) |
90344
d4661241b1fa
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90200
diff
changeset
|
681 (if (and size (> (string-to-number size) 0)) |
89004
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
682 (setq name (format "%s: %s-dot" nickname size)) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
683 (setq name nickname)) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
684 (and weight |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
685 (cond ((string-match "^medium$" weight) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
686 (setq name (concat name " " "medium"))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
687 ((string-match "^bold$\\|^demibold$" weight) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
688 (setq name (concat name " " weight))))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
689 (and slant |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
690 (cond ((string-match "^i$" slant) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
691 (setq name (concat name " " "italic"))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
692 ((string-match "^o$" slant) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
693 (setq name (concat name " " "slant"))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
694 ((string-match "^ri$" slant) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
695 (setq name (concat name " " "reverse italic"))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
696 ((string-match "^ro$" slant) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
697 (setq name (concat name " " "reverse slant"))))) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
698 name) |
17052 | 699 fontset))) |
700 | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
701 (defvar charset-script-alist |
89143
7b8bd597892a
(charset-script-alist): Fix script names.
Kenichi Handa <handa@m17n.org>
parents:
89127
diff
changeset
|
702 '((ascii . latin) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
703 (latin-iso8859-1 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
704 (latin-iso8859-2 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
705 (latin-iso8859-3 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
706 (latin-iso8859-4 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
707 (latin-iso8859-9 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
708 (latin-iso8859-10 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
709 (latin-iso8859-13 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
710 (latin-iso8859-14 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
711 (latin-iso8859-15 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
712 (latin-iso8859-16 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
713 (latin-jisx0201 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
714 (thai-tis620 . thai) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
715 (cyrillic-iso8859-5 . cyrillic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
716 (arabic-iso8859-6 . arabic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
717 (greek-iso8859-7 . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
718 (hebrew-iso8859-8 . latin) |
89143
7b8bd597892a
(charset-script-alist): Fix script names.
Kenichi Handa <handa@m17n.org>
parents:
89127
diff
changeset
|
719 (katakana-jisx0201 . kana) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
720 (chinese-gb2312 . han) |
90005
0c0b009323eb
(font-encoding-alist): Add gbk.
Kenichi Handa <handa@m17n.org>
parents:
89909
diff
changeset
|
721 (chinese-gbk . han) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
722 (chinese-big5-1 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
723 (chinese-big5-2 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
724 (chinese-cns11643-1 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
725 (chinese-cns11643-2 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
726 (chinese-cns11643-3 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
727 (chinese-cns11643-4 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
728 (chinese-cns11643-5 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
729 (chinese-cns11643-6 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
730 (chinese-cns11643-7 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
731 (japanese-jisx0208 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
732 (japanese-jisx0208-1978 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
733 (japanese-jisx0212 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
734 (japanese-jisx0213-1 . han) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
735 (japanese-jisx0213-2 . han) |
89143
7b8bd597892a
(charset-script-alist): Fix script names.
Kenichi Handa <handa@m17n.org>
parents:
89127
diff
changeset
|
736 (korean-ksc5601 . hangul) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
737 (chinese-sisheng . bopomofo) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
738 (vietnamese-viscii-lower . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
739 (vietnamese-viscii-upper . latin) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
740 (arabic-digit . arabic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
741 (arabic-1-column . arabic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
742 (arabic-2-column . arabic) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
743 (indian-is13194 . devanagari) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
744 (indian-glyph . devanagari) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
745 (indian-1-column . devanagari) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
746 (indian-2-column . devanagari) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
747 (tibetan-1-column . tibetan)) |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
748 "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
|
749 |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
750 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
|
751 to map charsets to scripts.") |
49287
5cb7e7103296
Don't setup the default fontset and
Kenichi Handa <handa@m17n.org>
parents:
47711
diff
changeset
|
752 |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
753 (defun create-fontset-from-fontset-spec (fontset-spec |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
754 &optional style-variant noerror) |
17052 | 755 "Create a fontset from fontset specification string FONTSET-SPEC. |
756 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
|
757 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
|
758 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
|
759 |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
760 When a frame uses the fontset as the `font' parameter, the frame's |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
761 default font name is derived from FONTSET-NAME by substituting |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
762 \"iso8859-1\" for the tail part \"fontset-XXX\". But, if SCRIPT-NAMEn |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
763 is \"ascii\", use the corresponding FONT-NAMEn as the default font |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
764 name. |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
765 |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
766 Optional 2nd and 3rd arguments are ignored. They exist just for |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
767 backward compatibility. |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
768 |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
769 It returns a name of the created fontset. |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
770 |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
771 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
|
772 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
|
773 `charset-script-alist' (which see)." |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
774 (or (string-match "^[^,]+" fontset-spec) |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
775 (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
|
776 (let ((idx (match-end 0)) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
777 (name (match-string 0 fontset-spec)) |
90344
d4661241b1fa
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90200
diff
changeset
|
778 xlfd-fields target script fontlist) |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
779 (setq xlfd-fields (x-decompose-font-name name)) |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
780 (or xlfd-fields |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
781 (error "Fontset name \"%s\" not conforming to XLFD" name)) |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
782 |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
783 ;; At first, extract pairs of charset and fontname from FONTSET-SPEC. |
90348
c98f49021a42
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90344
diff
changeset
|
784 (while (string-match "[, \t\n]*\\([^:]+\\):[ \t]*\\([^,]+\\)" |
c98f49021a42
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90344
diff
changeset
|
785 fontset-spec idx) |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
786 (setq idx (match-end 0)) |
90344
d4661241b1fa
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90200
diff
changeset
|
787 (setq target (intern (match-string 1 fontset-spec))) |
d4661241b1fa
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90200
diff
changeset
|
788 (cond ((or (eq target 'ascii) |
d4661241b1fa
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90200
diff
changeset
|
789 (memq target (char-table-extra-slot char-script-table 0)) |
d4661241b1fa
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90200
diff
changeset
|
790 (setq script (cdr (assq script charset-script-alist)))) |
d4661241b1fa
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90200
diff
changeset
|
791 (push (list script (match-string 2 fontset-spec)) fontlist)) |
d4661241b1fa
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90200
diff
changeset
|
792 ((charsetp target) |
d4661241b1fa
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90200
diff
changeset
|
793 (push (list target (match-string 2 fontset-spec)) fontlist)))) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
794 |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
795 ;; Complement FONTLIST. |
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
796 (setq fontlist (x-complement-fontset-spec xlfd-fields fontlist)) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
797 |
89357
8f8c7d4c2e6e
Enable the default fontset to use
Kenichi Handa <handa@m17n.org>
parents:
89325
diff
changeset
|
798 ;; Create a fontset. |
90344
d4661241b1fa
(create-fontset-from-fontset-spec): Fix
Kenichi Handa <handa@m17n.org>
parents:
90200
diff
changeset
|
799 (new-fontset name (nreverse fontlist)))) |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
800 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
801 (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
|
802 fontset-name) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
803 "Create a fontset from an ASCII font FONT. |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
804 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
805 Optional 1st arg RESOLVED-FONT is a resolved name of FONT. If |
50581
4daf1ecf4381
(create-fontset-from-ascii-font): Doc fix.
John Paul Wallington <jpw@pobox.com>
parents:
50516
diff
changeset
|
806 omitted, `x-resolve-font-name' is called to get the resolved name. At |
89274 | 807 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
|
808 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
809 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
|
810 `<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
|
811 an appropriate name is generated automatically. |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
812 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
813 It returns a name of the created fontset." |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
814 (setq font (downcase font)) |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
815 (setq resolved-font |
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
816 (downcase (or resolved-font (x-resolve-font-name font)))) |
88405 | 817 (let ((xlfd (x-decompose-font-name resolved-font)) |
818 fontset) | |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
819 (if fontset-name |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
820 (setq fontset-name (downcase fontset-name)) |
89004
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
821 (if (query-fontset "fontset-startup") |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
822 (setq fontset-name |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
823 (subst-char-in-string |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
824 ?- ?_ (aref xlfd xlfd-regexp-registry-subnum) t)) |
fbd881940a45
(fontset-plain-name): If the fontset
Kenichi Handa <handa@m17n.org>
parents:
88893
diff
changeset
|
825 (setq fontset-name "startup"))) |
88405 | 826 (aset xlfd xlfd-regexp-registry-subnum |
827 (format "fontset-%s" fontset-name)) | |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
828 (setq fontset (x-compose-font-name xlfd)) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
829 (or (query-fontset fontset) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
830 (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
|
831 |
17052 | 832 |
17842
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
833 ;; 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
|
834 ;; 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
|
835 ;; 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
|
836 ;; many cases. |
17842
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
837 (defvar standard-fontset-spec |
88405 | 838 (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
|
839 "String of fontset spec of the standard fontset. |
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
840 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
|
841 with correct glyphs by using the standard fontset. |
17052 | 842 See the documentation of `create-fontset-from-fontset-spec' for the format.") |
843 | |
88893
86354924a790
Setup the default fontset by the new
Kenichi Handa <handa@m17n.org>
parents:
88694
diff
changeset
|
844 |
17052 | 845 ;; Create fontsets from X resources of the name `fontset-N (class |
846 ;; Fontset-N)' where N is integer 0, 1, ... | |
847 ;; 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
|
848 ;; `standard-fontset-spec'. |
17052 | 849 |
850 (defun create-fontset-from-x-resource () | |
851 (let ((idx 0) | |
852 fontset-spec) | |
27534
eeb998860456
(standard-fontset-spec): Purecopy it.
Dave Love <fx@gnu.org>
parents:
26886
diff
changeset
|
853 (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
|
854 (format "Fontset-%d" idx))) |
24153
729affdf2ca1
(create-fontset-from-x-resource): Make style variants.
Kenichi Handa <handa@m17n.org>
parents:
23890
diff
changeset
|
855 (create-fontset-from-fontset-spec fontset-spec t 'noerror) |
17052 | 856 (setq idx (1+ idx))))) |
857 | |
858 ;; | |
859 (provide 'fontset) | |
860 | |
52401 | 861 ;;; arch-tag: bb53e629-0234-403c-950e-551e61554849 |
17052 | 862 ;;; fontset.el ends here |