annotate src/font.h @ 90691:1609d170cf69

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