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