Mercurial > emacs
annotate src/font.h @ 91266:3cd59392b3ec
(Vfont_encoding_charset_alist): New variable.
(syms_of_fontset): DEFVAR it.
(reorder_font_vector): Optimize for the case of no need of
reordring.
(fontset_find_font): Likewise.
(face_for_char): Map the charset property by
Vfont_encoding_charset_alist.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 21 Dec 2007 01:37:31 +0000 |
parents | e221dce4f621 |
children | 4afd897cd60b |
rev | line source |
---|---|
90400 | 1 /* font.h -- Interface definition for font handling. |
2 Copyright (C) 2006 Free Software Foundation, Inc. | |
3 Copyright (C) 2006 | |
4 National Institute of Advanced Industrial Science and Technology (AIST) | |
5 Registration Number H13PRO009 | |
6 | |
7 This file is part of GNU Emacs. | |
8 | |
9 GNU Emacs is free software; you can redistribute it and/or modify | |
10 it under the terms of the GNU General Public License as published by | |
11 the Free Software Foundation; either version 2, or (at your option) | |
12 any later version. | |
13 | |
14 GNU Emacs is distributed in the hope that it will be useful, | |
15 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 GNU General Public License for more details. | |
18 | |
19 You should have received a copy of the GNU General Public License | |
20 along with GNU Emacs; see the file COPYING. If not, write to | |
21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
22 Boston, MA 02110-1301, USA. */ | |
23 | |
24 #ifndef EMACS_FONT_H | |
25 #define EMACS_FONT_H | |
26 | |
27 #include "ccl.h" | |
28 | |
29 /* We have three types of Lisp objects related to font. | |
30 | |
31 FONT-SPEC | |
32 | |
33 Vector (length FONT_SPEC_MAX) of font properties. Some | |
34 properties can be left unspecified (i.e. nil). Emacs asks | |
35 font-drivers to find a font by FONT-SPEC. A fontset entry | |
36 specifies requisite properties whereas a face specifies just | |
37 preferable properties. This object is fully modifiable by | |
38 Lisp. | |
39 | |
40 FONT-ENTITY | |
41 | |
42 Vector (length FONT_ENTITY_MAX) of fully specified font | |
43 properties that a font-driver returns upon a request of | |
44 FONT-SPEC. | |
45 | |
46 Note: Only the method `list' of a font-driver can create this | |
47 object, and should never be modified by Lisp. In that sense, | |
48 it may be cleaner to implement it as a Lisp object of a new | |
49 type (e.g. struct Lisp_Font). | |
50 | |
51 FONT-OBJECT | |
52 | |
53 Lisp object of type Lisp_Misc_Save_Value encapsulating a | |
54 pointer to "struct font". This corresponds to an opened font. | |
55 | |
56 Note: The note for FONT-ENTITY also applies to this. | |
57 */ | |
58 | |
59 | |
60 struct font_driver; | |
61 struct font; | |
62 | |
63 /* An enumerator for each font property. This is used as an index to | |
64 the vector of FONT-SPEC and FONT-ENTITY. | |
65 | |
66 Note: The order is important and should not be changed. */ | |
67 | |
68 enum font_property_index | |
69 { | |
70 /* FONT-TYPE is a symbol indicating a font backend; currently `x', | |
91256
e221dce4f621
(font_property_index): Doc change
Jason Rumney <jasonr@gnu.org>
parents:
91244
diff
changeset
|
71 `xft', `ftx', `freetype' are available on X and gdi on Windows. |
e221dce4f621
(font_property_index): Doc change
Jason Rumney <jasonr@gnu.org>
parents:
91244
diff
changeset
|
72 For Windows, we `bdf' and `uniscribe' backends are in progress. |
e221dce4f621
(font_property_index): Doc change
Jason Rumney <jasonr@gnu.org>
parents:
91244
diff
changeset
|
73 For Mac OS X, we need `atm'. */ |
90400 | 74 FONT_TYPE_INDEX, |
75 | |
76 /* FONT-FOUNDRY is a foundry name (symbol). */ | |
77 FONT_FOUNDRY_INDEX, | |
78 | |
79 /* FONT-FAMILY is a family name (symbol). */ | |
80 FONT_FAMILY_INDEX, | |
81 | |
82 /* FONT-ADSTYLE is an additional style name (symbol). */ | |
83 FONT_ADSTYLE_INDEX, | |
84 | |
85 /* FONT-REGISTRY is a combination of a charset-registry and | |
86 charset0encoding name (symbol). */ | |
87 FONT_REGISTRY_INDEX, | |
88 | |
89 /* FONT-WEIGHT is a numeric value of weight (e.g. medium, bold) of | |
90 the font. The value is what defined by FC_WEIGHT_* in | |
91 fontconfig. */ | |
92 FONT_WEIGHT_INDEX, | |
93 | |
94 /* FONT-SLANT is a numeric value of slant (e.g. r, i, o) of the | |
95 font. The value is what defined by FC_SLANT_* in | |
96 fontconfig plus 100. */ | |
97 FONT_SLANT_INDEX, | |
98 | |
99 /* FONT-WIDTH is a numeric value of setwidth (e.g. normal, | |
100 condensed) of the font. The value is what defined by | |
101 FC_WIDTH_* in fontconfig. */ | |
102 FONT_WIDTH_INDEX, | |
103 | |
104 /* FONT-SIZE is a size of the font. If integer, it is a pixel | |
105 size. For a font-spec, the value can be float specifying a | |
106 point size. For a font-entity, the value can be zero meaning | |
107 that the font is scalable. */ | |
108 FONT_SIZE_INDEX, | |
109 | |
110 /* In a font-spec, the value is an alist of extra information of a | |
111 font such as name, OpenType features, and language coverage. | |
112 In a font-entity, the value is an extra infomation for | |
113 identifying a font (font-driver dependent). */ | |
114 FONT_EXTRA_INDEX, /* alist alist */ | |
115 | |
116 /* This value is the length of font-spec vector. */ | |
117 FONT_SPEC_MAX, | |
118 | |
119 /* The followings are used only for a font-entity. */ | |
120 | |
121 /* Frame on which the font is found. The value is nil if the font | |
122 can be opend on any frame. */ | |
123 FONT_FRAME_INDEX = FONT_SPEC_MAX, | |
124 | |
91134
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
125 /* List of font-objects opened from the font-entity. The value is |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
126 nil if no font can be opened for this font-entity. */ |
90400 | 127 FONT_OBJLIST_INDEX, |
128 | |
129 /* This value is the length of font-entity vector. */ | |
130 FONT_ENTITY_MAX | |
131 }; | |
132 | |
90502 | 133 extern Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClanguage, QCscript; |
90400 | 134 |
90438
cac8d07077df
(Qiso8859_1, Qiso10646_1, Qunicode_bmp): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90427
diff
changeset
|
135 /* Important character set symbols. */ |
90621
d8a2b76fe3d4
(Qunicode_sip): Extern it.
Kenichi Handa <handa@m17n.org>
parents:
90564
diff
changeset
|
136 extern Lisp_Object Qiso8859_1, Qiso10646_1, Qunicode_bmp, Qunicode_sip; |
90438
cac8d07077df
(Qiso8859_1, Qiso10646_1, Qunicode_bmp): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90427
diff
changeset
|
137 |
90400 | 138 extern Lisp_Object null_string; |
139 extern Lisp_Object null_vector; | |
140 | |
141 /* Structure for an opened font. We can safely cast this structure to | |
90864 | 142 "struct font_info". */ |
90400 | 143 |
144 struct font | |
145 { | |
146 struct font_info font; | |
147 | |
148 /* From which font-entity the font is opened. */ | |
149 Lisp_Object entity; | |
150 | |
151 /* By which pixel size the font is opened. */ | |
152 int pixel_size; | |
153 | |
154 /* Font-driver for the font. */ | |
155 struct font_driver *driver; | |
156 | |
90678
94842604dfce
(struct font): New memeber format.
Kenichi Handa <handa@m17n.org>
parents:
90621
diff
changeset
|
157 /* Symbol of font font; x, ttf, pcf, etc, */ |
94842604dfce
(struct font): New memeber format.
Kenichi Handa <handa@m17n.org>
parents:
90621
diff
changeset
|
158 Lisp_Object format; |
94842604dfce
(struct font): New memeber format.
Kenichi Handa <handa@m17n.org>
parents:
90621
diff
changeset
|
159 |
90400 | 160 /* File name of the font, or NULL if the font is not associated with |
161 a file. */ | |
162 char *file_name; | |
163 | |
90506
5f608d7e835b
(font_close_object, font_merge_old_spec): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90502
diff
changeset
|
164 /* Charset to encode a character code into a glyph code of the font. |
5f608d7e835b
(font_close_object, font_merge_old_spec): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90502
diff
changeset
|
165 -1 means that the font doesn't require this information to encode |
5f608d7e835b
(font_close_object, font_merge_old_spec): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90502
diff
changeset
|
166 a character. */ |
90400 | 167 int encoding_charset; |
168 | |
169 /* Charset to check if a character code is supported by the font. | |
170 -1 means that the contents of the font must be looked up to | |
90506
5f608d7e835b
(font_close_object, font_merge_old_spec): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90502
diff
changeset
|
171 determine it. */ |
90453
3a78ea4d2a53
(struct font): Fix typo (charet->charset).
Kenichi Handa <handa@m17n.org>
parents:
90438
diff
changeset
|
172 int repertory_charset; |
90400 | 173 |
174 /* Minimum glyph width (in pixels). */ | |
175 int min_width; | |
176 | |
177 /* Ascent and descent of the font (in pixels). */ | |
178 int ascent, descent; | |
179 | |
90557
80c2d97a494e
(struct font): New member scalable.
Kenichi Handa <handa@m17n.org>
parents:
90550
diff
changeset
|
180 /* 1 iff the font is scalable. */ |
80c2d97a494e
(struct font): New member scalable.
Kenichi Handa <handa@m17n.org>
parents:
90550
diff
changeset
|
181 int scalable; |
80c2d97a494e
(struct font): New member scalable.
Kenichi Handa <handa@m17n.org>
parents:
90550
diff
changeset
|
182 |
90400 | 183 /* There will be more to this structure, but they are private to a |
184 font-driver. */ | |
185 }; | |
186 | |
90482
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
187 enum font_spacing |
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
188 { |
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
189 FONT_SPACING_PROPORTIONAL = 0, |
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
190 FONT_SPACING_DUAL = 90, |
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
191 FONT_SPACING_MONO = 100, |
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
192 FONT_SPACING_CHARCELL = 110 |
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
193 }; |
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
194 |
90400 | 195 struct font_metrics |
196 { | |
197 short lbearing, rbearing, width, ascent, descent; | |
198 }; | |
199 | |
200 struct font_bitmap | |
201 { | |
91114
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
202 int bits_per_pixel; |
90400 | 203 int rows; |
204 int width; | |
205 int pitch; | |
206 unsigned char *buffer; | |
207 int left; | |
208 int top; | |
209 int advance; | |
210 void *extra; | |
211 }; | |
212 | |
213 /* Predicates to check various font-related objects. */ | |
214 | |
215 #define FONTP(x) \ | |
216 (VECTORP (x) && (ASIZE (x) == FONT_SPEC_MAX || ASIZE (x) == FONT_ENTITY_MAX)) | |
217 #define FONT_SPEC_P(x) \ | |
218 (VECTORP (x) && ASIZE (x) == FONT_SPEC_MAX) | |
219 #define FONT_ENTITY_P(x) \ | |
220 (VECTORP (x) && ASIZE (x) == FONT_ENTITY_MAX) | |
221 #define FONT_OBJECT_P(x) \ | |
222 (XTYPE (x) == Lisp_Misc && XMISCTYPE (x) == Lisp_Misc_Save_Value) | |
223 | |
91134
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
224 #define FONT_ENTITY_NOT_LOADABLE(entity) \ |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
225 EQ (AREF (entity, FONT_OBJLIST_INDEX), Qt) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
226 |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
227 #define FONT_ENTITY_SET_NOT_LOADABLE(entity) \ |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
228 ASET (entity, FONT_OBJLIST_INDEX, Qt) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
229 |
90400 | 230 |
231 /* Check macros for various font-related objects. */ | |
232 | |
233 #define CHECK_FONT(x) \ | |
234 do { if (! FONTP (x)) x = wrong_type_argument (Qfont, x); } while (0) | |
235 #define CHECK_FONT_SPEC(x) \ | |
236 do { if (! FONT_SPEC_P (x)) x = wrong_type_argument (Qfont, x); } while (0) | |
237 #define CHECK_FONT_ENTITY(x) \ | |
238 do { if (! FONT_ENTITY_P (x)) x = wrong_type_argument (Qfont, x); } while (0) | |
239 #define CHECK_FONT_OBJECT(x) \ | |
240 do { if (! FONT_OBJECT_P (x)) x = wrong_type_argument (Qfont, x); } while (0) | |
241 | |
242 #define CHECK_FONT_GET_OBJECT(x, font) \ | |
243 do { \ | |
244 if (! FONT_OBJECT_P (x)) x = wrong_type_argument (Qfont, x); \ | |
245 if (! XSAVE_VALUE (x)->pointer) error ("Font already closed"); \ | |
246 font = XSAVE_VALUE (x)->pointer; \ | |
247 } while (0) | |
248 | |
90482
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
249 /* Ignore the difference of font pixel sizes less than or equal to |
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
250 this value. */ |
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
251 #define FONT_PIXEL_SIZE_QUANTUM 1 |
48a50b114c17
(QCspacing, QCdpi): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90469
diff
changeset
|
252 |
90400 | 253 struct face; |
254 struct composition; | |
255 | |
256 /* Macros for lispy glyph-string. */ | |
257 #define LGSTRING_FONT(lgs) AREF (AREF ((lgs), 0), 0) | |
91134
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
258 #define LGSTRING_WIDTH(lgs) XINT (AREF (AREF ((lgs), 0), 1)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
259 #define LGSTRING_LBEARING(lgs) XINT (AREF (AREF ((lgs), 0), 2)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
260 #define LGSTRING_RBEARING(lgs) XINT (AREF (AREF ((lgs), 0), 3)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
261 #define LGSTRING_ASCENT(lgs) XINT (AREF (AREF ((lgs), 0), 4)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
262 #define LGSTRING_DESCENT(lgs) XINT (AREF (AREF ((lgs), 0), 5)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
263 #define LGSTRING_SET_FONT(lgs, val) \ |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
264 ASET (AREF ((lgs), 0), 0, (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
265 #define LGSTRING_SET_WIDTH(lgs, val) \ |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
266 ASET (AREF ((lgs), 0), 1, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
267 #define LGSTRING_SET_LBEARING(lgs, val) \ |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
268 ASET (AREF ((lgs), 0), 2, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
269 #define LGSTRING_SET_RBEARING(lgs, val) \ |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
270 ASET (AREF ((lgs), 0), 3, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
271 #define LGSTRING_SET_ASCENT(lgs, val) \ |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
272 ASET (AREF ((lgs), 0), 4, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
273 #define LGSTRING_SET_DESCENT(lgs, val) \ |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
274 ASET (AREF ((lgs), 0), 5, make_number (val)) |
90400 | 275 |
276 #define LGSTRING_LENGTH(lgs) (ASIZE ((lgs)) - 1) | |
277 #define LGSTRING_GLYPH(lgs, idx) AREF ((lgs), (idx) + 1) | |
91134
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
278 #define LGSTRING_SET_GLYPH(lgs, idx, val) ASET ((lgs), (idx) + 1, (val)) |
90400 | 279 |
91134
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
280 #define LGLYPH_FROM(g) XINT (AREF ((g), 0)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
281 #define LGLYPH_TO(g) XINT (AREF ((g), 1)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
282 #define LGLYPH_CHAR(g) XINT (AREF ((g), 2)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
283 #define LGLYPH_CODE(g) XINT (AREF ((g), 3)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
284 #define LGLYPH_WIDTH(g) XINT (AREF ((g), 4)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
285 #define LGLYPH_LBEARING(g) XINT (AREF ((g), 5)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
286 #define LGLYPH_RBEARING(g) XINT (AREF ((g), 6)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
287 #define LGLYPH_ASCENT(g) XINT (AREF ((g), 7)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
288 #define LGLYPH_DESCENT(g) XINT (AREF ((g), 8)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
289 #define LGLYPH_ADJUSTMENT(g) AREF ((g), 9) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
290 #define LGLYPH_SET_FROM(g, val) ASET ((g), 0, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
291 #define LGLYPH_SET_TO(g, val) ASET ((g), 1, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
292 #define LGLYPH_SET_CHAR(g, val) ASET ((g), 2, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
293 #define LGLYPH_SET_CODE(g, val) ASET ((g), 3, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
294 #define LGLYPH_SET_WIDTH(g, val) ASET ((g), 4, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
295 #define LGLYPH_SET_LBEARING(g, val) ASET ((g), 5, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
296 #define LGLYPH_SET_RBEARING(g, val) ASET ((g), 6, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
297 #define LGLYPH_SET_ASCENT(g, val) ASET ((g), 7, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
298 #define LGLYPH_SET_DESCENT(g, val) ASET ((g), 8, make_number (val)) |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
299 #define LGLYPH_SET_ADJUSTMENT(g, val) ASET ((g), 9, (val)) |
90531
a4a30dc43165
(LGLYPH_XOFF, LGLYPH_YOFF, LGLYPH_WIDTH, LGLYPH_WADJUST)
Kenichi Handa <handa@m17n.org>
parents:
90506
diff
changeset
|
300 |
90542
2be199f501f8
(LGLYPH_FROM, LGLYPH_TO, LGLYPH_SET_FROM)
Kenichi Handa <handa@m17n.org>
parents:
90531
diff
changeset
|
301 #define LGLYPH_XOFF(g) (VECTORP (LGLYPH_ADJUSTMENT (g)) \ |
2be199f501f8
(LGLYPH_FROM, LGLYPH_TO, LGLYPH_SET_FROM)
Kenichi Handa <handa@m17n.org>
parents:
90531
diff
changeset
|
302 ? XINT (AREF (LGLYPH_ADJUSTMENT (g), 0)) : 0) |
2be199f501f8
(LGLYPH_FROM, LGLYPH_TO, LGLYPH_SET_FROM)
Kenichi Handa <handa@m17n.org>
parents:
90531
diff
changeset
|
303 #define LGLYPH_YOFF(g) (VECTORP (LGLYPH_ADJUSTMENT (g)) \ |
2be199f501f8
(LGLYPH_FROM, LGLYPH_TO, LGLYPH_SET_FROM)
Kenichi Handa <handa@m17n.org>
parents:
90531
diff
changeset
|
304 ? XINT (AREF (LGLYPH_ADJUSTMENT (g), 1)) : 0) |
2be199f501f8
(LGLYPH_FROM, LGLYPH_TO, LGLYPH_SET_FROM)
Kenichi Handa <handa@m17n.org>
parents:
90531
diff
changeset
|
305 #define LGLYPH_WADJUST(g) (VECTORP (LGLYPH_ADJUSTMENT (g)) \ |
2be199f501f8
(LGLYPH_FROM, LGLYPH_TO, LGLYPH_SET_FROM)
Kenichi Handa <handa@m17n.org>
parents:
90531
diff
changeset
|
306 ? XINT (AREF (LGLYPH_ADJUSTMENT (g), 2)) : 0) |
90400 | 307 |
308 #define FONT_INVALID_CODE 0xFFFFFFFF | |
309 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
310 /* Font driver. Members specified as "optional" can be NULL. */ |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
311 |
90400 | 312 struct font_driver |
313 { | |
314 /* Symbol indicating the type of the font-driver. */ | |
315 Lisp_Object type; | |
316 | |
91244
54b067217411
(struct font_driver): Change argument type of get_cache.
Kenichi Handa <handa@m17n.org>
parents:
91134
diff
changeset
|
317 /* Return a cache of font-entities on frame F. The cache must be a |
90400 | 318 cons whose cdr part is the actual cache area. */ |
91244
54b067217411
(struct font_driver): Change argument type of get_cache.
Kenichi Handa <handa@m17n.org>
parents:
91134
diff
changeset
|
319 Lisp_Object (*get_cache) P_ ((FRAME_PTR F)); |
90400 | 320 |
90564
cb3eb6150704
(struct font_driver): New member `match'.
Kenichi Handa <handa@m17n.org>
parents:
90557
diff
changeset
|
321 /* List fonts exactly matching with FONT_SPEC on FRAME. The value |
cb3eb6150704
(struct font_driver): New member `match'.
Kenichi Handa <handa@m17n.org>
parents:
90557
diff
changeset
|
322 is a vector of font-entities. This is the sole API that |
cb3eb6150704
(struct font_driver): New member `match'.
Kenichi Handa <handa@m17n.org>
parents:
90557
diff
changeset
|
323 allocates font-entities. */ |
90400 | 324 Lisp_Object (*list) P_ ((Lisp_Object frame, Lisp_Object font_spec)); |
325 | |
90564
cb3eb6150704
(struct font_driver): New member `match'.
Kenichi Handa <handa@m17n.org>
parents:
90557
diff
changeset
|
326 /* Return a font entity most closely maching with FONT_SPEC on |
cb3eb6150704
(struct font_driver): New member `match'.
Kenichi Handa <handa@m17n.org>
parents:
90557
diff
changeset
|
327 FRAME. The closeness is detemined by the font backend, thus |
cb3eb6150704
(struct font_driver): New member `match'.
Kenichi Handa <handa@m17n.org>
parents:
90557
diff
changeset
|
328 `face-font-selection-order' is ignored here. */ |
cb3eb6150704
(struct font_driver): New member `match'.
Kenichi Handa <handa@m17n.org>
parents:
90557
diff
changeset
|
329 Lisp_Object (*match) P_ ((Lisp_Object frame, Lisp_Object font_spec)); |
cb3eb6150704
(struct font_driver): New member `match'.
Kenichi Handa <handa@m17n.org>
parents:
90557
diff
changeset
|
330 |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
331 /* Optional. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
332 List available families. The value is a list of family names |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
333 (symbols). */ |
90400 | 334 Lisp_Object (*list_family) P_ ((Lisp_Object frame)); |
335 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
336 /* Optional (if FONT_EXTRA_INDEX is not Lisp_Save_Value). |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
337 Free FONT_EXTRA_INDEX field of FONT_ENTITY. */ |
90400 | 338 void (*free_entity) P_ ((Lisp_Object font_entity)); |
339 | |
340 /* Open a font specified by FONT_ENTITY on frame F. If the font is | |
341 scalable, open it with PIXEL_SIZE. */ | |
342 struct font *(*open) P_ ((FRAME_PTR f, Lisp_Object font_entity, | |
343 int pixel_size)); | |
344 | |
345 /* Close FONT on frame F. */ | |
346 void (*close) P_ ((FRAME_PTR f, struct font *font)); | |
347 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
348 /* Optional (if FACE->extra is not used). |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
349 Prepare FACE for displaying characters by FONT on frame F by |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
350 storing some data in FACE->extra. If successful, return 0. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
351 Otherwise, return -1. */ |
90400 | 352 int (*prepare_face) P_ ((FRAME_PTR f, struct face *face)); |
353 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
354 /* Optional. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
355 Done FACE for displaying characters by FACE->font on frame F. */ |
90400 | 356 void (*done_face) P_ ((FRAME_PTR f, struct face *face)); |
357 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
358 /* Optional. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
359 If FONT_ENTITY has a glyph for character C (Unicode code point), |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
360 return 1. If not, return 0. If a font must be opened to check |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
361 it, return -1. */ |
90400 | 362 int (*has_char) P_ ((Lisp_Object entity, int c)); |
363 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
364 /* Return a glyph code of FONT for characer C (Unicode code point). |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
365 If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */ |
90400 | 366 unsigned (*encode_char) P_ ((struct font *font, int c)); |
367 | |
91033
e25192c0a550
(struct font_driver): Docstring of text_extents improved.
Kenichi Handa <handa@m17n.org>
parents:
90885
diff
changeset
|
368 /* Computate the total metrics of the NGLYPHS glyphs specified by |
e25192c0a550
(struct font_driver): Docstring of text_extents improved.
Kenichi Handa <handa@m17n.org>
parents:
90885
diff
changeset
|
369 the font FONT and the sequence of glyph codes CODE, and store the |
e25192c0a550
(struct font_driver): Docstring of text_extents improved.
Kenichi Handa <handa@m17n.org>
parents:
90885
diff
changeset
|
370 result in METRICS. */ |
90400 | 371 int (*text_extents) P_ ((struct font *font, |
372 unsigned *code, int nglyphs, | |
373 struct font_metrics *metrics)); | |
374 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
375 /* Optional. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
376 Draw glyphs between FROM and TO of S->char2b at (X Y) pixel |
90400 | 377 position of frame F with S->FACE and S->GC. If WITH_BACKGROUND |
378 is nonzero, fill the background in advance. It is assured that | |
379 WITH_BACKGROUND is zero when (FROM > 0 || TO < S->nchars). */ | |
380 int (*draw) P_ ((struct glyph_string *s, int from, int to, | |
381 int x, int y, int with_background)); | |
382 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
383 /* Optional. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
384 Store bitmap data for glyph-code CODE of FONT in BITMAP. It is |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
385 intended that this method is callled from the other font-driver |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
386 for actual drawing. */ |
90400 | 387 int (*get_bitmap) P_ ((struct font *font, unsigned code, |
388 struct font_bitmap *bitmap, | |
389 int bits_per_pixel)); | |
390 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
391 /* Optional. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
392 Free bitmap data in BITMAP. */ |
90400 | 393 void (*free_bitmap) P_ ((struct font *font, struct font_bitmap *bitmap)); |
394 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
395 /* Optional. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
396 Return an outline data for glyph-code CODE of FONT. The format |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
397 of the outline data depends on the font-driver. */ |
90400 | 398 void *(*get_outline) P_ ((struct font *font, unsigned code)); |
399 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
400 /* Optional. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
401 Free OUTLINE (that is obtained by the above method). */ |
90400 | 402 void (*free_outline) P_ ((struct font *font, void *outline)); |
403 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
404 /* Optional. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
405 Get coordinates of the INDEXth anchor point of the glyph whose |
90400 | 406 code is CODE. Store the coordinates in *X and *Y. Return 0 if |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
407 the operations was successfull. Otherwise return -1. */ |
90400 | 408 int (*anchor_point) P_ ((struct font *font, unsigned code, int index, |
409 int *x, int *y)); | |
410 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
411 /* Optional. |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
412 Return a list describing which scripts/languages FONT |
90400 | 413 supports by which GSUB/GPOS features of OpenType tables. */ |
414 Lisp_Object (*otf_capability) P_ ((struct font *font)); | |
415 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
416 /* Optional. |
90815 | 417 Apply FONT's OTF-FEATURES to the glyph string. |
90400 | 418 |
90815 | 419 FEATURES specifies which OTF features to apply in this format: |
420 (SCRIPT LANGSYS GSUB-FEATURE GPOS-FEATURE) | |
421 See the documentation of `font-drive-otf' for the detail. | |
90400 | 422 |
423 This method applies the specified features to the codes in the | |
424 elements of GSTRING-IN (between FROMth and TOth). The output | |
425 codes are stored in GSTRING-OUT at the IDXth element and the | |
426 following elements. | |
427 | |
428 Return the number of output codes. If none of the features are | |
429 applicable to the input data, return 0. If GSTRING-OUT is too | |
430 short, return -1. */ | |
90815 | 431 int (*otf_drive) P_ ((struct font *font, Lisp_Object features, |
90400 | 432 Lisp_Object gstring_in, int from, int to, |
90557
80c2d97a494e
(struct font): New member scalable.
Kenichi Handa <handa@m17n.org>
parents:
90550
diff
changeset
|
433 Lisp_Object gstring_out, int idx, int alternate_subst)); |
91114
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
434 |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
435 /* Optional. |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
436 Make the font driver ready for frame F. Usually this function |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
437 makes some data specific to F and store it in F by calling |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
438 font_put_frame_data (). */ |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
439 int (*start_for_frame) P_ ((FRAME_PTR f)); |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
440 |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
441 /* Optional. |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
442 End using the driver for frame F. Usually this function free |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
443 some data stored for F. */ |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
444 int (*end_for_frame) P_ ((FRAME_PTR f)); |
91134
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
445 |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
446 /* Optional. |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
447 Shape text in LGSTRING. */ |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
448 Lisp_Object (*shape) P_ ((Lisp_Object lgstring)); |
90400 | 449 }; |
450 | |
451 | |
91114
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
452 /* Chain of font drivers. There's one global font driver list |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
453 (font_driver_list in font.c). In addition, each frame has it's own |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
454 font driver list at FRAME_PTR->font_driver_list. */ |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
455 |
90400 | 456 struct font_driver_list |
457 { | |
91114
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
458 /* 1 iff this driver is currently used. It is igonred in the global |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
459 font driver list.*/ |
90550 | 460 int on; |
91114
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
461 /* Pointer to the font driver. */ |
90400 | 462 struct font_driver *driver; |
91114
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
463 /* Pointer to the next element of the chain. */ |
90400 | 464 struct font_driver_list *next; |
465 }; | |
466 | |
91114
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
467 |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
468 /* Chain of arbitrary data specific to each font driver. Each frame |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
469 has it's own font data list at FRAME_PTR->font_data_list. */ |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
470 |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
471 struct font_data_list |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
472 { |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
473 /* Pointer to the font driver. */ |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
474 struct font_driver *driver; |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
475 /* Data specific to the font driver. */ |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
476 void *data; |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
477 /* Pointer to the next element of the chain. */ |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
478 struct font_data_list *next; |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
479 }; |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
480 |
90400 | 481 extern int enable_font_backend; |
482 | |
483 EXFUN (Ffont_spec, MANY); | |
91134
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
484 EXFUN (Ffont_get, 2); |
90497 | 485 EXFUN (Flist_fonts, 4); |
90550 | 486 EXFUN (Fclear_font_cache, 0); |
90696
46ca345eec0b
(Ffont_xlfd_name): EXFUN it.
Kenichi Handa <handa@m17n.org>
parents:
90678
diff
changeset
|
487 EXFUN (Ffont_xlfd_name, 1); |
90400 | 488 |
91134
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
489 extern int font_registry_charsets P_ ((Lisp_Object, struct charset **, |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
490 struct charset **)); |
90400 | 491 extern Lisp_Object font_symbolic_weight P_ ((Lisp_Object font)); |
492 extern Lisp_Object font_symbolic_slant P_ ((Lisp_Object font)); | |
493 extern Lisp_Object font_symbolic_width P_ ((Lisp_Object font)); | |
494 | |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
495 extern int font_match_p P_ ((Lisp_Object spec, Lisp_Object entity)); |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
496 |
90400 | 497 extern Lisp_Object font_find_object P_ ((struct font *font)); |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
498 extern Lisp_Object font_get_name P_ ((Lisp_Object font_object)); |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
499 extern Lisp_Object font_get_spec P_ ((Lisp_Object font_object)); |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
500 extern Lisp_Object font_get_frame P_ ((Lisp_Object font_object)); |
90400 | 501 extern int font_has_char P_ ((FRAME_PTR, Lisp_Object, int)); |
502 extern unsigned font_encode_char P_ ((Lisp_Object, int)); | |
503 | |
504 extern int font_set_lface_from_name P_ ((FRAME_PTR f, | |
505 Lisp_Object lface, | |
506 Lisp_Object fontname, | |
507 int force_p, int may_fail_p)); | |
508 extern Lisp_Object font_find_for_lface P_ ((FRAME_PTR f, Lisp_Object *lface, | |
91134
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
509 Lisp_Object spec, int c)); |
90815 | 510 extern Lisp_Object font_open_for_lface P_ ((FRAME_PTR f, Lisp_Object entity, |
511 Lisp_Object *lface, | |
512 Lisp_Object spec)); | |
90400 | 513 extern void font_load_for_face P_ ((FRAME_PTR f, struct face *face)); |
514 extern void font_prepare_for_face P_ ((FRAME_PTR f, struct face *face)); | |
515 extern Lisp_Object font_open_by_name P_ ((FRAME_PTR f, char *name)); | |
90506
5f608d7e835b
(font_close_object, font_merge_old_spec): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90502
diff
changeset
|
516 extern void font_close_object (FRAME_PTR f, Lisp_Object font_object); |
90400 | 517 |
518 extern Lisp_Object intern_downcase P_ ((char *str, int len)); | |
519 extern void font_update_sort_order P_ ((int *order)); | |
520 | |
90506
5f608d7e835b
(font_close_object, font_merge_old_spec): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90502
diff
changeset
|
521 extern void font_merge_old_spec P_ ((Lisp_Object name, Lisp_Object family, |
5f608d7e835b
(font_close_object, font_merge_old_spec): Extern them.
Kenichi Handa <handa@m17n.org>
parents:
90502
diff
changeset
|
522 Lisp_Object registry, Lisp_Object spec)); |
90400 | 523 |
524 | |
90502 | 525 extern int font_parse_xlfd P_ ((char *name, Lisp_Object font)); |
90400 | 526 extern int font_unparse_xlfd P_ ((Lisp_Object font, int pixel_size, |
527 char *name, int bytes)); | |
90502 | 528 extern int font_parse_fcname P_ ((char *name, Lisp_Object font)); |
90469
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
529 extern int font_unparse_fcname P_ ((Lisp_Object font, int pixel_size, |
c9df3c05d0ed
(struct font_driver): Member parse_name deleted.
Kenichi Handa <handa@m17n.org>
parents:
90453
diff
changeset
|
530 char *name, int bytes)); |
90400 | 531 extern void register_font_driver P_ ((struct font_driver *driver, FRAME_PTR f)); |
532 extern void free_font_driver_list P_ ((FRAME_PTR f)); | |
90564
cb3eb6150704
(struct font_driver): New member `match'.
Kenichi Handa <handa@m17n.org>
parents:
90557
diff
changeset
|
533 extern Lisp_Object font_update_drivers P_ ((FRAME_PTR f, Lisp_Object list)); |
90542
2be199f501f8
(LGLYPH_FROM, LGLYPH_TO, LGLYPH_SET_FROM)
Kenichi Handa <handa@m17n.org>
parents:
90531
diff
changeset
|
534 extern Lisp_Object font_at P_ ((int c, EMACS_INT pos, struct face *face, |
2be199f501f8
(LGLYPH_FROM, LGLYPH_TO, LGLYPH_SET_FROM)
Kenichi Handa <handa@m17n.org>
parents:
90531
diff
changeset
|
535 struct window *w, Lisp_Object object)); |
90400 | 536 |
91134
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
537 extern struct font *font_prepare_composition P_ ((struct composition *cmp, |
d8c3402ee3fa
(FONT_ENTITY_NOT_LOADABLE)
Kenichi Handa <handa@m17n.org>
parents:
91114
diff
changeset
|
538 FRAME_PTR f)); |
90400 | 539 |
90885
ecd61e98251d
* font.h (font_put_extra): Moved declaration from font.c.
Jason Rumney <jasonr@gnu.org>
parents:
90864
diff
changeset
|
540 extern Lisp_Object font_put_extra P_ ((Lisp_Object font, Lisp_Object prop, |
ecd61e98251d
* font.h (font_put_extra): Moved declaration from font.c.
Jason Rumney <jasonr@gnu.org>
parents:
90864
diff
changeset
|
541 Lisp_Object val)); |
90400 | 542 |
91114
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
543 extern int font_put_frame_data P_ ((FRAME_PTR f, |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
544 struct font_driver *driver, |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
545 void *data)); |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
546 extern void *font_get_frame_data P_ ((FRAME_PTR f, |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
547 struct font_driver *driver)); |
ce50ee0149be
(struct font_bitmap): New member bits_per_pixel.
Kenichi Handa <handa@m17n.org>
parents:
91033
diff
changeset
|
548 |
90400 | 549 #ifdef HAVE_FREETYPE |
550 extern struct font_driver ftfont_driver; | |
551 #endif /* HAVE_FREETYPE */ | |
552 #ifdef HAVE_X_WINDOWS | |
553 extern struct font_driver xfont_driver; | |
554 extern struct font_driver ftxfont_driver; | |
555 #ifdef HAVE_XFT | |
556 extern struct font_driver xftfont_driver; | |
557 #endif /* HAVE_XFT */ | |
558 #endif /* HAVE_X_WINDOWS */ | |
559 #ifdef WINDOWSNT | |
560 extern struct font_driver w32font_driver; | |
561 #endif /* WINDOWSNT */ | |
562 #ifdef MAC_OS | |
563 extern struct font_driver atmfont_driver; | |
564 #endif /* MAC_OS */ | |
565 | |
566 #endif /* not EMACS_FONT_H */ | |
90427 | 567 |
568 /* arch-tag: 3b7260c3-5bec-4d6b-a0db-95c1b431b1a2 | |
569 (do not change this comment) */ |