Mercurial > emacs
annotate lisp/international/fontset.el @ 49851:fec321336b72
(tq-create): Fix quoted lambda.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 18 Feb 2003 12:52:17 +0000 |
parents | 0d8b17d428b5 |
children | 19c37f19c706 d7ddb3e565de |
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 |
7 ;; Keywords: mule, multilingual, fontset | |
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 | |
29234
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
30 ;; Set standard fontname specification of characters in the default |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
31 ;; fontset to find an appropriate font for each charset. This is used |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
32 ;; to generate a font name for a fontset if the fontset doesn't |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
33 ;; specify a font name for a specific character. The specification |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
34 ;; has the form (FAMILY . REGISTRY). FAMILY may be nil, in which |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
35 ;; case, the family name of default face is used. If REGISTRY |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
36 ;; 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
|
37 ;; `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
|
38 ;; `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
|
39 ;; string is embedded in `CHARSET_REGISTRY' field, and a wild card |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
40 ;; character `*' is embedded in `CHARSET_ENCODING' field. The |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
41 ;; REGISTRY for ASCII characters are predefined as "ISO8859-1". |
17052 | 42 |
49287
5cb7e7103296
Don't setup the default fontset and
Kenichi Handa <handa@m17n.org>
parents:
47711
diff
changeset
|
43 (defun setup-default-fontset () |
5cb7e7103296
Don't setup the default fontset and
Kenichi Handa <handa@m17n.org>
parents:
47711
diff
changeset
|
44 "Setup the default fontset." |
5cb7e7103296
Don't setup the default fontset and
Kenichi Handa <handa@m17n.org>
parents:
47711
diff
changeset
|
45 (dolist |
5cb7e7103296
Don't setup the default fontset and
Kenichi Handa <handa@m17n.org>
parents:
47711
diff
changeset
|
46 (elt |
42072
9f1fa0a02eb3
Build the list L at compile time.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
41467
diff
changeset
|
47 ;; Eval this at compile-time, since fontset.el is always loaded |
9f1fa0a02eb3
Build the list L at compile time.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
41467
diff
changeset
|
48 ;; when run under X and this would always load ind-util.el as well. |
9f1fa0a02eb3
Build the list L at compile time.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
41467
diff
changeset
|
49 (eval-when-compile |
9f1fa0a02eb3
Build the list L at compile time.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
41467
diff
changeset
|
50 `((latin-iso8859-1 . (nil . "ISO8859-1")) |
29234
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
51 (latin-iso8859-2 . (nil . "ISO8859-2")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
52 (latin-iso8859-3 . (nil . "ISO8859-3")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
53 (latin-iso8859-4 . (nil . "ISO8859-4")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
54 (thai-tis620 . ("*" . "TIS620")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
55 (greek-iso8859-7 . ("*" . "ISO8859-7")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
56 (arabic-iso8859-6 . ("*" . "ISO8859-6")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
57 (hebrew-iso8859-8 . ("*" . "ISO8859-8")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
58 (katakana-jisx0201 . ("*" . "JISX0201")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
59 (latin-jisx0201 . (nil . "JISX0201")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
60 (cyrillic-iso8859-5 . ("*" . "ISO8859-5")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
61 (latin-iso8859-9 . (nil . "ISO8859-9")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
62 (japanese-jisx0208-1978 . ("*" . "JISX0208.1978")) |
34163
faa3e4d4deea
Change the font registries for CJK
Kenichi Handa <handa@m17n.org>
parents:
33048
diff
changeset
|
63 (chinese-gb2312 . ("*" . "GB2312.1980")) |
faa3e4d4deea
Change the font registries for CJK
Kenichi Handa <handa@m17n.org>
parents:
33048
diff
changeset
|
64 (japanese-jisx0208 . ("*" . "JISX0208.1990")) |
faa3e4d4deea
Change the font registries for CJK
Kenichi Handa <handa@m17n.org>
parents:
33048
diff
changeset
|
65 (korean-ksc5601 . ("*" . "KSC5601.1989")) |
29234
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
66 (japanese-jisx0212 . ("*" . "JISX0212")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
67 (chinese-cns11643-1 . ("*" . "CNS11643.1992-1")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
68 (chinese-cns11643-2 . ("*" . "CNS11643.1992-2")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
69 (chinese-cns11643-3 . ("*" . "CNS11643.1992-3")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
70 (chinese-cns11643-4 . ("*" . "CNS11643.1992-4")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
71 (chinese-cns11643-5 . ("*" . "CNS11643.1992-5")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
72 (chinese-cns11643-6 . ("*" . "CNS11643.1992-6")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
73 (chinese-cns11643-7 . ("*" . "CNS11643.1992-7")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
74 (chinese-big5-1 . ("*" . "Big5")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
75 (chinese-big5-2 . ("*" . "Big5")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
76 (chinese-sisheng . (nil . "sisheng_cwnn")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
77 (vietnamese-viscii-lower . (nil . "VISCII1.1")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
78 (vietnamese-viscii-upper . (nil . "VISCII1.1")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
79 (arabic-digit . ("*" . "MuleArabic-0")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
80 (arabic-1-column . ("*" . "MuleArabic-1")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
81 (arabic-2-column . ("*" . "MuleArabic-2")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
82 (ipa . (nil . "MuleIPA")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
83 (ethiopic . ("*" . "Ethiopic-Unicode")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
84 (ascii-right-to-left . (nil . "ISO8859-1")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
85 (indian-is13194 . ("*" . "IS13194-Devanagari")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
86 (indian-2-column . ("*" . "MuleIndian-2")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
87 (lao . ("*" . "MuleLao-1")) |
32646
43edadfecb51
Use registry "MuleTibetan-2" for Tibetan.
Kenichi Handa <handa@m17n.org>
parents:
29427
diff
changeset
|
88 (tibetan . ("proportional" . "MuleTibetan-2")) |
29234
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
89 (tibetan-1-column . ("*" . "MuleTibetan-1")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
90 (latin-iso8859-14 . (nil . "ISO8859-14")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
91 (latin-iso8859-15 . (nil . "ISO8859-15")) |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
92 (mule-unicode-0100-24ff . (nil . "ISO10646-1")) |
33048
636ac3744ddd
(fontset-default): Modified for mule-unicode-2500-33ff and
Kenichi Handa <handa@m17n.org>
parents:
32646
diff
changeset
|
93 (mule-unicode-2500-33ff . (nil . "ISO10646-1")) |
636ac3744ddd
(fontset-default): Modified for mule-unicode-2500-33ff and
Kenichi Handa <handa@m17n.org>
parents:
32646
diff
changeset
|
94 (mule-unicode-e000-ffff . (nil . "ISO10646-1")) |
34245
b31daef799a1
Correct the font registries for
Kenichi Handa <handa@m17n.org>
parents:
34163
diff
changeset
|
95 (japanese-jisx0213-1 . ("*" . "JISX0213.2000-1")) |
b31daef799a1
Correct the font registries for
Kenichi Handa <handa@m17n.org>
parents:
34163
diff
changeset
|
96 (japanese-jisx0213-2 . ("*" . "JISX0213.2000-2")) |
41467
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
97 ;; unicode |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
98 ((,(decode-char 'ucs #x0900) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
99 . ,(decode-char 'ucs #x097F)) . ("*" . "ISO10646.indian-1")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
100 ;; indian |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
101 (indian-glyph . ("*" . "Devanagari-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
102 ((,(indian-glyph-char 0 'devanagari) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
103 . ,(indian-glyph-char 255 'devanagari)) . ("*" . "Devanagari-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
104 ((,(indian-glyph-char 0 'sanskrit) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
105 . ,(indian-glyph-char 255 'sanskrit)) . ("*" . "Sanskrit-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
106 ((,(indian-glyph-char 0 'bengali) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
107 . ,(indian-glyph-char 255 'bengali)) . ("*" . "Bengali-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
108 ((,(indian-glyph-char 0 'assamese) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
109 . ,(indian-glyph-char 255 'assamese)) . ("*" . "Assamese-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
110 ((,(indian-glyph-char 0 'punjabi) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
111 . ,(indian-glyph-char 255 'punjabi)) . ("*" . "Punjabi-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
112 ((,(indian-glyph-char 0 'gujarati) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
113 . ,(indian-glyph-char 255 'gujarati)) . ("*" . "Gujarati-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
114 ((,(indian-glyph-char 0 'oriya) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
115 . ,(indian-glyph-char 255 'oriya)) . ("*" . "Oriya-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
116 ((,(indian-glyph-char 0 'tamil) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
117 . ,(indian-glyph-char 255 'tamil)) . ("*" . "Tamil-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
118 ((,(indian-glyph-char 0 'telugu) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
119 . ,(indian-glyph-char 255 'telugu)) . ("*" . "Telugu-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
120 ((,(indian-glyph-char 0 'kannada) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
121 . ,(indian-glyph-char 255 'kannada)) . ("*" . "Kannada-CDAC")) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
122 ((,(indian-glyph-char 0 'malayalam) |
55c3397b3029
Delete the setting for indian-1-column
Richard M. Stallman <rms@gnu.org>
parents:
40250
diff
changeset
|
123 . ,(indian-glyph-char 255 'malayalam)) . ("*" . "Malayalam-CDAC")) |
42072
9f1fa0a02eb3
Build the list L at compile time.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
41467
diff
changeset
|
124 ))) |
49287
5cb7e7103296
Don't setup the default fontset and
Kenichi Handa <handa@m17n.org>
parents:
47711
diff
changeset
|
125 (set-fontset-font "fontset-default" (car elt) (cdr elt)))) |
17052 | 126 |
127 ;; Set arguments in `font-encoding-alist' (which see). | |
128 (defun set-font-encoding (pattern charset encoding) | |
129 (let ((slot (assoc pattern font-encoding-alist))) | |
130 (if slot | |
131 (let ((place (assq charset (cdr slot)))) | |
132 (if place | |
133 (setcdr place encoding) | |
134 (setcdr slot (cons (cons charset encoding) (cdr slot))))) | |
135 (setq font-encoding-alist | |
136 (cons (list pattern (cons charset encoding)) font-encoding-alist))) | |
137 )) | |
138 | |
47711
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
139 ;; Allow display of arbitrary characters with an iso-10646-encoded |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
140 ;; (`Unicode') font. |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
141 (define-translation-table 'ucs-mule-to-mule-unicode |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
142 ucs-mule-to-mule-unicode) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
143 (define-translation-hash-table 'ucs-mule-cjk-to-unicode |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
144 ucs-mule-cjk-to-unicode) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
145 |
33048
636ac3744ddd
(fontset-default): Modified for mule-unicode-2500-33ff and
Kenichi Handa <handa@m17n.org>
parents:
32646
diff
changeset
|
146 (define-ccl-program ccl-encode-unicode-font |
32646
43edadfecb51
Use registry "MuleTibetan-2" for Tibetan.
Kenichi Handa <handa@m17n.org>
parents:
29427
diff
changeset
|
147 `(0 |
47711
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
148 ;; r0: charset-id |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
149 ;; r1: 1st position code |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
150 ;; r2: 2nd position code (if r0 is 2D charset) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
151 ((if (r0 == ,(charset-id 'ascii)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
152 ((r2 = r1) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
153 (r1 = 0)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
154 ;; At first, try to get a Unicode code point directly. |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
155 ((if (r2 >= 0) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
156 ;; This is a 2D charset. |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
157 (r1 = ((r1 << 7) | r2))) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
158 (lookup-character ucs-mule-cjk-to-unicode r0 r1) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
159 (if r7 |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
160 ;; We got it! |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
161 ((r1 = (r0 >> 8)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
162 (r2 = (r0 & #xFF))) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
163 ;; Look for a translation for non-ASCII chars. |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
164 ((translate-character ucs-mule-to-mule-unicode r0 r1) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
165 (if (r0 == ,(charset-id 'latin-iso8859-1)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
166 ((r2 = (r1 + 128)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
167 (r1 = 0)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
168 ((r2 = (r1 & #x7F)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
169 (r1 >>= 7) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
170 (if (r0 == ,(charset-id 'mule-unicode-0100-24ff)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
171 ((r1 *= 96) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
172 (r1 += r2) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
173 (r1 += ,(- #x100 (* 32 96) 32)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
174 (r1 >8= 0) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
175 (r2 = r7)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
176 (if (r0 == ,(charset-id 'mule-unicode-2500-33ff)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
177 ((r1 *= 96) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
178 (r1 += r2) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
179 (r1 += ,(- #x2500 (* 32 96) 32)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
180 (r1 >8= 0) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
181 (r2 = r7)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
182 (if (r0 == ,(charset-id 'mule-unicode-e000-ffff)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
183 ((r1 *= 96) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
184 (r1 += r2) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
185 (r1 += ,(- #xe000 (* 32 96) 32)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
186 (r1 >8= 0) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
187 (r2 = r7)) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
188 ;; No way, use the glyph for U+FFFD. |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
189 ((r1 = #xFF) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
190 (r2 = #xFD))))))))))))) |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
191 "Encode characters for display with iso10646 font. |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
192 Translate through the translation-hash-table named |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
193 `ucs-mule-cjk-to-unicode' and the translation-table named |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
194 `ucs-mule-to-mule-unicode' initially.") |
32646
43edadfecb51
Use registry "MuleTibetan-2" for Tibetan.
Kenichi Handa <handa@m17n.org>
parents:
29427
diff
changeset
|
195 |
47711
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
196 ;; Use the above CCL encoder for Unicode fonts. Please note that the |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
197 ;; regexp is not simply "ISO10646-1" because there exists, for |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
198 ;; instance, the following Devanagari Unicode fonts: |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
199 ;; -misc-fixed-medium-r-normal--24-240-72-72-c-120-iso10646.indian-1 |
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
200 ;; -sibal-devanagari-medium-r-normal--24-240-75-75-P--iso10646-dev |
32646
43edadfecb51
Use registry "MuleTibetan-2" for Tibetan.
Kenichi Handa <handa@m17n.org>
parents:
29427
diff
changeset
|
201 (setq font-ccl-encoder-alist |
47711
d99378556333
(ucs-mule-to-mule-unicode): Define this
Kenichi Handa <handa@m17n.org>
parents:
42329
diff
changeset
|
202 (cons '("ISO10646.*-*" . ccl-encode-unicode-font) |
32646
43edadfecb51
Use registry "MuleTibetan-2" for Tibetan.
Kenichi Handa <handa@m17n.org>
parents:
29427
diff
changeset
|
203 font-ccl-encoder-alist)) |
43edadfecb51
Use registry "MuleTibetan-2" for Tibetan.
Kenichi Handa <handa@m17n.org>
parents:
29427
diff
changeset
|
204 |
17052 | 205 ;; Setting for suppressing XLoadQueryFont on big fonts. |
206 (setq x-pixel-size-width-font-regexp | |
207 "gb2312\\|jisx0208\\|ksc5601\\|cns11643\\|big5") | |
208 | |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
209 ;; These fonts require vertical centering. |
26886
8a6d8101919e
(vertical-centering-font-regexp): New
Kenichi Handa <handa@m17n.org>
parents:
26013
diff
changeset
|
210 (setq vertical-centering-font-regexp |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
211 "gb2312\\|jisx0208\\|jisx0212\\|ksc5601\\|cns11643\\|big5") |
26886
8a6d8101919e
(vertical-centering-font-regexp): New
Kenichi Handa <handa@m17n.org>
parents:
26013
diff
changeset
|
212 |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
213 (defvar x-font-name-charset-alist |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
214 '(("iso8859-1" ascii latin-iso8859-1) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
215 ("iso8859-2" ascii latin-iso8859-2) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
216 ("iso8859-3" ascii latin-iso8859-3) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
217 ("iso8859-4" ascii latin-iso8859-4) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
218 ("iso8859-5" ascii cyrillic-iso8859-5) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
219 ("iso8859-6" ascii arabic-iso8859-6) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
220 ("iso8859-7" ascii greek-iso8859-7) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
221 ("iso8859-8" ascii hebrew-iso8859-8) |
26013 | 222 ("iso8859-14" ascii latin-iso8859-14) |
223 ("iso8859-15" ascii latin-iso8859-15) | |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
224 ("tis620" ascii thai-tis620) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
225 ("koi8" ascii cyrillic-iso8859-5) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
226 ("viscii" ascii vietnamese-viscii-upper vietnamese-viscii-lower) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
227 ("vscii" ascii vietnamese-viscii-upper vietnamese-viscii-lower) |
32646
43edadfecb51
Use registry "MuleTibetan-2" for Tibetan.
Kenichi Handa <handa@m17n.org>
parents:
29427
diff
changeset
|
228 ("mulelao-1" ascii lao) |
33048
636ac3744ddd
(fontset-default): Modified for mule-unicode-2500-33ff and
Kenichi Handa <handa@m17n.org>
parents:
32646
diff
changeset
|
229 ("iso10646-1" ascii latin-iso8859-1 mule-unicode-0100-24ff |
636ac3744ddd
(fontset-default): Modified for mule-unicode-2500-33ff and
Kenichi Handa <handa@m17n.org>
parents:
32646
diff
changeset
|
230 mule-unicode-2500-33ff mule-unicode-e000-ffff)) |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
231 "Alist of font names vs list of charsets the font can display. |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
232 |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
233 When a font name which matches some element of this alist is given as |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
234 `-fn' command line argument or is specified by X resource, a fontset |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
235 which uses the specified font for the corresponding charsets are |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
236 created and used for the initial frame.") |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
237 |
17052 | 238 ;;; XLFD (X Logical Font Description) format handler. |
239 | |
240 ;; Define XLFD's field index numbers. ; field name | |
241 (defconst xlfd-regexp-foundry-subnum 0) ; FOUNDRY | |
242 (defconst xlfd-regexp-family-subnum 1) ; FAMILY_NAME | |
243 (defconst xlfd-regexp-weight-subnum 2) ; WEIGHT_NAME | |
244 (defconst xlfd-regexp-slant-subnum 3) ; SLANT | |
245 (defconst xlfd-regexp-swidth-subnum 4) ; SETWIDTH_NAME | |
246 (defconst xlfd-regexp-adstyle-subnum 5) ; ADD_STYLE_NAME | |
247 (defconst xlfd-regexp-pixelsize-subnum 6) ; PIXEL_SIZE | |
248 (defconst xlfd-regexp-pointsize-subnum 7) ; POINT_SIZE | |
249 (defconst xlfd-regexp-resx-subnum 8) ; RESOLUTION_X | |
250 (defconst xlfd-regexp-resy-subnum 9) ; RESOLUTION_Y | |
251 (defconst xlfd-regexp-spacing-subnum 10) ; SPACING | |
252 (defconst xlfd-regexp-avgwidth-subnum 11) ; AVERAGE_WIDTH | |
253 (defconst xlfd-regexp-registry-subnum 12) ; CHARSET_REGISTRY | |
254 (defconst xlfd-regexp-encoding-subnum 13) ; CHARSET_ENCODING | |
255 | |
256 ;; Regular expression matching against a fontname which conforms to | |
257 ;; XLFD (X Logical Font Description). All fields in XLFD should be | |
258 ;; not be omitted (but can be a wild card) to be matched. | |
259 (defconst xlfd-tight-regexp | |
260 "^\ | |
261 -\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)\ | |
262 -\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)\ | |
263 -\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)-\\([^-]*\\)$") | |
264 | |
265 ;; List of field numbers of XLFD whose values are numeric. | |
266 (defconst xlfd-regexp-numeric-subnums | |
267 (list xlfd-regexp-pixelsize-subnum ;6 | |
268 xlfd-regexp-pointsize-subnum ;7 | |
269 xlfd-regexp-resx-subnum ;8 | |
270 xlfd-regexp-resy-subnum ;9 | |
271 xlfd-regexp-avgwidth-subnum ;11 | |
272 )) | |
273 | |
274 (defun x-decompose-font-name (pattern) | |
275 "Decompose PATTERN into XLFD's fields and return vector of the fields. | |
276 The length of the vector is 14. | |
277 | |
278 If PATTERN doesn't conform to XLFD, try to get a full XLFD name from | |
279 X server and use the information of the full name to decompose | |
280 PATTERN. If no full XLFD name is gotten, return nil." | |
281 (let (xlfd-fields fontname) | |
282 (if (string-match xlfd-tight-regexp pattern) | |
283 (let ((i 0)) | |
284 (setq xlfd-fields (make-vector 14 nil)) | |
285 (while (< i 14) | |
286 (aset xlfd-fields i (match-string (1+ i) pattern)) | |
287 (setq i (1+ i))) | |
288 xlfd-fields) | |
289 (setq fontname (condition-case nil | |
290 (x-resolve-font-name pattern) | |
291 (error))) | |
292 (if (and fontname | |
293 (string-match xlfd-tight-regexp fontname)) | |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
294 ;; We get a full XLFD name. |
17052 | 295 (let ((len (length pattern)) |
296 (i 0) | |
297 l) | |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
298 ;; 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
|
299 ;; should be a cons of matched index and matched string. |
17052 | 300 (setq xlfd-fields (make-vector 14 nil)) |
301 (while (< i 14) | |
302 (aset xlfd-fields i | |
303 (cons (match-beginning (1+ i)) | |
304 (match-string (1+ i) fontname))) | |
305 (setq i (1+ i))) | |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
306 |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
307 ;; Replace wild cards in PATTERN by regexp codes. |
17052 | 308 (setq i 0) |
309 (while (< i len) | |
310 (let ((ch (aref pattern i))) | |
311 (if (= ch ??) | |
312 (setq pattern (concat (substring pattern 0 i) | |
313 "\\(.\\)" | |
314 (substring pattern (1+ i))) | |
315 len (+ len 4) | |
316 i (+ i 4)) | |
317 (if (= ch ?*) | |
318 (setq pattern (concat (substring pattern 0 i) | |
319 "\\(.*\\)" | |
320 (substring pattern (1+ i))) | |
321 len (+ len 5) | |
322 i (+ i 5)) | |
323 (setq i (1+ i)))))) | |
23890
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
324 |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
325 ;; 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
|
326 (if (string-match pattern fontname) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
327 ;; The regular expression PATTERN matchs the full XLFD |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
328 ;; name. Set elements that correspond to a wild card |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
329 ;; in PATTERN to "*", set the other elements to the |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
330 ;; exact strings in PATTERN. |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
331 (let ((l (cdr (cdr (match-data))))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
332 (setq i 0) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
333 (while (< i 14) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
334 (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
|
335 (progn |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
336 (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
|
337 (setq i (1+ i))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
338 (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
|
339 (progn |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
340 (aset xlfd-fields i "*") |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
341 (setq i (1+ i))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
342 (setq l (cdr (cdr l))))))) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
343 ;; Set each element of xlfd-fields to the exact string |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
344 ;; in the corresonding fields in full XLFD name. |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
345 (setq i 0) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
346 (while (< i 14) |
fa4839661777
(x-decompose-font-name): If PATTERN
Kenichi Handa <handa@m17n.org>
parents:
23655
diff
changeset
|
347 (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
|
348 (setq i (1+ i)))) |
17052 | 349 xlfd-fields))))) |
350 | |
17177
9e550b522bc0
(x-charset-registries): Change entry for Ethiopic.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
351 ;; Replace consecutive wild-cards (`*') in NAME to one. |
9e550b522bc0
(x-charset-registries): Change entry for Ethiopic.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
352 ;; Ex. (x-reduce-font-name "-*-*-*-iso8859-1") => "-*-iso8859-1" |
9e550b522bc0
(x-charset-registries): Change entry for Ethiopic.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
353 (defsubst x-reduce-font-name (name) |
9e550b522bc0
(x-charset-registries): Change entry for Ethiopic.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
354 (while (string-match "-\\*-\\(\\*-\\)+" name) |
9e550b522bc0
(x-charset-registries): Change entry for Ethiopic.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
355 (setq name (replace-match "-*-" t t name))) |
9e550b522bc0
(x-charset-registries): Change entry for Ethiopic.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
356 name) |
9e550b522bc0
(x-charset-registries): Change entry for Ethiopic.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
357 |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
358 (defun x-compose-font-name (fields &optional reduce) |
17052 | 359 "Compose X's fontname from FIELDS. |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
360 FIELDS is a vector of XLFD fields, the length 14. |
17177
9e550b522bc0
(x-charset-registries): Change entry for Ethiopic.
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
361 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
|
362 Optional argument REDUCE is always ignored. It exists just for |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
363 backward compatibility." |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
364 (concat "-" (mapconcat (lambda (x) (or x "*")) fields "-"))) |
23205
22df54cdb841
(resolved-ascii-font): New variable.
Kenichi Handa <handa@m17n.org>
parents:
23196
diff
changeset
|
365 |
40250
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
366 |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
367 (defun x-must-resolve-font-name (xlfd-fields) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
368 "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
|
369 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
|
370 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
|
371 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
|
372 Value is name of that font." |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
373 (let ((ascii-font nil) (index 0)) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
374 (while (and (null ascii-font) (<= index xlfd-regexp-encoding-subnum)) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
375 (let ((pattern (x-compose-font-name xlfd-fields))) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
376 (condition-case nil |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
377 (setq ascii-font (x-resolve-font-name pattern)) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
378 (error |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
379 (message "Warning: no fonts matching `%s' available" pattern) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
380 (aset xlfd-fields index "*") |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
381 (setq index (1+ index)))))) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
382 (unless ascii-font |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
383 (error "No fonts founds")) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
384 ascii-font)) |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
385 |
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
386 |
17052 | 387 (defun x-complement-fontset-spec (xlfd-fields fontlist) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
388 "Complement FONTLIST for charsets based on XLFD-FIELDS and return it. |
17052 | 389 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
|
390 FONTLIST is an alist of charsets vs the corresponding font names. |
17052 | 391 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
392 The fonts are complemented as below. |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
393 |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
394 If FONTLIST doesn't specify a font for ASCII charset, generate a font |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
395 name for the charset from XLFD-FIELDS, and add that information to |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
396 FONTLIST. |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
397 |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
398 If a font specifid for ASCII supports the other charsets (see the |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
399 variable `x-font-name-charset-alist'), add that information to FONTLIST." |
34917
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
400 (let* ((slot (assq 'ascii fontlist)) |
36368
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
401 (ascii-font (cdr slot)) |
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
402 ascii-font-spec) |
34917
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
403 (if ascii-font |
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
404 (setcdr slot (setq ascii-font (x-resolve-font-name ascii-font))) |
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
405 ;; If font for ASCII is not specified, add it. |
29234
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
406 (aset xlfd-fields xlfd-regexp-registry-subnum "iso8859") |
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
407 (aset xlfd-fields xlfd-regexp-encoding-subnum "1") |
40250
4f3033e5b688
(x-must-resolve-font-name): New
Gerd Moellmann <gerd@gnu.org>
parents:
38414
diff
changeset
|
408 (setq ascii-font (x-must-resolve-font-name xlfd-fields)) |
29234
c9a5f356fe77
Set family names of non-latin charsets in default fontset to "*".
Kenichi Handa <handa@m17n.org>
parents:
29168
diff
changeset
|
409 (setq fontlist (cons (cons 'ascii ascii-font) fontlist))) |
18350
3f4364889538
(x-charset-registries): Name changed for consistency:
Kenichi Handa <handa@m17n.org>
parents:
17989
diff
changeset
|
410 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
411 ;; If the font for ASCII also supports the other charsets, and |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
412 ;; they are not specified in FONTLIST, add them. |
36368
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
413 (setq xlfd-fields (x-decompose-font-name ascii-font)) |
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
414 (if (not xlfd-fields) |
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
415 (setq ascii-font-spec ascii-font) |
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
416 (setq ascii-font-spec |
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
417 (cons (format "%s-%s" |
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
418 (aref xlfd-fields xlfd-regexp-foundry-subnum) |
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
419 (aref xlfd-fields xlfd-regexp-family-subnum)) |
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
420 (format "%s-%s" |
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
421 (aref xlfd-fields xlfd-regexp-registry-subnum) |
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
422 (aref xlfd-fields xlfd-regexp-encoding-subnum))))) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
423 (let ((tail x-font-name-charset-alist) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
424 elt) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
425 (while tail |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
426 (setq elt (car tail) tail (cdr tail)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
427 (if (string-match (car elt) ascii-font) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
428 (let ((charsets (cdr elt)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
429 charset) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
430 (while charsets |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
431 (setq charset (car charsets) charsets (cdr charsets)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
432 (or (assq charset fontlist) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
433 (setq fontlist |
36368
dbd54e46ee03
(x-complement-fontset-spec): In the
Kenichi Handa <handa@m17n.org>
parents:
34917
diff
changeset
|
434 (cons (cons charset ascii-font-spec) fontlist)))))))) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49287
diff
changeset
|
435 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
436 fontlist)) |
17052 | 437 |
19049
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
438 (defun fontset-name-p (fontset) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
439 "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
|
440 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
|
441 with \"fontset\" in `<CHARSET_REGISTRY> field." |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
442 (and (string-match xlfd-tight-regexp fontset) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
443 (string= (match-string (1+ xlfd-regexp-registry-subnum) fontset) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
444 "fontset"))) |
cad4c032fa26
(fontset-name-p): New function.
Kenichi Handa <handa@m17n.org>
parents:
18719
diff
changeset
|
445 |
17052 | 446 ;; Return a list to be appended to `x-fixed-font-alist' when |
447 ;; `mouse-set-font' is called. | |
448 (defun generate-fontset-menu () | |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
449 (let ((fontsets (fontset-list)) |
17052 | 450 fontset-name |
451 l) | |
452 (while fontsets | |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
453 (setq fontset-name (car fontsets) fontsets (cdr fontsets)) |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
454 (setq l (cons (list (fontset-plain-name fontset-name) fontset-name) l))) |
24160
ab814ec4995e
(generate-fontset-menu): Return a
Kenichi Handa <handa@m17n.org>
parents:
24153
diff
changeset
|
455 (cons "Fontset" |
ab814ec4995e
(generate-fontset-menu): Return a
Kenichi Handa <handa@m17n.org>
parents:
24153
diff
changeset
|
456 (sort l (function (lambda (x y) (string< (car x) (car y)))))))) |
17052 | 457 |
458 (defun fontset-plain-name (fontset) | |
459 "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
|
460 (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
|
461 (error "Invalid fontset: %s" fontset)) |
17052 | 462 (let ((xlfd-fields (x-decompose-font-name fontset))) |
463 (if xlfd-fields | |
464 (let ((weight (aref xlfd-fields xlfd-regexp-weight-subnum)) | |
465 (slant (aref xlfd-fields xlfd-regexp-slant-subnum)) | |
466 (swidth (aref xlfd-fields xlfd-regexp-swidth-subnum)) | |
467 (size (aref xlfd-fields xlfd-regexp-pixelsize-subnum)) | |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
468 (charset (aref xlfd-fields xlfd-regexp-registry-subnum)) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
469 (nickname (aref xlfd-fields xlfd-regexp-encoding-subnum)) |
17052 | 470 name) |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
471 (if (not (string= "fontset" charset)) |
17052 | 472 fontset |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
473 (if (> (string-to-int size) 0) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
474 (setq name (format "%s: %s-dot" nickname size)) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
475 (setq name nickname)) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
476 (cond ((string-match "^medium$" weight) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
477 (setq name (concat name " " "medium"))) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
478 ((string-match "^bold$\\|^demibold$" weight) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
479 (setq name (concat name " " weight)))) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
480 (cond ((string-match "^i$" slant) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
481 (setq name (concat name " " "italic"))) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
482 ((string-match "^o$" slant) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
483 (setq name (concat name " " "slant"))) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
484 ((string-match "^ri$" slant) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
485 (setq name (concat name " " "reverse italic"))) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
486 ((string-match "^ro$" slant) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
487 (setq name (concat name " " "reverse slant")))) |
17052 | 488 name)) |
489 fontset))) | |
490 | |
49287
5cb7e7103296
Don't setup the default fontset and
Kenichi Handa <handa@m17n.org>
parents:
47711
diff
changeset
|
491 |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
492 (defun create-fontset-from-fontset-spec (fontset-spec |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
493 &optional style-variant noerror) |
17052 | 494 "Create a fontset from fontset specification string FONTSET-SPEC. |
495 FONTSET-SPEC is a string of the format: | |
496 FONTSET-NAME,CHARSET-NAME0:FONT-NAME0,CHARSET-NAME1:FONT-NAME1, ... | |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
497 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
|
498 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
499 Optional 2nd argument is ignored. It exists just for backward |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
500 compatibility. |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
501 |
18719
de8249499f33
(create-fontset-from-fontset-spec): Typo in doc-string fixed.
Kenichi Handa <handa@m17n.org>
parents:
18714
diff
changeset
|
502 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
|
503 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
|
504 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
505 It returns a name of the created fontset." |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
506 (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
|
507 (error "Invalid fontset spec: %s" fontset-spec)) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
508 (setq fontset-spec (downcase fontset-spec)) |
17755
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
509 (let ((idx (match-end 0)) |
4c82e87c7d7c
(x-decompose-font-name): While seting each field of
Kenichi Handa <handa@m17n.org>
parents:
17339
diff
changeset
|
510 (name (match-string 0 fontset-spec)) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
511 xlfd-fields charset fontlist ascii-font) |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
512 (if (query-fontset name) |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
49287
diff
changeset
|
513 (or noerror |
23655
8aa7d51024b2
(create-fontset-from-fontset-spec): Give correct arg to `error'.
Kenichi Handa <handa@m17n.org>
parents:
23205
diff
changeset
|
514 (error "Fontset \"%s\" already exists" name)) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
515 (setq xlfd-fields (x-decompose-font-name name)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
516 (or xlfd-fields |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
517 (error "Fontset \"%s\" not conforming to XLFD" name)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
518 |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
519 ;; 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
|
520 (while (string-match "[, \t\n]*\\([^:]+\\):\\([^,]+\\)" fontset-spec idx) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
521 (setq idx (match-end 0)) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
522 (setq charset (intern (match-string 1 fontset-spec))) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
523 (if (charsetp charset) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
524 (setq fontlist (cons (cons charset (match-string 2 fontset-spec)) |
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
525 fontlist)))) |
34917
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
526 (setq ascii-font (cdr (assq 'ascii fontlist))) |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
527 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
528 ;; Complement FONTLIST. |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
529 (setq fontlist (x-complement-fontset-spec xlfd-fields fontlist)) |
22449
c87830c691a5
(instantiate-fontset): Delete
Kenichi Handa <handa@m17n.org>
parents:
22161
diff
changeset
|
530 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
531 (new-fontset name fontlist) |
22161
7a4c3fd89dda
(x-font-name-charset-alist): New
Kenichi Handa <handa@m17n.org>
parents:
22128
diff
changeset
|
532 |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
533 ;; Define the short name alias. |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
534 (if (and (string-match "fontset-.*$" name) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
535 (not (assoc name fontset-alias-alist))) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
536 (let ((alias (match-string 0 name))) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
537 (or (rassoc alias fontset-alias-alist) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
538 (setq fontset-alias-alist |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
539 (cons (cons name alias) fontset-alias-alist))))) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
540 |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
541 ;; Define the ASCII font name alias. |
34917
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
542 (or ascii-font |
989f2f0c8a7e
(x-complement-fontset-spec): Resolve
Kenichi Handa <handa@m17n.org>
parents:
34245
diff
changeset
|
543 (setq ascii-font (cdr (assq 'ascii fontlist)))) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
544 (or (rassoc ascii-font fontset-alias-alist) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
545 (setq fontset-alias-alist |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
546 (cons (cons name ascii-font) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
547 fontset-alias-alist)))) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
548 |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
549 name)) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
550 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
551 (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
|
552 fontset-name) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
553 "Create a fontset from an ASCII font FONT. |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
554 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
555 Optional 1st arg RESOLVED-FONT is a resolved name of FONT. If |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
556 omitted, x-resolve-font-name is called to get the resolved name. At |
22720
ab4f30149aa0
(x-complement-fontset-spec): Typo fixed.
Kenichi Handa <handa@m17n.org>
parents:
22672
diff
changeset
|
557 this time, if FONT is not available, error is signaled. |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
558 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
559 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
|
560 `<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
|
561 an appropriate name is generated automatically. |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
562 |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
563 It returns a name of the created fontset." |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
564 (setq font (downcase font)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
565 (if resolved-font |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
566 (setq resolved-font (downcase resolved-font)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
567 (setq resolved-font (downcase (x-resolve-font-name font)))) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
568 (let ((xlfd (x-decompose-font-name font)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
569 (resolved-xlfd (x-decompose-font-name resolved-font)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
570 fontset fontset-spec) |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
571 (aset xlfd xlfd-regexp-foundry-subnum nil) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
572 (aset xlfd xlfd-regexp-family-subnum nil) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
573 (aset xlfd xlfd-regexp-registry-subnum "fontset") |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
574 (if fontset-name |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
575 (setq fontset-name (downcase fontset-name)) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
576 (setq fontset-name |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
577 (format "%s_%s_%s" |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
578 (aref resolved-xlfd xlfd-regexp-registry-subnum) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
579 (aref resolved-xlfd xlfd-regexp-encoding-subnum) |
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
580 (aref resolved-xlfd xlfd-regexp-pixelsize-subnum)))) |
22672
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
581 (aset xlfd xlfd-regexp-encoding-subnum fontset-name) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
582 (setq fontset (x-compose-font-name xlfd)) |
9cfa1a788a5a
(create-fontset-from-fontset-spec):
Kenichi Handa <handa@m17n.org>
parents:
22618
diff
changeset
|
583 (or (query-fontset fontset) |
28215
ceaded4c2cb9
(x-charset-registries): Variable
Kenichi Handa <handa@m17n.org>
parents:
27534
diff
changeset
|
584 (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
|
585 |
17052 | 586 |
17842
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
587 ;; 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
|
588 ;; 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
|
589 ;; 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
|
590 ;; many cases. |
17842
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
591 (defvar standard-fontset-spec |
27534
eeb998860456
(standard-fontset-spec): Purecopy it.
Dave Love <fx@gnu.org>
parents:
26886
diff
changeset
|
592 (purecopy "-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard, |
17052 | 593 chinese-gb2312:-*-medium-r-normal-*-16-*-gb2312*-*, |
594 korean-ksc5601:-*-medium-r-normal-*-16-*-ksc5601*-*, | |
595 chinese-cns11643-1:-*-medium-r-normal-*-16-*-cns11643*-1, | |
596 chinese-cns11643-2:-*-medium-r-normal-*-16-*-cns11643*-2, | |
597 chinese-cns11643-3:-*-medium-r-normal-*-16-*-cns11643*-3, | |
598 chinese-cns11643-4:-*-medium-r-normal-*-16-*-cns11643*-4, | |
599 chinese-cns11643-5:-*-medium-r-normal-*-16-*-cns11643*-5, | |
600 chinese-cns11643-6:-*-medium-r-normal-*-16-*-cns11643*-6, | |
27534
eeb998860456
(standard-fontset-spec): Purecopy it.
Dave Love <fx@gnu.org>
parents:
26886
diff
changeset
|
601 chinese-cns11643-7:-*-medium-r-normal-*-16-*-cns11643*-7") |
17842
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
602 "String of fontset spec of the standard fontset. |
cb1af8ead3df
(standard-fontset-spec): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
17755
diff
changeset
|
603 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
|
604 with correct glyphs by using the standard fontset. |
17052 | 605 See the documentation of `create-fontset-from-fontset-spec' for the format.") |
606 | |
607 ;; Create fontsets from X resources of the name `fontset-N (class | |
608 ;; Fontset-N)' where N is integer 0, 1, ... | |
609 ;; 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
|
610 ;; `standard-fontset-spec'. |
17052 | 611 |
612 (defun create-fontset-from-x-resource () | |
613 (let ((idx 0) | |
614 fontset-spec) | |
27534
eeb998860456
(standard-fontset-spec): Purecopy it.
Dave Love <fx@gnu.org>
parents:
26886
diff
changeset
|
615 (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
|
616 (format "Fontset-%d" idx))) |
24153
729affdf2ca1
(create-fontset-from-x-resource): Make style variants.
Kenichi Handa <handa@m17n.org>
parents:
23890
diff
changeset
|
617 (create-fontset-from-fontset-spec fontset-spec t 'noerror) |
17052 | 618 (setq idx (1+ idx))))) |
619 | |
620 ;; | |
621 (provide 'fontset) | |
622 | |
623 ;;; fontset.el ends here |