Mercurial > emacs
annotate src/fontset.c @ 56199:c0ad262446d6
(Fmapconcat, Fmapcar): Use SAFE_ALLOCA_LISP.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Mon, 21 Jun 2004 22:36:02 +0000 |
parents | 450b41d3c078 |
children | f27d5d17fde5 30dd490f06f2 4c90ffeb71c5 |
rev | line source |
---|---|
17052 | 1 /* Fontset handler. |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
2 Copyright (C) 1995, 1997, 2000 Electrotechnical Laboratory, JAPAN. |
18341
33e78cc7f058
Change copyright notices.
Richard M. Stallman <rms@gnu.org>
parents:
18192
diff
changeset
|
3 Licensed to the Free Software Foundation. |
17052 | 4 |
17071 | 5 This file is part of GNU Emacs. |
6 | |
7 GNU Emacs is free software; you can redistribute it and/or modify | |
8 it under the terms of the GNU General Public License as published by | |
9 the Free Software Foundation; either version 2, or (at your option) | |
10 any later version. | |
17052 | 11 |
17071 | 12 GNU Emacs is distributed in the hope that it will be useful, |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 GNU General Public License for more details. | |
17052 | 16 |
17071 | 17 You should have received a copy of the GNU General Public License |
18 along with GNU Emacs; see the file COPYING. If not, write to | |
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
20 Boston, MA 02111-1307, USA. */ | |
17052 | 21 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
22 /* #define FONTSET_DEBUG */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
23 |
17052 | 24 #include <config.h> |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
25 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
26 #ifdef FONTSET_DEBUG |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
27 #include <stdio.h> |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
28 #endif |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
29 |
17052 | 30 #include "lisp.h" |
28963 | 31 #include "buffer.h" |
17052 | 32 #include "charset.h" |
33 #include "ccl.h" | |
31102
6a0caa788013
Include keyboard.h before frame.h.
Andrew Innes <andrewi@gnu.org>
parents:
30941
diff
changeset
|
34 #include "keyboard.h" |
23517
73f09e7bc96e
Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents:
22719
diff
changeset
|
35 #include "frame.h" |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
36 #include "dispextern.h" |
17052 | 37 #include "fontset.h" |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
38 #include "window.h" |
52654
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
39 #ifdef HAVE_X_WINDOWS |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
40 #include "xterm.h" |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
41 #endif |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
42 #ifdef WINDOWSNT |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
43 #include "w32term.h" |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
44 #endif |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
45 #ifdef MAC_OS |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
46 #include "macterm.h" |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
47 #endif |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
48 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
49 #ifdef FONTSET_DEBUG |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
50 #undef xassert |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
51 #define xassert(X) do {if (!(X)) abort ();} while (0) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
52 #undef INLINE |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
53 #define INLINE |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
54 #endif |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
55 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
56 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
57 /* FONTSET |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
58 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
59 A fontset is a collection of font related information to give |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
60 similar appearance (style, size, etc) of characters. There are two |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
61 kinds of fontsets; base and realized. A base fontset is created by |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
62 new-fontset from Emacs Lisp explicitly. A realized fontset is |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
63 created implicitly when a face is realized for ASCII characters. A |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
64 face is also realized for multibyte characters based on an ASCII |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
65 face. All of the multibyte faces based on the same ASCII face |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
66 share the same realized fontset. |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
67 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
68 A fontset object is implemented by a char-table. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
69 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
70 An element of a base fontset is: |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
71 (INDEX . FONTNAME) or |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
72 (INDEX . (FOUNDRY . REGISTRY )) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
73 FONTNAME is a font name pattern for the corresponding character. |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
74 FOUNDRY and REGISTRY are respectively foundry and registry fields of |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
75 a font name for the corresponding character. INDEX specifies for |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
76 which character (or generic character) the element is defined. It |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
77 may be different from an index to access this element. For |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
78 instance, if a fontset defines some font for all characters of |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
79 charset `japanese-jisx0208', INDEX is the generic character of this |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
80 charset. REGISTRY is the |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
81 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
82 An element of a realized fontset is FACE-ID which is a face to use |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
83 for displaying the corresponding character. |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
84 |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
85 All single byte characters (ASCII and 8bit-unibyte) share the same |
29767
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
86 element in a fontset. The element is stored in the first element |
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
87 of the fontset. |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
88 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
89 To access or set each element, use macros FONTSET_REF and |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
90 FONTSET_SET respectively for efficiency. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
91 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
92 A fontset has 3 extra slots. |
17052 | 93 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
94 The 1st slot is an ID number of the fontset. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
95 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
96 The 2nd slot is a name of the fontset. This is nil for a realized |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
97 face. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
98 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
99 The 3rd slot is a frame that the fontset belongs to. This is nil |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
100 for a default face. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
101 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
102 A parent of a base fontset is nil. A parent of a realized fontset |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
103 is a base fontset. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
104 |
30398
dde5ab185aad
(fontset_ref): Remove INLINE declaration.
Kenichi Handa <handa@m17n.org>
parents:
30172
diff
changeset
|
105 All fontsets are recorded in Vfontset_table. |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
106 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
107 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
108 DEFAULT FONTSET |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
109 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
110 There's a special fontset named `default fontset' which defines a |
30398
dde5ab185aad
(fontset_ref): Remove INLINE declaration.
Kenichi Handa <handa@m17n.org>
parents:
30172
diff
changeset
|
111 default fontname pattern. When a base fontset doesn't specify a |
dde5ab185aad
(fontset_ref): Remove INLINE declaration.
Kenichi Handa <handa@m17n.org>
parents:
30172
diff
changeset
|
112 font for a specific character, the corresponding value in the |
dde5ab185aad
(fontset_ref): Remove INLINE declaration.
Kenichi Handa <handa@m17n.org>
parents:
30172
diff
changeset
|
113 default fontset is used. The format is the same as a base fontset. |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
114 |
30398
dde5ab185aad
(fontset_ref): Remove INLINE declaration.
Kenichi Handa <handa@m17n.org>
parents:
30172
diff
changeset
|
115 The parent of a realized fontset created for such a face that has |
dde5ab185aad
(fontset_ref): Remove INLINE declaration.
Kenichi Handa <handa@m17n.org>
parents:
30172
diff
changeset
|
116 no fontset is the default fontset. |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
117 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
118 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
119 These structures are hidden from the other codes than this file. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
120 The other codes handle fontsets only by their ID numbers. They |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
121 usually use variable name `fontset' for IDs. But, in this file, we |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
122 always use variable name `id' for IDs, and name `fontset' for the |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
123 actual fontset objects. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
124 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
125 */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
126 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
127 /********** VARIABLES and FUNCTION PROTOTYPES **********/ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
128 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
129 extern Lisp_Object Qfont; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
130 Lisp_Object Qfontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
131 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
132 /* Vector containing all fontsets. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
133 static Lisp_Object Vfontset_table; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
134 |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
135 /* Next possibly free fontset ID. Usually this keeps the minimum |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
136 fontset ID not yet used. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
137 static int next_fontset_id; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
138 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
139 /* The default fontset. This gives default FAMILY and REGISTRY of |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
140 font for each characters. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
141 static Lisp_Object Vdefault_fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
142 |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
143 /* Alist of font specifications. It override the font specification |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
144 in the default fontset. */ |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
145 static Lisp_Object Voverriding_fontspec_alist; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
146 |
17052 | 147 Lisp_Object Vfont_encoding_alist; |
17112
5c48ff325655
(syms_of_fontset): Intern Qfontset. Declare new lisp
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
148 Lisp_Object Vuse_default_ascent; |
19282
09a1536debb4
(Vignore_relative_composition): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19172
diff
changeset
|
149 Lisp_Object Vignore_relative_composition; |
19450
895dc2520755
(Valternate_fontname_alist): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
19282
diff
changeset
|
150 Lisp_Object Valternate_fontname_alist; |
17730
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
151 Lisp_Object Vfontset_alias_alist; |
26858
7cc081b4e084
(Vvertical_centering_font_regexp): New variable.
Kenichi Handa <handa@m17n.org>
parents:
26164
diff
changeset
|
152 Lisp_Object Vvertical_centering_font_regexp; |
17052 | 153 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
154 /* The following six are declarations of callback functions depending |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
155 on window system. See the comments in src/fontset.h for more |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
156 detail. */ |
17052 | 157 |
158 /* Return a pointer to struct font_info of font FONT_IDX of frame F. */ | |
20315
931b4ddf7966
Protoize functions declarations.
Andreas Schwab <schwab@suse.de>
parents:
19450
diff
changeset
|
159 struct font_info *(*get_font_info_func) P_ ((FRAME_PTR f, int font_idx)); |
17052 | 160 |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
161 /* Return a list of font names which matches PATTERN. See the documentation |
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
162 of `x-list-fonts' for more details. */ |
23517
73f09e7bc96e
Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents:
22719
diff
changeset
|
163 Lisp_Object (*list_fonts_func) P_ ((struct frame *f, |
73f09e7bc96e
Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents:
22719
diff
changeset
|
164 Lisp_Object pattern, |
73f09e7bc96e
Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents:
22719
diff
changeset
|
165 int size, |
73f09e7bc96e
Include frame.h before fontset.h.
Kenichi Handa <handa@m17n.org>
parents:
22719
diff
changeset
|
166 int maxnames)); |
17052 | 167 |
168 /* Load a font named NAME for frame F and return a pointer to the | |
169 information of the loaded font. If loading is failed, return 0. */ | |
20315
931b4ddf7966
Protoize functions declarations.
Andreas Schwab <schwab@suse.de>
parents:
19450
diff
changeset
|
170 struct font_info *(*load_font_func) P_ ((FRAME_PTR f, char *name, int)); |
17052 | 171 |
172 /* Return a pointer to struct font_info of a font named NAME for frame F. */ | |
20315
931b4ddf7966
Protoize functions declarations.
Andreas Schwab <schwab@suse.de>
parents:
19450
diff
changeset
|
173 struct font_info *(*query_font_func) P_ ((FRAME_PTR f, char *name)); |
17052 | 174 |
175 /* Additional function for setting fontset or changing fontset | |
176 contents of frame F. */ | |
20315
931b4ddf7966
Protoize functions declarations.
Andreas Schwab <schwab@suse.de>
parents:
19450
diff
changeset
|
177 void (*set_frame_fontset_func) P_ ((FRAME_PTR f, Lisp_Object arg, |
931b4ddf7966
Protoize functions declarations.
Andreas Schwab <schwab@suse.de>
parents:
19450
diff
changeset
|
178 Lisp_Object oldval)); |
17052 | 179 |
21553
2d7afcd11b72
(find_ccl_program_func): New variable.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
180 /* To find a CCL program, fs_load_font calls this function. |
2d7afcd11b72
(find_ccl_program_func): New variable.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
181 The argument is a pointer to the struct font_info. |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
182 This function set the member `encoder' of the structure. */ |
21553
2d7afcd11b72
(find_ccl_program_func): New variable.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
183 void (*find_ccl_program_func) P_ ((struct font_info *)); |
2d7afcd11b72
(find_ccl_program_func): New variable.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
184 |
17052 | 185 /* Check if any window system is used now. */ |
20315
931b4ddf7966
Protoize functions declarations.
Andreas Schwab <schwab@suse.de>
parents:
19450
diff
changeset
|
186 void (*check_window_system_func) P_ ((void)); |
17052 | 187 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
188 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
189 /* Prototype declarations for static functions. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
190 static Lisp_Object fontset_ref P_ ((Lisp_Object, int)); |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
191 static Lisp_Object lookup_overriding_fontspec P_ ((Lisp_Object, int)); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
192 static void fontset_set P_ ((Lisp_Object, int, Lisp_Object)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
193 static Lisp_Object make_fontset P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
194 static int fontset_id_valid_p P_ ((int)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
195 static Lisp_Object fontset_pattern_regexp P_ ((Lisp_Object)); |
35658
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
196 static Lisp_Object font_family_registry P_ ((Lisp_Object, int)); |
54995
df451d79772b
(regularize_fontname): Renamed from regulalize_fontname.
John Paul Wallington <jpw@pobox.com>
parents:
53622
diff
changeset
|
197 static Lisp_Object regularize_fontname P_ ((Lisp_Object)); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
198 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
199 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
200 /********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
201 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
202 /* Return the fontset with ID. No check of ID's validness. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
203 #define FONTSET_FROM_ID(id) AREF (Vfontset_table, id) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
204 |
30398
dde5ab185aad
(fontset_ref): Remove INLINE declaration.
Kenichi Handa <handa@m17n.org>
parents:
30172
diff
changeset
|
205 /* Macros to access special values of FONTSET. */ |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
206 #define FONTSET_ID(fontset) XCHAR_TABLE (fontset)->extras[0] |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
207 #define FONTSET_NAME(fontset) XCHAR_TABLE (fontset)->extras[1] |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
208 #define FONTSET_FRAME(fontset) XCHAR_TABLE (fontset)->extras[2] |
29767
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
209 #define FONTSET_ASCII(fontset) XCHAR_TABLE (fontset)->contents[0] |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
210 #define FONTSET_BASE(fontset) XCHAR_TABLE (fontset)->parent |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
211 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
212 #define BASE_FONTSET_P(fontset) NILP (FONTSET_BASE(fontset)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
213 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
214 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
215 /* Return the element of FONTSET (char-table) at index C (character). */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
216 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
217 #define FONTSET_REF(fontset, c) fontset_ref (fontset, c) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
218 |
30398
dde5ab185aad
(fontset_ref): Remove INLINE declaration.
Kenichi Handa <handa@m17n.org>
parents:
30172
diff
changeset
|
219 static Lisp_Object |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
220 fontset_ref (fontset, c) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
221 Lisp_Object fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
222 int c; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
223 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
224 int charset, c1, c2; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
225 Lisp_Object elt, defalt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
226 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
227 if (SINGLE_BYTE_CHAR_P (c)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
228 return FONTSET_ASCII (fontset); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
229 |
29011
b60861d6c1e0
(fontset_ref): Use SPLIT_CHAR instead of
Kenichi Handa <handa@m17n.org>
parents:
28971
diff
changeset
|
230 SPLIT_CHAR (c, charset, c1, c2); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
231 elt = XCHAR_TABLE (fontset)->contents[charset + 128]; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
232 if (!SUB_CHAR_TABLE_P (elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
233 return elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
234 defalt = XCHAR_TABLE (elt)->defalt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
235 if (c1 < 32 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
236 || (elt = XCHAR_TABLE (elt)->contents[c1], |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
237 NILP (elt))) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
238 return defalt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
239 if (!SUB_CHAR_TABLE_P (elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
240 return elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
241 defalt = XCHAR_TABLE (elt)->defalt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
242 if (c2 < 32 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
243 || (elt = XCHAR_TABLE (elt)->contents[c2], |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
244 NILP (elt))) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
245 return defalt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
246 return elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
247 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
248 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
249 |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
250 static Lisp_Object |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
251 lookup_overriding_fontspec (frame, c) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
252 Lisp_Object frame; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
253 int c; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
254 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
255 Lisp_Object tail; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
256 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
257 for (tail = Voverriding_fontspec_alist; CONSP (tail); tail = XCDR (tail)) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
258 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
259 Lisp_Object val, target, elt; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
260 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
261 val = XCAR (tail); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
262 target = XCAR (val); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
263 val = XCDR (val); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
264 /* Now VAL is (NO-FRAME-LIST OK-FRAME-LIST CHAR FONTNAME). */ |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
265 if (NILP (Fmemq (frame, XCAR (val))) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
266 && (CHAR_TABLE_P (target) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
267 ? ! NILP (CHAR_TABLE_REF (target, c)) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
268 : XINT (target) == CHAR_CHARSET (c))) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
269 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
270 val = XCDR (val); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
271 elt = XCDR (val); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
272 if (NILP (Fmemq (frame, XCAR (val)))) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
273 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
274 if (! face_font_available_p (XFRAME (frame), XCDR (elt))) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
275 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
276 val = XCDR (XCAR (tail)); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
277 XSETCAR (val, Fcons (frame, XCAR (val))); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
278 continue; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
279 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
280 XSETCAR (val, Fcons (frame, XCAR (val))); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
281 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
282 if (NILP (XCAR (elt))) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
283 XSETCAR (elt, make_number (c)); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
284 return elt; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
285 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
286 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
287 return Qnil; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
288 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
289 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
290 #define FONTSET_REF_VIA_BASE(fontset, c) fontset_ref_via_base (fontset, &c) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
291 |
30398
dde5ab185aad
(fontset_ref): Remove INLINE declaration.
Kenichi Handa <handa@m17n.org>
parents:
30172
diff
changeset
|
292 static Lisp_Object |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
293 fontset_ref_via_base (fontset, c) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
294 Lisp_Object fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
295 int *c; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
296 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
297 int charset, c1, c2; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
298 Lisp_Object elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
299 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
300 if (SINGLE_BYTE_CHAR_P (*c)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
301 return FONTSET_ASCII (fontset); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
302 |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
303 elt = Qnil; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
304 if (! EQ (FONTSET_BASE (fontset), Vdefault_fontset)) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
305 elt = FONTSET_REF (FONTSET_BASE (fontset), *c); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
306 if (NILP (elt)) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
307 elt = lookup_overriding_fontspec (FONTSET_FRAME (fontset), *c); |
53524
ccddf8ef9113
(fontset_ref_via_base): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents:
53353
diff
changeset
|
308 if (NILP (elt)) |
29767
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
309 elt = FONTSET_REF (Vdefault_fontset, *c); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
310 if (NILP (elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
311 return Qnil; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
312 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
313 *c = XINT (XCAR (elt)); |
29011
b60861d6c1e0
(fontset_ref): Use SPLIT_CHAR instead of
Kenichi Handa <handa@m17n.org>
parents:
28971
diff
changeset
|
314 SPLIT_CHAR (*c, charset, c1, c2); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
315 elt = XCHAR_TABLE (fontset)->contents[charset + 128]; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
316 if (c1 < 32) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
317 return (SUB_CHAR_TABLE_P (elt) ? XCHAR_TABLE (elt)->defalt : elt); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
318 if (!SUB_CHAR_TABLE_P (elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
319 return Qnil; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
320 elt = XCHAR_TABLE (elt)->contents[c1]; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
321 if (c2 < 32) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
322 return (SUB_CHAR_TABLE_P (elt) ? XCHAR_TABLE (elt)->defalt : elt); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
323 if (!SUB_CHAR_TABLE_P (elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
324 return Qnil; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
325 elt = XCHAR_TABLE (elt)->contents[c2]; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
326 return elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
327 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
328 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
329 |
30398
dde5ab185aad
(fontset_ref): Remove INLINE declaration.
Kenichi Handa <handa@m17n.org>
parents:
30172
diff
changeset
|
330 /* Store into the element of FONTSET at index C the value NEWELT. */ |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
331 #define FONTSET_SET(fontset, c, newelt) fontset_set(fontset, c, newelt) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
332 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
333 static void |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
334 fontset_set (fontset, c, newelt) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
335 Lisp_Object fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
336 int c; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
337 Lisp_Object newelt; |
17052 | 338 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
339 int charset, code[3]; |
34975
0d69e2d2724e
(fontset_ref): Remove unused variable `i'.
Eli Zaretskii <eliz@gnu.org>
parents:
32978
diff
changeset
|
340 Lisp_Object *elt; |
0d69e2d2724e
(fontset_ref): Remove unused variable `i'.
Eli Zaretskii <eliz@gnu.org>
parents:
32978
diff
changeset
|
341 int i; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
342 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
343 if (SINGLE_BYTE_CHAR_P (c)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
344 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
345 FONTSET_ASCII (fontset) = newelt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
346 return; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
347 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
348 |
29011
b60861d6c1e0
(fontset_ref): Use SPLIT_CHAR instead of
Kenichi Handa <handa@m17n.org>
parents:
28971
diff
changeset
|
349 SPLIT_CHAR (c, charset, code[0], code[1]); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
350 code[2] = 0; /* anchor */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
351 elt = &XCHAR_TABLE (fontset)->contents[charset + 128]; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
352 for (i = 0; code[i] > 0; i++) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
353 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
354 if (!SUB_CHAR_TABLE_P (*elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
355 *elt = make_sub_char_table (*elt); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
356 elt = &XCHAR_TABLE (*elt)->contents[code[i]]; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
357 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
358 if (SUB_CHAR_TABLE_P (*elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
359 XCHAR_TABLE (*elt)->defalt = newelt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
360 else |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
361 *elt = newelt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
362 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
363 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
364 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
365 /* Return a newly created fontset with NAME. If BASE is nil, make a |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
366 base fontset. Otherwise make a realized fontset whose parent is |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
367 BASE. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
368 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
369 static Lisp_Object |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
370 make_fontset (frame, name, base) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
371 Lisp_Object frame, name, base; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
372 { |
34975
0d69e2d2724e
(fontset_ref): Remove unused variable `i'.
Eli Zaretskii <eliz@gnu.org>
parents:
32978
diff
changeset
|
373 Lisp_Object fontset; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
374 int size = ASIZE (Vfontset_table); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
375 int id = next_fontset_id; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
376 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
377 /* Find a free slot in Vfontset_table. Usually, next_fontset_id is |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
378 the next available fontset ID. So it is expected that this loop |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
379 terminates quickly. In addition, as the last element of |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
380 Vfontset_table is always nil, we don't have to check the range of |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
381 id. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
382 while (!NILP (AREF (Vfontset_table, id))) id++; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
383 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
384 if (id + 1 == size) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
385 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
386 Lisp_Object tem; |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
387 int i; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
388 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
389 tem = Fmake_vector (make_number (size + 8), Qnil); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
390 for (i = 0; i < size; i++) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
391 AREF (tem, i) = AREF (Vfontset_table, i); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
392 Vfontset_table = tem; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
393 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
394 |
29767
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
395 fontset = Fmake_char_table (Qfontset, Qnil); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
396 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
397 FONTSET_ID (fontset) = make_number (id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
398 FONTSET_NAME (fontset) = name; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
399 FONTSET_FRAME (fontset) = frame; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
400 FONTSET_BASE (fontset) = base; |
17052 | 401 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
402 AREF (Vfontset_table, id) = fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
403 next_fontset_id = id + 1; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
404 return fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
405 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
406 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
407 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
408 /* Return 1 if ID is a valid fontset id, else return 0. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
409 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
410 static INLINE int |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
411 fontset_id_valid_p (id) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
412 int id; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
413 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
414 return (id >= 0 && id < ASIZE (Vfontset_table) - 1); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
415 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
416 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
417 |
35658
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
418 /* Extract `family' and `registry' string from FONTNAME and a cons of |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
419 them. Actually, `family' may also contain `foundry', `registry' |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
420 may also contain `encoding' of FONTNAME. But, if FONTNAME doesn't |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
421 conform to XLFD nor explicitely specifies the other fields |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
422 (i.e. not using wildcard `*'), return FONTNAME. If FORCE is |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
423 nonzero, specifications of the other fields are ignored, and return |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
424 a cons as far as FONTNAME conform to XLFD. */ |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
425 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
426 static Lisp_Object |
35658
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
427 font_family_registry (fontname, force) |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
428 Lisp_Object fontname; |
35658
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
429 int force; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
430 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
431 Lisp_Object family, registry; |
46466
9629aca792bb
(font_family_registry, fs_query_fontset):
Ken Raeburn <raeburn@raeburn.org>
parents:
46440
diff
changeset
|
432 const char *p = SDATA (fontname); |
9629aca792bb
(font_family_registry, fs_query_fontset):
Ken Raeburn <raeburn@raeburn.org>
parents:
46440
diff
changeset
|
433 const char *sep[15]; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
434 int i = 0; |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
435 |
35658
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
436 while (*p && i < 15) |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
437 if (*p++ == '-') |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
438 { |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
439 if (!force && i >= 2 && i <= 11 && *p != '*' && p[1] != '-') |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
440 return fontname; |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
441 sep[i++] = p; |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
442 } |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
443 if (i != 14) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
444 return fontname; |
17052 | 445 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
446 family = make_unibyte_string (sep[0], sep[2] - 1 - sep[0]); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
447 registry = make_unibyte_string (sep[12], p - sep[12]); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
448 return Fcons (family, registry); |
17052 | 449 } |
450 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
451 |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
452 /********** INTERFACES TO xfaces.c and dispextern.h **********/ |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
453 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
454 /* Return name of the fontset with ID. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
455 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
456 Lisp_Object |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
457 fontset_name (id) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
458 int id; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
459 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
460 Lisp_Object fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
461 fontset = FONTSET_FROM_ID (id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
462 return FONTSET_NAME (fontset); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
463 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
464 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
465 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
466 /* Return ASCII font name of the fontset with ID. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
467 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
468 Lisp_Object |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
469 fontset_ascii (id) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
470 int id; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
471 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
472 Lisp_Object fontset, elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
473 fontset= FONTSET_FROM_ID (id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
474 elt = FONTSET_ASCII (fontset); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
475 return XCDR (elt); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
476 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
477 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
478 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
479 /* Free fontset of FACE. Called from free_realized_face. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
480 |
17052 | 481 void |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
482 free_face_fontset (f, face) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
483 FRAME_PTR f; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
484 struct face *face; |
17052 | 485 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
486 if (fontset_id_valid_p (face->fontset)) |
17052 | 487 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
488 AREF (Vfontset_table, face->fontset) = Qnil; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
489 if (face->fontset < next_fontset_id) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
490 next_fontset_id = face->fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
491 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
492 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
493 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
494 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
495 /* Return 1 iff FACE is suitable for displaying character C. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
496 Otherwise return 0. Called from the macro FACE_SUITABLE_FOR_CHAR_P |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
497 when C is not a single byte character.. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
498 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
499 int |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
500 face_suitable_for_char_p (face, c) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
501 struct face *face; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
502 int c; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
503 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
504 Lisp_Object fontset, elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
505 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
506 if (SINGLE_BYTE_CHAR_P (c)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
507 return (face == face->ascii_face); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
508 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
509 xassert (fontset_id_valid_p (face->fontset)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
510 fontset = FONTSET_FROM_ID (face->fontset); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
511 xassert (!BASE_FONTSET_P (fontset)); |
17052 | 512 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
513 elt = FONTSET_REF_VIA_BASE (fontset, c); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
514 return (!NILP (elt) && face->id == XFASTINT (elt)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
515 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
516 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
517 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
518 /* Return ID of face suitable for displaying character C on frame F. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
519 The selection of face is done based on the fontset of FACE. FACE |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
520 should already have been realized for ASCII characters. Called |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
521 from the macro FACE_FOR_CHAR when C is not a single byte character. */ |
17052 | 522 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
523 int |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
524 face_for_char (f, face, c) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
525 FRAME_PTR f; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
526 struct face *face; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
527 int c; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
528 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
529 Lisp_Object fontset, elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
530 int face_id; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
531 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
532 xassert (fontset_id_valid_p (face->fontset)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
533 fontset = FONTSET_FROM_ID (face->fontset); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
534 xassert (!BASE_FONTSET_P (fontset)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
535 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
536 elt = FONTSET_REF_VIA_BASE (fontset, c); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
537 if (!NILP (elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
538 return XINT (elt); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
539 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
540 /* No face is recorded for C in the fontset of FACE. Make a new |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
541 realized face for C that has the same fontset. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
542 face_id = lookup_face (f, face->lface, c, face); |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
543 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
544 /* Record the face ID in FONTSET at the same index as the |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
545 information in the base fontset. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
546 FONTSET_SET (fontset, c, make_number (face_id)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
547 return face_id; |
17052 | 548 } |
549 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
550 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
551 /* Make a realized fontset for ASCII face FACE on frame F from the |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
552 base fontset BASE_FONTSET_ID. If BASE_FONTSET_ID is -1, use the |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
553 default fontset as the base. Value is the id of the new fontset. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
554 Called from realize_x_face. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
555 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
556 int |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
557 make_fontset_for_ascii_face (f, base_fontset_id) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
558 FRAME_PTR f; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
559 int base_fontset_id; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
560 { |
34975
0d69e2d2724e
(fontset_ref): Remove unused variable `i'.
Eli Zaretskii <eliz@gnu.org>
parents:
32978
diff
changeset
|
561 Lisp_Object base_fontset, fontset, frame; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
562 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
563 XSETFRAME (frame, f); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
564 if (base_fontset_id >= 0) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
565 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
566 base_fontset = FONTSET_FROM_ID (base_fontset_id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
567 if (!BASE_FONTSET_P (base_fontset)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
568 base_fontset = FONTSET_BASE (base_fontset); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
569 xassert (BASE_FONTSET_P (base_fontset)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
570 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
571 else |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
572 base_fontset = Vdefault_fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
573 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
574 fontset = make_fontset (frame, Qnil, base_fontset); |
28511
7a9707590ccd
(make_fontset_for_ascii_face): Use XINT on return value.
Ken Raeburn <raeburn@raeburn.org>
parents:
28241
diff
changeset
|
575 return XINT (FONTSET_ID (fontset)); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
576 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
577 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
578 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
579 /* Return the font name pattern for C that is recorded in the fontset |
35658
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
580 with ID. If a font name pattern is specified (instead of a cons of |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
581 family and registry), check if a font can be opened by that pattern |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
582 to get the fullname. If a font is opened, return that name. |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
583 Otherwise, return nil. If ID is -1, or the fontset doesn't contain |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
584 information about C, get the registry and encoding of C from the |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
585 default fontset. Called from choose_face_font. */ |
18346
c46e9f750033
(font_idx_temp): New temprary variable used in FS_LOAD_FONT.
Kenichi Handa <handa@m17n.org>
parents:
18341
diff
changeset
|
586 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
587 Lisp_Object |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
588 fontset_font_pattern (f, id, c) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
589 FRAME_PTR f; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
590 int id, c; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
591 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
592 Lisp_Object fontset, elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
593 struct font_info *fontp; |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
594 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
595 elt = Qnil; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
596 if (fontset_id_valid_p (id)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
597 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
598 fontset = FONTSET_FROM_ID (id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
599 xassert (!BASE_FONTSET_P (fontset)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
600 fontset = FONTSET_BASE (fontset); |
53622
5aba50936662
(fontset_font_pattern): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents:
53524
diff
changeset
|
601 if (! EQ (fontset, Vdefault_fontset)) |
5aba50936662
(fontset_font_pattern): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents:
53524
diff
changeset
|
602 elt = FONTSET_REF (fontset, c); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
603 } |
29767
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
604 if (NILP (elt)) |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
605 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
606 Lisp_Object frame; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
607 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
608 XSETFRAME (frame, f); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
609 elt = lookup_overriding_fontspec (frame, c); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
610 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
611 if (NILP (elt)) |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
612 elt = FONTSET_REF (Vdefault_fontset, c); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
613 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
614 if (!CONSP (elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
615 return Qnil; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
616 if (CONSP (XCDR (elt))) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
617 return XCDR (elt); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
618 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
619 /* The fontset specifies only a font name pattern (not cons of |
35658
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
620 family and registry). If a font can be opened by that pattern, |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
621 return the name of opened font. Otherwise return nil. The |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
622 exception is a font for single byte characters. In that case, we |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
623 return a cons of FAMILY and REGISTRY extracted from the opened |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
624 font name. */ |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
625 elt = XCDR (elt); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
626 xassert (STRINGP (elt)); |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
627 fontp = FS_LOAD_FONT (f, c, SDATA (elt), -1); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
628 if (!fontp) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
629 return Qnil; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
630 |
35658
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
631 return font_family_registry (build_string (fontp->full_name), |
3551e8549d4e
(font_family_registry): Even if FONTNAME conform to
Kenichi Handa <handa@m17n.org>
parents:
34975
diff
changeset
|
632 SINGLE_BYTE_CHAR_P (c)); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
633 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
634 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
635 |
40028
392c2fe9edd7
(fs_load_font) [WINDOWSNT && _MSC_VER]: Disable
Andrew Innes <andrewi@gnu.org>
parents:
39973
diff
changeset
|
636 #if defined(WINDOWSNT) && defined (_MSC_VER) |
392c2fe9edd7
(fs_load_font) [WINDOWSNT && _MSC_VER]: Disable
Andrew Innes <andrewi@gnu.org>
parents:
39973
diff
changeset
|
637 #pragma optimize("", off) |
392c2fe9edd7
(fs_load_font) [WINDOWSNT && _MSC_VER]: Disable
Andrew Innes <andrewi@gnu.org>
parents:
39973
diff
changeset
|
638 #endif |
392c2fe9edd7
(fs_load_font) [WINDOWSNT && _MSC_VER]: Disable
Andrew Innes <andrewi@gnu.org>
parents:
39973
diff
changeset
|
639 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
640 /* Load a font named FONTNAME to display character C on frame F. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
641 Return a pointer to the struct font_info of the loaded font. If |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
642 loading fails, return NULL. If FACE is non-zero and a fontset is |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
643 assigned to it, record FACE->id in the fontset for C. If FONTNAME |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
644 is NULL, the name is taken from the fontset of FACE or what |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
645 specified by ID. */ |
17052 | 646 |
647 struct font_info * | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
648 fs_load_font (f, c, fontname, id, face) |
17052 | 649 FRAME_PTR f; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
650 int c; |
17052 | 651 char *fontname; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
652 int id; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
653 struct face *face; |
17052 | 654 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
655 Lisp_Object fontset; |
17052 | 656 Lisp_Object list, elt; |
657 int size = 0; | |
658 struct font_info *fontp; | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
659 int charset = CHAR_CHARSET (c); |
17052 | 660 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
661 if (face) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
662 id = face->fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
663 if (id < 0) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
664 fontset = Qnil; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
665 else |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
666 fontset = FONTSET_FROM_ID (id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
667 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
668 if (!NILP (fontset) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
669 && !BASE_FONTSET_P (fontset)) |
17052 | 670 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
671 elt = FONTSET_REF_VIA_BASE (fontset, c); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
672 if (!NILP (elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
673 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
674 /* A suitable face for C is already recorded, which means |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
675 that a proper font is already loaded. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
676 int face_id = XINT (elt); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
677 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
678 xassert (face_id == face->id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
679 face = FACE_FROM_ID (f, face_id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
680 return (*get_font_info_func) (f, face->font_info_id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
681 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
682 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
683 if (!fontname && charset == CHARSET_ASCII) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
684 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
685 elt = FONTSET_ASCII (fontset); |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
686 fontname = SDATA (XCDR (elt)); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
687 } |
17052 | 688 } |
689 | |
690 if (!fontname) | |
691 /* No way to get fontname. */ | |
692 return 0; | |
693 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
694 fontp = (*load_font_func) (f, fontname, size); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
695 if (!fontp) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
696 return 0; |
17052 | 697 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
698 /* Fill in members (charset, vertical_centering, encoding, etc) of |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
699 font_info structure that are not set by (*load_font_func). */ |
17052 | 700 fontp->charset = charset; |
701 | |
26858
7cc081b4e084
(Vvertical_centering_font_regexp): New variable.
Kenichi Handa <handa@m17n.org>
parents:
26164
diff
changeset
|
702 fontp->vertical_centering |
7cc081b4e084
(Vvertical_centering_font_regexp): New variable.
Kenichi Handa <handa@m17n.org>
parents:
26164
diff
changeset
|
703 = (STRINGP (Vvertical_centering_font_regexp) |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
704 && (fast_c_string_match_ignore_case |
26858
7cc081b4e084
(Vvertical_centering_font_regexp): New variable.
Kenichi Handa <handa@m17n.org>
parents:
26164
diff
changeset
|
705 (Vvertical_centering_font_regexp, fontp->full_name) >= 0)); |
7cc081b4e084
(Vvertical_centering_font_regexp): New variable.
Kenichi Handa <handa@m17n.org>
parents:
26164
diff
changeset
|
706 |
17999
5e325c8057c8
(fs_load_font): Before using a fontset, be sure to
Kenichi Handa <handa@m17n.org>
parents:
17882
diff
changeset
|
707 if (fontp->encoding[1] != FONT_ENCODING_NOT_DECIDED) |
17052 | 708 { |
709 /* The font itself tells which code points to be used. Use this | |
710 encoding for all other charsets. */ | |
711 int i; | |
712 | |
713 fontp->encoding[0] = fontp->encoding[1]; | |
17190
6637001cdb4b
Adjusted for the change of MAX_CHARSET.
Kenichi Handa <handa@m17n.org>
parents:
17112
diff
changeset
|
714 for (i = MIN_CHARSET_OFFICIAL_DIMENSION1; i <= MAX_CHARSET; i++) |
17052 | 715 fontp->encoding[i] = fontp->encoding[1]; |
716 } | |
717 else | |
718 { | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
719 /* The font itself doesn't have information about encoding. */ |
17052 | 720 int i; |
721 | |
28766
da7e00e4eaa6
(fs_load_font): By default, use 0x00..0x7f for ASCII.
Kenichi Handa <handa@m17n.org>
parents:
28676
diff
changeset
|
722 fontname = fontp->full_name; |
da7e00e4eaa6
(fs_load_font): By default, use 0x00..0x7f for ASCII.
Kenichi Handa <handa@m17n.org>
parents:
28676
diff
changeset
|
723 /* By default, encoding of ASCII chars is 0 (i.e. 0x00..0x7F), |
da7e00e4eaa6
(fs_load_font): By default, use 0x00..0x7f for ASCII.
Kenichi Handa <handa@m17n.org>
parents:
28676
diff
changeset
|
724 others is 1 (i.e. 0x80..0xFF). */ |
da7e00e4eaa6
(fs_load_font): By default, use 0x00..0x7f for ASCII.
Kenichi Handa <handa@m17n.org>
parents:
28676
diff
changeset
|
725 fontp->encoding[0] = 0; |
17190
6637001cdb4b
Adjusted for the change of MAX_CHARSET.
Kenichi Handa <handa@m17n.org>
parents:
17112
diff
changeset
|
726 for (i = MIN_CHARSET_OFFICIAL_DIMENSION1; i <= MAX_CHARSET; i++) |
17052 | 727 fontp->encoding[i] = 1; |
728 /* Then override them by a specification in Vfont_encoding_alist. */ | |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
729 for (list = Vfont_encoding_alist; CONSP (list); list = XCDR (list)) |
17052 | 730 { |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
731 elt = XCAR (list); |
17052 | 732 if (CONSP (elt) |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
733 && STRINGP (XCAR (elt)) && CONSP (XCDR (elt)) |
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
734 && (fast_c_string_match_ignore_case (XCAR (elt), fontname) |
17052 | 735 >= 0)) |
736 { | |
737 Lisp_Object tmp; | |
738 | |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
739 for (tmp = XCDR (elt); CONSP (tmp); tmp = XCDR (tmp)) |
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
740 if (CONSP (XCAR (tmp)) |
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
741 && ((i = get_charset_id (XCAR (XCAR (tmp)))) |
17052 | 742 >= 0) |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
743 && INTEGERP (XCDR (XCAR (tmp))) |
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
744 && XFASTINT (XCDR (XCAR (tmp))) < 4) |
17052 | 745 fontp->encoding[i] |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
746 = XFASTINT (XCDR (XCAR (tmp))); |
17052 | 747 } |
748 } | |
749 } | |
750 | |
52729
124a3516f4db
(fs_load_font): Don't set fontp->font_encoder to NULL
Kenichi Handa <handa@m17n.org>
parents:
52654
diff
changeset
|
751 if (! fontp->font_encoder && find_ccl_program_func) |
21553
2d7afcd11b72
(find_ccl_program_func): New variable.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
752 (*find_ccl_program_func) (fontp); |
17052 | 753 |
28963 | 754 /* If we loaded a font for a face that has fontset, record the face |
755 ID in the fontset for C. */ | |
756 if (face | |
757 && !NILP (fontset) | |
758 && !BASE_FONTSET_P (fontset)) | |
759 FONTSET_SET (fontset, c, make_number (face->id)); | |
17052 | 760 return fontp; |
761 } | |
762 | |
40028
392c2fe9edd7
(fs_load_font) [WINDOWSNT && _MSC_VER]: Disable
Andrew Innes <andrewi@gnu.org>
parents:
39973
diff
changeset
|
763 #if defined(WINDOWSNT) && defined (_MSC_VER) |
392c2fe9edd7
(fs_load_font) [WINDOWSNT && _MSC_VER]: Disable
Andrew Innes <andrewi@gnu.org>
parents:
39973
diff
changeset
|
764 #pragma optimize("", on) |
392c2fe9edd7
(fs_load_font) [WINDOWSNT && _MSC_VER]: Disable
Andrew Innes <andrewi@gnu.org>
parents:
39973
diff
changeset
|
765 #endif |
392c2fe9edd7
(fs_load_font) [WINDOWSNT && _MSC_VER]: Disable
Andrew Innes <andrewi@gnu.org>
parents:
39973
diff
changeset
|
766 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
767 |
17052 | 768 /* Cache data used by fontset_pattern_regexp. The car part is a |
769 pattern string containing at least one wild card, the cdr part is | |
770 the corresponding regular expression. */ | |
771 static Lisp_Object Vcached_fontset_data; | |
772 | |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
773 #define CACHED_FONTSET_NAME (SDATA (XCAR (Vcached_fontset_data))) |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
774 #define CACHED_FONTSET_REGEX (XCDR (Vcached_fontset_data)) |
17052 | 775 |
776 /* If fontset name PATTERN contains any wild card, return regular | |
777 expression corresponding to PATTERN. */ | |
778 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
779 static Lisp_Object |
17052 | 780 fontset_pattern_regexp (pattern) |
781 Lisp_Object pattern; | |
782 { | |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
783 if (!index (SDATA (pattern), '*') |
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
784 && !index (SDATA (pattern), '?')) |
17052 | 785 /* PATTERN does not contain any wild cards. */ |
17730
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
786 return Qnil; |
17052 | 787 |
788 if (!CONSP (Vcached_fontset_data) | |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
789 || strcmp (SDATA (pattern), CACHED_FONTSET_NAME)) |
17052 | 790 { |
791 /* We must at first update the cached data. */ | |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
792 char *regex = (char *) alloca (SCHARS (pattern) * 2 + 3); |
17052 | 793 char *p0, *p1 = regex; |
794 | |
17730
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
795 /* Convert "*" to ".*", "?" to ".". */ |
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
796 *p1++ = '^'; |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
797 for (p0 = (char *) SDATA (pattern); *p0; p0++) |
17052 | 798 { |
17730
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
799 if (*p0 == '*') |
17052 | 800 { |
17730
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
801 *p1++ = '.'; |
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
802 *p1++ = '*'; |
17052 | 803 } |
17730
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
804 else if (*p0 == '?') |
21127
577865651099
(fontset_pattern_regexp): `==' was used instead of `='.
Richard M. Stallman <rms@gnu.org>
parents:
20346
diff
changeset
|
805 *p1++ = '.'; |
17730
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
806 else |
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
807 *p1++ = *p0; |
17052 | 808 } |
809 *p1++ = '$'; | |
810 *p1++ = 0; | |
811 | |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
812 Vcached_fontset_data = Fcons (build_string (SDATA (pattern)), |
17052 | 813 build_string (regex)); |
814 } | |
815 | |
816 return CACHED_FONTSET_REGEX; | |
817 } | |
818 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
819 /* Return ID of the base fontset named NAME. If there's no such |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
820 fontset, return -1. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
821 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
822 int |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
823 fs_query_fontset (name, regexpp) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
824 Lisp_Object name; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
825 int regexpp; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
826 { |
34975
0d69e2d2724e
(fontset_ref): Remove unused variable `i'.
Eli Zaretskii <eliz@gnu.org>
parents:
32978
diff
changeset
|
827 Lisp_Object tem; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
828 int i; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
829 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
830 name = Fdowncase (name); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
831 if (!regexpp) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
832 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
833 tem = Frassoc (name, Vfontset_alias_alist); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
834 if (CONSP (tem) && STRINGP (XCAR (tem))) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
835 name = XCAR (tem); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
836 else |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
837 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
838 tem = fontset_pattern_regexp (name); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
839 if (STRINGP (tem)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
840 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
841 name = tem; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
842 regexpp = 1; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
843 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
844 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
845 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
846 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
847 for (i = 0; i < ASIZE (Vfontset_table); i++) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
848 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
849 Lisp_Object fontset; |
46466
9629aca792bb
(font_family_registry, fs_query_fontset):
Ken Raeburn <raeburn@raeburn.org>
parents:
46440
diff
changeset
|
850 const unsigned char *this_name; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
851 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
852 fontset = FONTSET_FROM_ID (i); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
853 if (NILP (fontset) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
854 || !BASE_FONTSET_P (fontset)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
855 continue; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
856 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
857 this_name = SDATA (FONTSET_NAME (fontset)); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
858 if (regexpp |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
859 ? fast_c_string_match_ignore_case (name, this_name) >= 0 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
860 : !strcmp (SDATA (name), this_name)) |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
861 return i; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
862 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
863 return -1; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
864 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
865 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
866 |
21553
2d7afcd11b72
(find_ccl_program_func): New variable.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
867 DEFUN ("query-fontset", Fquery_fontset, Squery_fontset, 1, 2, 0, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
868 doc: /* Return the name of a fontset that matches PATTERN. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
869 The value is nil if there is no matching fontset. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
870 PATTERN can contain `*' or `?' as a wildcard |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
871 just as X font name matching algorithm allows. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
872 If REGEXPP is non-nil, PATTERN is a regular expression. */) |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
873 (pattern, regexpp) |
21553
2d7afcd11b72
(find_ccl_program_func): New variable.
Kenichi Handa <handa@m17n.org>
parents:
21514
diff
changeset
|
874 Lisp_Object pattern, regexpp; |
17052 | 875 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
876 Lisp_Object fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
877 int id; |
17052 | 878 |
879 (*check_window_system_func) (); | |
880 | |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
881 CHECK_STRING (pattern); |
17052 | 882 |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
883 if (SCHARS (pattern) == 0) |
17052 | 884 return Qnil; |
885 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
886 id = fs_query_fontset (pattern, !NILP (regexpp)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
887 if (id < 0) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
888 return Qnil; |
17052 | 889 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
890 fontset = FONTSET_FROM_ID (id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
891 return FONTSET_NAME (fontset); |
17052 | 892 } |
893 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
894 /* Return a list of base fontset names matching PATTERN on frame F. |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
895 If SIZE is not 0, it is the size (maximum bound width) of fontsets |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
896 to be listed. */ |
17052 | 897 |
898 Lisp_Object | |
899 list_fontsets (f, pattern, size) | |
900 FRAME_PTR f; | |
901 Lisp_Object pattern; | |
902 int size; | |
903 { | |
34975
0d69e2d2724e
(fontset_ref): Remove unused variable `i'.
Eli Zaretskii <eliz@gnu.org>
parents:
32978
diff
changeset
|
904 Lisp_Object frame, regexp, val; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
905 int id; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
906 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
907 XSETFRAME (frame, f); |
17052 | 908 |
909 regexp = fontset_pattern_regexp (pattern); | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
910 val = Qnil; |
17052 | 911 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
912 for (id = 0; id < ASIZE (Vfontset_table); id++) |
17052 | 913 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
914 Lisp_Object fontset; |
46466
9629aca792bb
(font_family_registry, fs_query_fontset):
Ken Raeburn <raeburn@raeburn.org>
parents:
46440
diff
changeset
|
915 const unsigned char *name; |
17052 | 916 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
917 fontset = FONTSET_FROM_ID (id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
918 if (NILP (fontset) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
919 || !BASE_FONTSET_P (fontset) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
920 || !EQ (frame, FONTSET_FRAME (fontset))) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
921 continue; |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
922 name = SDATA (FONTSET_NAME (fontset)); |
17052 | 923 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
924 if (!NILP (regexp) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
925 ? (fast_c_string_match_ignore_case (regexp, name) < 0) |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
926 : strcmp (SDATA (pattern), name)) |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
927 continue; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
928 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
929 if (size) |
17052 | 930 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
931 struct font_info *fontp; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
932 fontp = FS_LOAD_FONT (f, 0, NULL, id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
933 if (!fontp || size != fontp->size) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
934 continue; |
17052 | 935 } |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
936 val = Fcons (Fcopy_sequence (FONTSET_NAME (fontset)), val); |
17052 | 937 } |
938 | |
939 return val; | |
940 } | |
941 | |
942 DEFUN ("new-fontset", Fnew_fontset, Snew_fontset, 2, 2, 0, | |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
943 doc: /* Create a new fontset NAME that contains font information in FONTLIST. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
944 FONTLIST is an alist of charsets vs corresponding font name patterns. */) |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
945 (name, fontlist) |
17052 | 946 Lisp_Object name, fontlist; |
947 { | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
948 Lisp_Object fontset, elements, ascii_font; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
949 Lisp_Object tem, tail, elt; |
17052 | 950 |
951 (*check_window_system_func) (); | |
952 | |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
953 CHECK_STRING (name); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
954 CHECK_LIST (fontlist); |
17052 | 955 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
956 name = Fdowncase (name); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
957 tem = Fquery_fontset (name, Qnil); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
958 if (!NILP (tem)) |
24585
6810d6fb639f
(Fquery_fontset): Don't check for fontset aliases here.
Richard M. Stallman <rms@gnu.org>
parents:
23517
diff
changeset
|
959 error ("Fontset `%s' matches the existing fontset `%s'", |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
960 SDATA (name), SDATA (tem)); |
17052 | 961 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
962 /* Check the validity of FONTLIST while creating a template for |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
963 fontset elements. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
964 elements = ascii_font = Qnil; |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
965 for (tail = fontlist; CONSP (tail); tail = XCDR (tail)) |
17052 | 966 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
967 int c, charset; |
17052 | 968 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
969 tem = XCAR (tail); |
17052 | 970 if (!CONSP (tem) |
26164
d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
Ken Raeburn <raeburn@raeburn.org>
parents:
25668
diff
changeset
|
971 || (charset = get_charset_id (XCAR (tem))) < 0 |
36370
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
972 || (!STRINGP (XCDR (tem)) && !CONSP (XCDR (tem)))) |
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
973 error ("Elements of fontlist must be a cons of charset and font name pattern"); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
974 |
36370
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
975 tem = XCDR (tem); |
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
976 if (STRINGP (tem)) |
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
977 tem = Fdowncase (tem); |
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
978 else |
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
979 tem = Fcons (Fdowncase (Fcar (tem)), Fdowncase (Fcdr (tem))); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
980 if (charset == CHARSET_ASCII) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
981 ascii_font = tem; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
982 else |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
983 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
984 c = MAKE_CHAR (charset, 0, 0); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
985 elements = Fcons (Fcons (make_number (c), tem), elements); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
986 } |
17052 | 987 } |
988 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
989 if (NILP (ascii_font)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
990 error ("No ASCII font in the fontlist"); |
17052 | 991 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
992 fontset = make_fontset (Qnil, name, Qnil); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
993 FONTSET_ASCII (fontset) = Fcons (make_number (0), ascii_font); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
994 for (; CONSP (elements); elements = XCDR (elements)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
995 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
996 elt = XCAR (elements); |
36370
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
997 tem = XCDR (elt); |
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
998 if (STRINGP (tem)) |
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
999 tem = font_family_registry (tem, 0); |
751cb07c5f11
(Fnew_fontset): Fix handling of the case that an
Kenichi Handa <handa@m17n.org>
parents:
35663
diff
changeset
|
1000 tem = Fcons (XCAR (elt), tem); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1001 FONTSET_SET (fontset, XINT (XCAR (elt)), tem); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1002 } |
17052 | 1003 |
1004 return Qnil; | |
1005 } | |
1006 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1007 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1008 /* Clear all elements of FONTSET for multibyte characters. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1009 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1010 static void |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1011 clear_fontset_elements (fontset) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1012 Lisp_Object fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1013 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1014 int i; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1015 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1016 for (i = CHAR_TABLE_SINGLE_BYTE_SLOTS; i < CHAR_TABLE_ORDINARY_SLOTS; i++) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1017 XCHAR_TABLE (fontset)->contents[i] = Qnil; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1018 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1019 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1020 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1021 /* Check validity of NAME as a fontset name and return the |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1022 corresponding fontset. If not valid, signal an error. |
49874
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1023 If NAME is nil, return Vdefault_fontset. */ |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1024 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1025 static Lisp_Object |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1026 check_fontset_name (name) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1027 Lisp_Object name; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1028 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1029 int id; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1030 |
49874
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1031 if (EQ (name, Qnil)) |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1032 return Vdefault_fontset; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1033 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
1034 CHECK_STRING (name); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1035 id = fs_query_fontset (name, 0); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1036 if (id < 0) |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
1037 error ("Fontset `%s' does not exist", SDATA (name)); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1038 return FONTSET_FROM_ID (id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1039 } |
17052 | 1040 |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1041 /* Downcase FONTNAME or car and cdr of FONTNAME. If FONTNAME is a |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1042 string, maybe change FONTNAME to (FAMILY . REGISTRY). */ |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1043 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1044 static Lisp_Object |
54995
df451d79772b
(regularize_fontname): Renamed from regulalize_fontname.
John Paul Wallington <jpw@pobox.com>
parents:
53622
diff
changeset
|
1045 regularize_fontname (Lisp_Object fontname) |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1046 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1047 Lisp_Object family, registry; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1048 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1049 if (STRINGP (fontname)) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1050 return font_family_registry (Fdowncase (fontname), 0); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1051 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1052 CHECK_CONS (fontname); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1053 family = XCAR (fontname); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1054 registry = XCDR (fontname); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1055 if (!NILP (family)) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1056 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1057 CHECK_STRING (family); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1058 family = Fdowncase (family); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1059 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1060 if (!NILP (registry)) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1061 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1062 CHECK_STRING (registry); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1063 registry = Fdowncase (registry); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1064 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1065 return Fcons (family, registry); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1066 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1067 |
49884
6e26943fda98
*** empty log message ***
Juanma Barranquero <lekktu@gmail.com>
parents:
49881
diff
changeset
|
1068 DEFUN ("set-fontset-font", Fset_fontset_font, Sset_fontset_font, 3, 4, 0, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1069 doc: /* Modify fontset NAME to use FONTNAME for CHARACTER. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1070 |
49881
95289e554702
(Fset_fontset_font): Document that NAME nil means the default
Kenichi Handa <handa@m17n.org>
parents:
49874
diff
changeset
|
1071 If NAME is nil, modify the default fontset. |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1072 CHARACTER may be a cons; (FROM . TO), where FROM and TO are |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1073 non-generic characters. In that case, use FONTNAME |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1074 for all characters in the range FROM and TO (inclusive). |
47277
8a4e82b00f6f
(Fset_fontset_font): Fix spacing.
Juanma Barranquero <lekktu@gmail.com>
parents:
46466
diff
changeset
|
1075 CHARACTER may be a charset. In that case, use FONTNAME |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1076 for all character in the charsets. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1077 |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1078 FONTNAME may be a cons; (FAMILY . REGISTRY), where FAMILY is a family |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
1079 name of a font, REGISTRY is a registry name of a font. */) |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1080 (name, character, fontname, frame) |
28676
0a677c35ad99
(Fset_fontset_font): Fix docstring. Local variable
Kenichi Handa <handa@m17n.org>
parents:
28511
diff
changeset
|
1081 Lisp_Object name, character, fontname, frame; |
17052 | 1082 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1083 Lisp_Object fontset, elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1084 Lisp_Object realized; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1085 int from, to; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1086 int id; |
29233
a09ee5c15dcb
(check_registry_encoding): This function deleted.
Kenichi Handa <handa@m17n.org>
parents:
29231
diff
changeset
|
1087 Lisp_Object family, registry; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1088 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1089 fontset = check_fontset_name (name); |
17052 | 1090 |
28676
0a677c35ad99
(Fset_fontset_font): Fix docstring. Local variable
Kenichi Handa <handa@m17n.org>
parents:
28511
diff
changeset
|
1091 if (CONSP (character)) |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1092 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1093 /* CH should be (FROM . TO) where FROM and TO are non-generic |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1094 characters. */ |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
1095 CHECK_NUMBER_CAR (character); |
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
1096 CHECK_NUMBER_CDR (character); |
28676
0a677c35ad99
(Fset_fontset_font): Fix docstring. Local variable
Kenichi Handa <handa@m17n.org>
parents:
28511
diff
changeset
|
1097 from = XINT (XCAR (character)); |
0a677c35ad99
(Fset_fontset_font): Fix docstring. Local variable
Kenichi Handa <handa@m17n.org>
parents:
28511
diff
changeset
|
1098 to = XINT (XCDR (character)); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1099 if (!char_valid_p (from, 0) || !char_valid_p (to, 0)) |
53072
8787289602d1
Remove period at end of error message.
Jan Djärv <jan.h.d@swipnet.se>
parents:
52729
diff
changeset
|
1100 error ("Character range should be by non-generic characters"); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1101 if (!NILP (name) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1102 && (SINGLE_BYTE_CHAR_P (from) || SINGLE_BYTE_CHAR_P (to))) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1103 error ("Can't change font for a single byte character"); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1104 } |
29501
f901ec87b147
(Fset_fontset_font): The arg CHARACTER may be a charset.
Kenichi Handa <handa@m17n.org>
parents:
29233
diff
changeset
|
1105 else if (SYMBOLP (character)) |
f901ec87b147
(Fset_fontset_font): The arg CHARACTER may be a charset.
Kenichi Handa <handa@m17n.org>
parents:
29233
diff
changeset
|
1106 { |
f901ec87b147
(Fset_fontset_font): The arg CHARACTER may be a charset.
Kenichi Handa <handa@m17n.org>
parents:
29233
diff
changeset
|
1107 elt = Fget (character, Qcharset); |
f901ec87b147
(Fset_fontset_font): The arg CHARACTER may be a charset.
Kenichi Handa <handa@m17n.org>
parents:
29233
diff
changeset
|
1108 if (!VECTORP (elt) || ASIZE (elt) < 1 || !NATNUMP (AREF (elt, 0))) |
46440
dd231f1390d2
(Fset_fontset_font): Use SDATA instead of XSTRING()->data.
Ken Raeburn <raeburn@raeburn.org>
parents:
46370
diff
changeset
|
1109 error ("Invalid charset: %s", SDATA (SYMBOL_NAME (character))); |
29501
f901ec87b147
(Fset_fontset_font): The arg CHARACTER may be a charset.
Kenichi Handa <handa@m17n.org>
parents:
29233
diff
changeset
|
1110 from = MAKE_CHAR (XINT (AREF (elt, 0)), 0, 0); |
f901ec87b147
(Fset_fontset_font): The arg CHARACTER may be a charset.
Kenichi Handa <handa@m17n.org>
parents:
29233
diff
changeset
|
1111 to = from; |
f901ec87b147
(Fset_fontset_font): The arg CHARACTER may be a charset.
Kenichi Handa <handa@m17n.org>
parents:
29233
diff
changeset
|
1112 } |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1113 else |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1114 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
1115 CHECK_NUMBER (character); |
28676
0a677c35ad99
(Fset_fontset_font): Fix docstring. Local variable
Kenichi Handa <handa@m17n.org>
parents:
28511
diff
changeset
|
1116 from = XINT (character); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1117 to = from; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1118 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1119 if (!char_valid_p (from, 1)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1120 invalid_character (from); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1121 if (SINGLE_BYTE_CHAR_P (from)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1122 error ("Can't change font for a single byte character"); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1123 if (from < to) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1124 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1125 if (!char_valid_p (to, 1)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1126 invalid_character (to); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1127 if (SINGLE_BYTE_CHAR_P (to)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1128 error ("Can't change font for a single byte character"); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1129 } |
17052 | 1130 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1131 /* The arg FRAME is kept for backward compatibility. We only check |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1132 the validity. */ |
17052 | 1133 if (!NILP (frame)) |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
1134 CHECK_LIVE_FRAME (frame); |
17052 | 1135 |
54995
df451d79772b
(regularize_fontname): Renamed from regulalize_fontname.
John Paul Wallington <jpw@pobox.com>
parents:
53622
diff
changeset
|
1136 elt = Fcons (make_number (from), regularize_fontname (fontname)); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1137 for (; from <= to; from++) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1138 FONTSET_SET (fontset, from, elt); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1139 Foptimize_char_table (fontset); |
17052 | 1140 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1141 /* If there's a realized fontset REALIZED whose parent is FONTSET, |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1142 clear all the elements of REALIZED and free all multibyte faces |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1143 whose fontset is REALIZED. This way, the specified character(s) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1144 are surely redisplayed by a correct font. */ |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1145 for (id = 0; id < ASIZE (Vfontset_table); id++) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1146 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1147 realized = AREF (Vfontset_table, id); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1148 if (!NILP (realized) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1149 && !BASE_FONTSET_P (realized) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1150 && EQ (FONTSET_BASE (realized), fontset)) |
17052 | 1151 { |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1152 FRAME_PTR f = XFRAME (FONTSET_FRAME (realized)); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1153 clear_fontset_elements (realized); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1154 free_realized_multibyte_face (f, id); |
17052 | 1155 } |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1156 } |
17052 | 1157 |
1158 return Qnil; | |
1159 } | |
1160 | |
1161 DEFUN ("font-info", Ffont_info, Sfont_info, 1, 2, 0, | |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1162 doc: /* Return information about a font named NAME on frame FRAME. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1163 If FRAME is omitted or nil, use the selected frame. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1164 The returned value is a vector of OPENED-NAME, FULL-NAME, CHARSET, SIZE, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1165 HEIGHT, BASELINE-OFFSET, RELATIVE-COMPOSE, and DEFAULT-ASCENT, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1166 where |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1167 OPENED-NAME is the name used for opening the font, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1168 FULL-NAME is the full name of the font, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1169 SIZE is the maximum bound width of the font, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1170 HEIGHT is the height of the font, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1171 BASELINE-OFFSET is the upward offset pixels from ASCII baseline, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1172 RELATIVE-COMPOSE and DEFAULT-ASCENT are the numbers controlling |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1173 how to compose characters. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1174 If the named font is not yet loaded, return nil. */) |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1175 (name, frame) |
17052 | 1176 Lisp_Object name, frame; |
1177 { | |
1178 FRAME_PTR f; | |
1179 struct font_info *fontp; | |
1180 Lisp_Object info; | |
1181 | |
1182 (*check_window_system_func) (); | |
1183 | |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
1184 CHECK_STRING (name); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1185 name = Fdowncase (name); |
17052 | 1186 if (NILP (frame)) |
25668
99290b59352d
(Ffont_info): Change for Lisp_Object selected_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
24611
diff
changeset
|
1187 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
1188 CHECK_LIVE_FRAME (frame); |
25668
99290b59352d
(Ffont_info): Change for Lisp_Object selected_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
24611
diff
changeset
|
1189 f = XFRAME (frame); |
17052 | 1190 |
1191 if (!query_font_func) | |
1192 error ("Font query function is not supported"); | |
1193 | |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
1194 fontp = (*query_font_func) (f, SDATA (name)); |
17052 | 1195 if (!fontp) |
1196 return Qnil; | |
1197 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1198 info = Fmake_vector (make_number (7), Qnil); |
17052 | 1199 |
1200 XVECTOR (info)->contents[0] = build_string (fontp->name); | |
1201 XVECTOR (info)->contents[1] = build_string (fontp->full_name); | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1202 XVECTOR (info)->contents[2] = make_number (fontp->size); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1203 XVECTOR (info)->contents[3] = make_number (fontp->height); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1204 XVECTOR (info)->contents[4] = make_number (fontp->baseline_offset); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1205 XVECTOR (info)->contents[5] = make_number (fontp->relative_compose); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1206 XVECTOR (info)->contents[6] = make_number (fontp->default_ascent); |
17052 | 1207 |
1208 return info; | |
1209 } | |
1210 | |
28963 | 1211 |
52654
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1212 /* Return a cons (FONT-NAME . GLYPH-CODE). |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1213 FONT-NAME is the font name for the character at POSITION in the current |
28963 | 1214 buffer. This is computed from all the text properties and overlays |
55094
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1215 that apply to POSITION. POSTION may be nil, in which case, |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1216 FONT-NAME is the font name for display the character CH with the |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1217 default face. |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1218 |
52654
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1219 GLYPH-CODE is the glyph code in the font to use for the character. |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1220 |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1221 If the 2nd optional arg CH is non-nil, it is a character to check |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1222 the font instead of the character at POSITION. |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1223 |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1224 It returns nil in the following cases: |
28963 | 1225 |
1226 (1) The window system doesn't have a font for the character (thus | |
1227 it is displayed by an empty box). | |
1228 | |
1229 (2) The character code is invalid. | |
1230 | |
55094
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1231 (3) If POSITION is not nil, and the current buffer is not displayed |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1232 in any window. |
28963 | 1233 |
1234 In addition, the returned font name may not take into account of | |
1235 such redisplay engine hooks as what used in jit-lock-mode if | |
1236 POSITION is currently not visible. */ | |
1237 | |
1238 | |
52654
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1239 DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1240 doc: /* For internal use only. */) |
52654
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1241 (position, ch) |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1242 Lisp_Object position, ch; |
28963 | 1243 { |
1244 int pos, pos_byte, dummy; | |
1245 int face_id; | |
52654
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1246 int c, code; |
28963 | 1247 struct frame *f; |
1248 struct face *face; | |
1249 | |
55094
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1250 if (NILP (position)) |
52654
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1251 { |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1252 CHECK_NATNUM (ch); |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1253 c = XINT (ch); |
55094
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1254 f = XFRAME (selected_frame); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1255 face_id = DEFAULT_FACE_ID; |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1256 } |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1257 else |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1258 { |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1259 Lisp_Object window; |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1260 struct window *w; |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1261 |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1262 CHECK_NUMBER_COERCE_MARKER (position); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1263 pos = XINT (position); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1264 if (pos < BEGV || pos >= ZV) |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1265 args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1266 pos_byte = CHAR_TO_BYTE (pos); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1267 if (NILP (ch)) |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1268 c = FETCH_CHAR (pos_byte); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1269 else |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1270 { |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1271 CHECK_NATNUM (ch); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1272 c = XINT (ch); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1273 } |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1274 window = Fget_buffer_window (Fcurrent_buffer (), Qnil); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1275 if (NILP (window)) |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1276 return Qnil; |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1277 w = XWINDOW (window); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1278 f = XFRAME (w->frame); |
450b41d3c078
(Finternal_char_font): If POSITION is nil, return
Kenichi Handa <handa@m17n.org>
parents:
54995
diff
changeset
|
1279 face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0); |
52654
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1280 } |
28963 | 1281 if (! CHAR_VALID_P (c, 0)) |
1282 return Qnil; | |
1283 face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c); | |
1284 face = FACE_FROM_ID (f, face_id); | |
52654
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1285 if (! face->font || ! face->font_name) |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1286 return Qnil; |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1287 |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1288 { |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1289 struct font_info *fontp = (*get_font_info_func) (f, face->font_info_id); |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1290 XChar2b char2b; |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1291 int c1, c2, charset; |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1292 |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1293 SPLIT_CHAR (c, charset, c1, c2); |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1294 if (c2 > 0) |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1295 STORE_XCHAR2B (&char2b, c1, c2); |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1296 else |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1297 STORE_XCHAR2B (&char2b, 0, c1); |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1298 rif->encode_char (c, &char2b, fontp, NULL); |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1299 code = (XCHAR2B_BYTE1 (&char2b) << 8) | XCHAR2B_BYTE2 (&char2b); |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1300 } |
2e5944e29aa0
(Finternal_char_font): Change return value to
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
1301 return Fcons (build_string (face->font_name), make_number (code)); |
28963 | 1302 } |
1303 | |
1304 | |
1305 /* Called from Ffontset_info via map_char_table on each leaf of | |
49874
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1306 fontset. ARG is a copy of the default fontset. The current leaf |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1307 is indexed by CHARACTER and has value ELT. This function override |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1308 the copy by ELT if ELT is not nil. */ |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1309 |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1310 static void |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1311 override_font_info (fontset, character, elt) |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1312 Lisp_Object fontset, character, elt; |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1313 { |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1314 if (! NILP (elt)) |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1315 Faset (fontset, character, elt); |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1316 } |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1317 |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1318 /* Called from Ffontset_info via map_char_table on each leaf of |
28963 | 1319 fontset. ARG is a list (LAST FONT-INFO ...), where LAST is `(last |
1320 ARG)' and FONT-INFOs have this form: | |
1321 (CHAR FONT-SPEC) or ((FROM . TO) FONT-SPEC) | |
1322 The current leaf is indexed by CHARACTER and has value ELT. This | |
1323 function add the information of the current leaf to ARG by | |
49874
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1324 appending a new element or modifying the last element. */ |
28963 | 1325 |
1326 static void | |
1327 accumulate_font_info (arg, character, elt) | |
1328 Lisp_Object arg, character, elt; | |
1329 { | |
34975
0d69e2d2724e
(fontset_ref): Remove unused variable `i'.
Eli Zaretskii <eliz@gnu.org>
parents:
32978
diff
changeset
|
1330 Lisp_Object last, last_char, last_elt; |
28963 | 1331 |
29767
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
1332 if (!CONSP (elt) && !SINGLE_BYTE_CHAR_P (XINT (character))) |
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
1333 elt = FONTSET_REF (Vdefault_fontset, XINT (character)); |
28963 | 1334 if (!CONSP (elt)) |
1335 return; | |
1336 last = XCAR (arg); | |
1337 last_char = XCAR (XCAR (last)); | |
1338 last_elt = XCAR (XCDR (XCAR (last))); | |
1339 elt = XCDR (elt); | |
1340 if (!NILP (Fequal (elt, last_elt))) | |
1341 { | |
1342 int this_charset = CHAR_CHARSET (XINT (character)); | |
1343 | |
1344 if (CONSP (last_char)) /* LAST_CHAR == (FROM . TO) */ | |
1345 { | |
1346 if (this_charset == CHAR_CHARSET (XINT (XCAR (last_char)))) | |
1347 { | |
39973
579177964efa
Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
Ken Raeburn <raeburn@raeburn.org>
parents:
37744
diff
changeset
|
1348 XSETCDR (last_char, character); |
28963 | 1349 return; |
1350 } | |
1351 } | |
29767
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
1352 else if (XINT (last_char) == XINT (character)) |
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
1353 return; |
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
1354 else if (this_charset == CHAR_CHARSET (XINT (last_char))) |
28963 | 1355 { |
39973
579177964efa
Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
Ken Raeburn <raeburn@raeburn.org>
parents:
37744
diff
changeset
|
1356 XSETCAR (XCAR (last), Fcons (last_char, character)); |
29767
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
1357 return; |
28963 | 1358 } |
1359 } | |
39973
579177964efa
Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
Ken Raeburn <raeburn@raeburn.org>
parents:
37744
diff
changeset
|
1360 XSETCDR (last, Fcons (Fcons (character, Fcons (elt, Qnil)), Qnil)); |
579177964efa
Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
Ken Raeburn <raeburn@raeburn.org>
parents:
37744
diff
changeset
|
1361 XSETCAR (arg, XCDR (last)); |
28963 | 1362 } |
1363 | |
1364 | |
17052 | 1365 DEFUN ("fontset-info", Ffontset_info, Sfontset_info, 1, 2, 0, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1366 doc: /* Return information about a fontset named NAME on frame FRAME. |
49881
95289e554702
(Fset_fontset_font): Document that NAME nil means the default
Kenichi Handa <handa@m17n.org>
parents:
49874
diff
changeset
|
1367 If NAME is nil, return information about the default fontset. |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1368 The value is a vector: |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1369 [ SIZE HEIGHT ((CHARSET-OR-RANGE FONT-SPEC OPENED ...) ...) ], |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1370 where, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1371 SIZE is the maximum bound width of ASCII font in the fontset, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1372 HEIGHT is the maximum bound height of ASCII font in the fontset, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1373 CHARSET-OR-RANGE is a charset, a character (may be a generic character) |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1374 or a cons of two characters specifying the range of characters. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1375 FONT-SPEC is a fontname pattern string or a cons (FAMILY . REGISTRY), |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1376 where FAMILY is a `FAMILY' field of a XLFD font name, |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
1377 REGISTRY is a `CHARSET_REGISTRY' field of a XLFD font name. |
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
1378 FAMILY may contain a `FOUNDRY' field at the head. |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1379 REGISTRY may contain a `CHARSET_ENCODING' field at the tail. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1380 OPENEDs are names of fonts actually opened. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1381 If the ASCII font is not yet opened, SIZE and HEIGHT are 0. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1382 If FRAME is omitted, it defaults to the currently selected frame. */) |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1383 (name, frame) |
17052 | 1384 Lisp_Object name, frame; |
1385 { | |
28963 | 1386 Lisp_Object fontset; |
17052 | 1387 FRAME_PTR f; |
28963 | 1388 Lisp_Object indices[3]; |
1389 Lisp_Object val, tail, elt; | |
1390 Lisp_Object *realized; | |
30124
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1391 struct font_info *fontp = NULL; |
28963 | 1392 int n_realized = 0; |
17052 | 1393 int i; |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
1394 |
17052 | 1395 (*check_window_system_func) (); |
1396 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1397 fontset = check_fontset_name (name); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1398 |
17052 | 1399 if (NILP (frame)) |
25668
99290b59352d
(Ffont_info): Change for Lisp_Object selected_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
24611
diff
changeset
|
1400 frame = selected_frame; |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
1401 CHECK_LIVE_FRAME (frame); |
25668
99290b59352d
(Ffont_info): Change for Lisp_Object selected_frame.
Gerd Moellmann <gerd@gnu.org>
parents:
24611
diff
changeset
|
1402 f = XFRAME (frame); |
17052 | 1403 |
29767
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
1404 /* Recode realized fontsets whose base is FONTSET in the table |
28963 | 1405 `realized'. */ |
1406 realized = (Lisp_Object *) alloca (sizeof (Lisp_Object) | |
1407 * ASIZE (Vfontset_table)); | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1408 for (i = 0; i < ASIZE (Vfontset_table); i++) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1409 { |
28963 | 1410 elt = FONTSET_FROM_ID (i); |
1411 if (!NILP (elt) | |
1412 && EQ (FONTSET_BASE (elt), fontset)) | |
1413 realized[n_realized++] = elt; | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1414 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1415 |
49874
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1416 if (! EQ (fontset, Vdefault_fontset)) |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1417 { |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1418 /* Merge FONTSET onto the default fontset. */ |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1419 val = Fcopy_sequence (Vdefault_fontset); |
51033
8fe4bdd97052
(Ffontset_info): Pass new arg to map_char_table.
Richard M. Stallman <rms@gnu.org>
parents:
49884
diff
changeset
|
1420 map_char_table (override_font_info, Qnil, fontset, fontset, val, 0, indices); |
49874
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1421 fontset = val; |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1422 } |
3bdee1887901
(check_fontset_name): If NAME is nil, return the
Kenichi Handa <handa@m17n.org>
parents:
49286
diff
changeset
|
1423 |
28963 | 1424 /* Accumulate information of the fontset in VAL. The format is |
1425 (LAST FONT-INFO FONT-INFO ...), where FONT-INFO is (CHAR-OR-RANGE | |
1426 FONT-SPEC). See the comment for accumulate_font_info for the | |
1427 detail. */ | |
1428 val = Fcons (Fcons (make_number (0), | |
1429 Fcons (XCDR (FONTSET_ASCII (fontset)), Qnil)), | |
1430 Qnil); | |
1431 val = Fcons (val, val); | |
51033
8fe4bdd97052
(Ffontset_info): Pass new arg to map_char_table.
Richard M. Stallman <rms@gnu.org>
parents:
49884
diff
changeset
|
1432 map_char_table (accumulate_font_info, Qnil, fontset, fontset, val, 0, indices); |
28963 | 1433 val = XCDR (val); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1434 |
28963 | 1435 /* For each FONT-INFO, if CHAR_OR_RANGE (car part) is a generic |
29767
c8e5453dc85d
(FONTSET_ASCII): Use the first element of char table
Kenichi Handa <handa@m17n.org>
parents:
29501
diff
changeset
|
1436 character for a charset, replace it with the charset symbol. If |
28963 | 1437 fonts are opened for FONT-SPEC, append the names of the fonts to |
1438 FONT-SPEC. */ | |
1439 for (tail = val; CONSP (tail); tail = XCDR (tail)) | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1440 { |
28963 | 1441 int c; |
1442 elt = XCAR (tail); | |
1443 if (INTEGERP (XCAR (elt))) | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1444 { |
28963 | 1445 int charset, c1, c2; |
1446 c = XINT (XCAR (elt)); | |
1447 SPLIT_CHAR (c, charset, c1, c2); | |
1448 if (c1 == 0) | |
39973
579177964efa
Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
Ken Raeburn <raeburn@raeburn.org>
parents:
37744
diff
changeset
|
1449 XSETCAR (elt, CHARSET_SYMBOL (charset)); |
28963 | 1450 } |
1451 else | |
1452 c = XINT (XCAR (XCAR (elt))); | |
1453 for (i = 0; i < n_realized; i++) | |
1454 { | |
1455 Lisp_Object face_id, font; | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1456 struct face *face; |
17052 | 1457 |
28963 | 1458 face_id = FONTSET_REF_VIA_BASE (realized[i], c); |
1459 if (INTEGERP (face_id)) | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1460 { |
28963 | 1461 face = FACE_FROM_ID (f, XINT (face_id)); |
37744
7893c43d43c2
(Ffontset_info): Check that face is non-null
Gerd Moellmann <gerd@gnu.org>
parents:
36759
diff
changeset
|
1462 if (face && face->font && face->font_name) |
28963 | 1463 { |
1464 font = build_string (face->font_name); | |
1465 if (NILP (Fmember (font, XCDR (XCDR (elt))))) | |
39973
579177964efa
Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
Ken Raeburn <raeburn@raeburn.org>
parents:
37744
diff
changeset
|
1466 XSETCDR (XCDR (elt), Fcons (font, XCDR (XCDR (elt)))); |
28963 | 1467 } |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1468 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1469 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1470 } |
30124
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1471 |
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1472 elt = Fcdr (Fcdr (Fassq (CHARSET_SYMBOL (CHARSET_ASCII), val))); |
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1473 if (CONSP (elt)) |
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1474 { |
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1475 elt = XCAR (elt); |
46370
40db0673e6f0
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents:
45848
diff
changeset
|
1476 fontp = (*query_font_func) (f, SDATA (elt)); |
30124
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1477 } |
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1478 val = Fmake_vector (make_number (3), val); |
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1479 AREF (val, 0) = fontp ? make_number (fontp->size) : make_number (0); |
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1480 AREF (val, 1) = fontp ? make_number (fontp->height) : make_number (0); |
26076259e03f
(Ffontset_info): Make the return value more compatible
Kenichi Handa <handa@m17n.org>
parents:
29767
diff
changeset
|
1481 return val; |
17052 | 1482 } |
1483 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1484 DEFUN ("fontset-font", Ffontset_font, Sfontset_font, 2, 2, 0, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1485 doc: /* Return a font name pattern for character CH in fontset NAME. |
49881
95289e554702
(Fset_fontset_font): Document that NAME nil means the default
Kenichi Handa <handa@m17n.org>
parents:
49874
diff
changeset
|
1486 If NAME is nil, find a font name pattern in the default fontset. */) |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1487 (name, ch) |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1488 Lisp_Object name, ch; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1489 { |
34975
0d69e2d2724e
(fontset_ref): Remove unused variable `i'.
Eli Zaretskii <eliz@gnu.org>
parents:
32978
diff
changeset
|
1490 int c; |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1491 Lisp_Object fontset, elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1492 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1493 fontset = check_fontset_name (name); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1494 |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40028
diff
changeset
|
1495 CHECK_NUMBER (ch); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1496 c = XINT (ch); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1497 if (!char_valid_p (c, 1)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1498 invalid_character (c); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1499 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1500 elt = FONTSET_REF (fontset, c); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1501 if (CONSP (elt)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1502 elt = XCDR (elt); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1503 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1504 return elt; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1505 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1506 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1507 DEFUN ("fontset-list", Ffontset_list, Sfontset_list, 0, 0, 0, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1508 doc: /* Return a list of all defined fontset names. */) |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1509 () |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1510 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1511 Lisp_Object fontset, list; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1512 int i; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1513 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1514 list = Qnil; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1515 for (i = 0; i < ASIZE (Vfontset_table); i++) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1516 { |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1517 fontset = FONTSET_FROM_ID (i); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1518 if (!NILP (fontset) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1519 && BASE_FONTSET_P (fontset)) |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1520 list = Fcons (FONTSET_NAME (fontset), list); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1521 } |
28963 | 1522 |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1523 return list; |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1524 } |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1525 |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1526 DEFUN ("set-overriding-fontspec-internal", Fset_overriding_fontspec_internal, |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1527 Sset_overriding_fontspec_internal, 1, 1, 0, |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1528 doc: /* Internal use only. |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1529 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1530 FONTLIST is an alist of TARGET vs FONTNAME, where TARGET is a charset |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1531 or a char-table, FONTNAME have the same meanings as in |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1532 `set-fontset-font'. |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1533 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1534 It overrides the font specifications for each TARGET in the default |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1535 fontset by the corresponding FONTNAME. |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1536 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1537 If TARGET is a charset, targets are all characters in the charset. If |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1538 TARGET is a char-table, targets are characters whose value is non-nil |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1539 in the table. |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1540 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1541 It is intended that this function is called only from |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1542 `set-language-environment'. */) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1543 (fontlist) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1544 Lisp_Object fontlist; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1545 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1546 Lisp_Object tail; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1547 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1548 fontlist = Fcopy_sequence (fontlist); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1549 /* Now FONTLIST is ((TARGET . FONTNAME) ...). Reform it to ((TARGET |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1550 nil nil nil FONTSPEC) ...), where TARGET is a charset-id or a |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1551 char-table. */ |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1552 for (tail = fontlist; CONSP (tail); tail = XCDR (tail)) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1553 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1554 Lisp_Object elt, target; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1555 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1556 elt = XCAR (tail); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1557 target = Fcar (elt); |
54995
df451d79772b
(regularize_fontname): Renamed from regulalize_fontname.
John Paul Wallington <jpw@pobox.com>
parents:
53622
diff
changeset
|
1558 elt = Fcons (Qnil, regularize_fontname (Fcdr (elt))); |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1559 if (! CHAR_TABLE_P (target)) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1560 { |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1561 int charset, c; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1562 |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1563 CHECK_SYMBOL (target); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1564 charset = get_charset_id (target); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1565 if (charset < 0) |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1566 error ("Invalid charset %s", SDATA (SYMBOL_NAME (target))); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1567 target = make_number (charset); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1568 c = MAKE_CHAR (charset, 0, 0); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1569 XSETCAR (elt, make_number (c)); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1570 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1571 elt = Fcons (target, Fcons (Qnil, Fcons (Qnil, elt))); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1572 XSETCAR (tail, elt); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1573 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1574 Voverriding_fontspec_alist = fontlist; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1575 clear_face_cache (0); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1576 ++windows_or_buffers_changed; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1577 return Qnil; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1578 } |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1579 |
21514 | 1580 void |
17052 | 1581 syms_of_fontset () |
1582 { | |
1583 if (!load_font_func) | |
1584 /* Window system initializer should have set proper functions. */ | |
1585 abort (); | |
1586 | |
17112
5c48ff325655
(syms_of_fontset): Intern Qfontset. Declare new lisp
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1587 Qfontset = intern ("fontset"); |
17052 | 1588 staticpro (&Qfontset); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1589 Fput (Qfontset, Qchar_table_extra_slots, make_number (3)); |
17052 | 1590 |
1591 Vcached_fontset_data = Qnil; | |
1592 staticpro (&Vcached_fontset_data); | |
1593 | |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1594 Vfontset_table = Fmake_vector (make_number (32), Qnil); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1595 staticpro (&Vfontset_table); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1596 |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1597 Vdefault_fontset = Fmake_char_table (Qfontset, Qnil); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1598 staticpro (&Vdefault_fontset); |
28963 | 1599 FONTSET_ID (Vdefault_fontset) = make_number (0); |
1600 FONTSET_NAME (Vdefault_fontset) | |
1601 = build_string ("-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"); | |
44890
01b93e5e53a7
Patch for building Emacs on Mac OS X. April 26, 2002. See ChangeLog,
Andrew Choi <akochoi@shaw.ca>
parents:
41987
diff
changeset
|
1602 #if defined (MAC_OS) |
32752
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
31102
diff
changeset
|
1603 FONTSET_ASCII (Vdefault_fontset) |
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
31102
diff
changeset
|
1604 = Fcons (make_number (0), |
45848 | 1605 build_string ("-apple-monaco-medium-r-*--*-120-*-*-*-*-mac-roman")); |
32790
131348208699
(syms_of_fontset) [WINDOWSNT]: Special case for ASCII font of default
Jason Rumney <jasonr@gnu.org>
parents:
32752
diff
changeset
|
1606 #elif defined (WINDOWSNT) |
131348208699
(syms_of_fontset) [WINDOWSNT]: Special case for ASCII font of default
Jason Rumney <jasonr@gnu.org>
parents:
32752
diff
changeset
|
1607 FONTSET_ASCII (Vdefault_fontset) |
131348208699
(syms_of_fontset) [WINDOWSNT]: Special case for ASCII font of default
Jason Rumney <jasonr@gnu.org>
parents:
32752
diff
changeset
|
1608 = Fcons (make_number (0), |
32978
ca33eb68d9da
(syms_of_fontset) [WINDOWSNT]: Make default fontsize on w32 10
Jason Rumney <jasonr@gnu.org>
parents:
32790
diff
changeset
|
1609 build_string ("-*-courier new-normal-r-*-*-*-100-*-*-*-*-iso8859-1")); |
32752
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
31102
diff
changeset
|
1610 #else |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1611 FONTSET_ASCII (Vdefault_fontset) |
29231
3c444d185d31
(syms_of_fontset): Adjust the font name for ascii of
Kenichi Handa <handa@m17n.org>
parents:
29011
diff
changeset
|
1612 = Fcons (make_number (0), |
3c444d185d31
(syms_of_fontset): Adjust the font name for ascii of
Kenichi Handa <handa@m17n.org>
parents:
29011
diff
changeset
|
1613 build_string ("-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1")); |
32752
923b8d6d8277
Initial check-in: changes for building Emacs under Mac OS.
Andrew Choi <akochoi@shaw.ca>
parents:
31102
diff
changeset
|
1614 #endif |
28963 | 1615 AREF (Vfontset_table, 0) = Vdefault_fontset; |
1616 next_fontset_id = 1; | |
17052 | 1617 |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1618 Voverriding_fontspec_alist = Qnil; |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1619 staticpro (&Voverriding_fontspec_alist); |
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1620 |
17052 | 1621 DEFVAR_LISP ("font-encoding-alist", &Vfont_encoding_alist, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1622 doc: /* Alist of fontname patterns vs corresponding encoding info. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1623 Each element looks like (REGEXP . ENCODING-INFO), |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1624 where ENCODING-INFO is an alist of CHARSET vs ENCODING. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1625 ENCODING is one of the following integer values: |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1626 0: code points 0x20..0x7F or 0x2020..0x7F7F are used, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1627 1: code points 0xA0..0xFF or 0xA0A0..0xFFFF are used, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1628 2: code points 0x20A0..0x7FFF are used, |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1629 3: code points 0xA020..0xFF7F are used. */); |
17052 | 1630 Vfont_encoding_alist = Qnil; |
49286
fc85fba774da
(syms_of_fontset): Setup Vfont_encoding_alist here.
Kenichi Handa <handa@m17n.org>
parents:
47277
diff
changeset
|
1631 Vfont_encoding_alist |
fc85fba774da
(syms_of_fontset): Setup Vfont_encoding_alist here.
Kenichi Handa <handa@m17n.org>
parents:
47277
diff
changeset
|
1632 = Fcons (Fcons (build_string ("JISX0201"), |
fc85fba774da
(syms_of_fontset): Setup Vfont_encoding_alist here.
Kenichi Handa <handa@m17n.org>
parents:
47277
diff
changeset
|
1633 Fcons (Fcons (intern ("latin-jisx0201"), make_number (0)), |
fc85fba774da
(syms_of_fontset): Setup Vfont_encoding_alist here.
Kenichi Handa <handa@m17n.org>
parents:
47277
diff
changeset
|
1634 Qnil)), |
fc85fba774da
(syms_of_fontset): Setup Vfont_encoding_alist here.
Kenichi Handa <handa@m17n.org>
parents:
47277
diff
changeset
|
1635 Vfont_encoding_alist); |
fc85fba774da
(syms_of_fontset): Setup Vfont_encoding_alist here.
Kenichi Handa <handa@m17n.org>
parents:
47277
diff
changeset
|
1636 Vfont_encoding_alist |
fc85fba774da
(syms_of_fontset): Setup Vfont_encoding_alist here.
Kenichi Handa <handa@m17n.org>
parents:
47277
diff
changeset
|
1637 = Fcons (Fcons (build_string ("ISO8859-1"), |
fc85fba774da
(syms_of_fontset): Setup Vfont_encoding_alist here.
Kenichi Handa <handa@m17n.org>
parents:
47277
diff
changeset
|
1638 Fcons (Fcons (intern ("ascii"), make_number (0)), |
fc85fba774da
(syms_of_fontset): Setup Vfont_encoding_alist here.
Kenichi Handa <handa@m17n.org>
parents:
47277
diff
changeset
|
1639 Qnil)), |
fc85fba774da
(syms_of_fontset): Setup Vfont_encoding_alist here.
Kenichi Handa <handa@m17n.org>
parents:
47277
diff
changeset
|
1640 Vfont_encoding_alist); |
17052 | 1641 |
17112
5c48ff325655
(syms_of_fontset): Intern Qfontset. Declare new lisp
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1642 DEFVAR_LISP ("use-default-ascent", &Vuse_default_ascent, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1643 doc: /* Char table of characters whose ascent values should be ignored. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1644 If an entry for a character is non-nil, the ascent value of the glyph |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1645 is assumed to be what specified by _MULE_DEFAULT_ASCENT property of a font. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1646 |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1647 This affects how a composite character which contains |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1648 such a character is displayed on screen. */); |
19282
09a1536debb4
(Vignore_relative_composition): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19172
diff
changeset
|
1649 Vuse_default_ascent = Qnil; |
09a1536debb4
(Vignore_relative_composition): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19172
diff
changeset
|
1650 |
09a1536debb4
(Vignore_relative_composition): New variable.
Kenichi Handa <handa@m17n.org>
parents:
19172
diff
changeset
|
1651 DEFVAR_LISP ("ignore-relative-composition", &Vignore_relative_composition, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1652 doc: /* Char table of characters which is not composed relatively. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1653 If an entry for a character is non-nil, a composition sequence |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1654 which contains that character is displayed so that |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1655 the glyph of that character is put without considering |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1656 an ascent and descent value of a previous character. */); |
26858
7cc081b4e084
(Vvertical_centering_font_regexp): New variable.
Kenichi Handa <handa@m17n.org>
parents:
26164
diff
changeset
|
1657 Vignore_relative_composition = Qnil; |
17112
5c48ff325655
(syms_of_fontset): Intern Qfontset. Declare new lisp
Kenichi Handa <handa@m17n.org>
parents:
17071
diff
changeset
|
1658 |
19450
895dc2520755
(Valternate_fontname_alist): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
19282
diff
changeset
|
1659 DEFVAR_LISP ("alternate-fontname-alist", &Valternate_fontname_alist, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1660 doc: /* Alist of fontname vs list of the alternate fontnames. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1661 When a specified font name is not found, the corresponding |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1662 alternate fontnames (if any) are tried instead. */); |
19450
895dc2520755
(Valternate_fontname_alist): Name changed from
Kenichi Handa <handa@m17n.org>
parents:
19282
diff
changeset
|
1663 Valternate_fontname_alist = Qnil; |
17193
dc4562b0152a
(Valternative_fontname_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17190
diff
changeset
|
1664 |
17730
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
1665 DEFVAR_LISP ("fontset-alias-alist", &Vfontset_alias_alist, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1666 doc: /* Alist of fontset names vs the aliases. */); |
28963 | 1667 Vfontset_alias_alist = Fcons (Fcons (FONTSET_NAME (Vdefault_fontset), |
1668 build_string ("fontset-default")), | |
1669 Qnil); | |
17730
4bbcc6804b5d
(Vfontset_alias_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
17331
diff
changeset
|
1670 |
26858
7cc081b4e084
(Vvertical_centering_font_regexp): New variable.
Kenichi Handa <handa@m17n.org>
parents:
26164
diff
changeset
|
1671 DEFVAR_LISP ("vertical-centering-font-regexp", |
7cc081b4e084
(Vvertical_centering_font_regexp): New variable.
Kenichi Handa <handa@m17n.org>
parents:
26164
diff
changeset
|
1672 &Vvertical_centering_font_regexp, |
41001
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1673 doc: /* *Regexp matching font names that require vertical centering on display. |
a17c8b15ef1b
Change doc-string comments to `new style' [w/`doc:' keyword].
Pavel Janík <Pavel@Janik.cz>
parents:
40771
diff
changeset
|
1674 When a character is displayed with such fonts, the character is displayed |
41987
34952771ae85
Fix typos, remove unnecessary space.
Pavel Janík <Pavel@Janik.cz>
parents:
41052
diff
changeset
|
1675 at the vertical center of lines. */); |
26858
7cc081b4e084
(Vvertical_centering_font_regexp): New variable.
Kenichi Handa <handa@m17n.org>
parents:
26164
diff
changeset
|
1676 Vvertical_centering_font_regexp = Qnil; |
7cc081b4e084
(Vvertical_centering_font_regexp): New variable.
Kenichi Handa <handa@m17n.org>
parents:
26164
diff
changeset
|
1677 |
17052 | 1678 defsubr (&Squery_fontset); |
1679 defsubr (&Snew_fontset); | |
1680 defsubr (&Sset_fontset_font); | |
1681 defsubr (&Sfont_info); | |
28963 | 1682 defsubr (&Sinternal_char_font); |
17052 | 1683 defsubr (&Sfontset_info); |
28223
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1684 defsubr (&Sfontset_font); |
b888c69e8bf0
All codes rewritten or adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents:
26858
diff
changeset
|
1685 defsubr (&Sfontset_list); |
53353
b085f18ebcf0
(Voverriding_fontspec_alist): New variable.
Kenichi Handa <handa@m17n.org>
parents:
53072
diff
changeset
|
1686 defsubr (&Sset_overriding_fontspec_internal); |
17052 | 1687 } |
52401 | 1688 |
1689 /* arch-tag: ea861585-2f5f-4e5b-9849-d04a9c3a3537 | |
1690 (do not change this comment) */ |