ReactOS 0.4.16-dev-1025-gd3456f5
ftdrv.h
Go to the documentation of this file.
1/****************************************************************************
2 *
3 * ftdrv.h
4 *
5 * FreeType internal font driver interface (specification).
6 *
7 * Copyright (C) 1996-2019 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
9 *
10 * This file is part of the FreeType project, and may only be used,
11 * modified, and distributed under the terms of the FreeType project
12 * license, LICENSE.TXT. By continuing to use, modify, or distribute
13 * this file you indicate that you have read the license and
14 * understand and accept it fully.
15 *
16 */
17
18
19#ifndef FTDRV_H_
20#define FTDRV_H_
21
22
23#include <ft2build.h>
24#include FT_MODULE_H
25
26
28
29
30 typedef FT_Error
33 FT_Int typeface_index,
34 FT_Int num_params,
35 FT_Parameter* parameters );
36
37 typedef void
39
40
41 typedef FT_Error
43
44 typedef void
46
47
48 typedef FT_Error
50
51 typedef void
53
54
55 typedef FT_Error
57 FT_Size_Request req );
58
59 typedef FT_Error
61 FT_ULong size_index );
62
63 typedef FT_Error
66 FT_UInt glyph_index,
67 FT_Int32 load_flags );
68
69
70 typedef FT_Error
75
76
77 typedef FT_Error
80
81
82 typedef FT_Error
86 FT_Int32 flags,
87 FT_Fixed* advances );
88
89
90 /**************************************************************************
91 *
92 * @struct:
93 * FT_Driver_ClassRec
94 *
95 * @description:
96 * The font driver class. This structure mostly contains pointers to
97 * driver methods.
98 *
99 * @fields:
100 * root ::
101 * The parent module.
102 *
103 * face_object_size ::
104 * The size of a face object in bytes.
105 *
106 * size_object_size ::
107 * The size of a size object in bytes.
108 *
109 * slot_object_size ::
110 * The size of a glyph object in bytes.
111 *
112 * init_face ::
113 * The format-specific face constructor.
114 *
115 * done_face ::
116 * The format-specific face destructor.
117 *
118 * init_size ::
119 * The format-specific size constructor.
120 *
121 * done_size ::
122 * The format-specific size destructor.
123 *
124 * init_slot ::
125 * The format-specific slot constructor.
126 *
127 * done_slot ::
128 * The format-specific slot destructor.
129 *
130 *
131 * load_glyph ::
132 * A function handle to load a glyph to a slot. This field is
133 * mandatory!
134 *
135 * get_kerning ::
136 * A function handle to return the unscaled kerning for a given pair of
137 * glyphs. Can be set to 0 if the format doesn't support kerning.
138 *
139 * attach_file ::
140 * This function handle is used to read additional data for a face from
141 * another file/stream. For example, this can be used to add data from
142 * AFM or PFM files on a Type 1 face, or a CIDMap on a CID-keyed face.
143 *
144 * get_advances ::
145 * A function handle used to return advance widths of 'count' glyphs
146 * (in font units), starting at 'first'. The 'vertical' flag must be
147 * set to get vertical advance heights. The 'advances' buffer is
148 * caller-allocated. The idea of this function is to be able to
149 * perform device-independent text layout without loading a single
150 * glyph image.
151 *
152 * request_size ::
153 * A handle to a function used to request the new character size. Can
154 * be set to 0 if the scaling done in the base layer suffices.
155 *
156 * select_size ::
157 * A handle to a function used to select a new fixed size. It is used
158 * only if @FT_FACE_FLAG_FIXED_SIZES is set. Can be set to 0 if the
159 * scaling done in the base layer suffices.
160 * @note:
161 * Most function pointers, with the exception of `load_glyph`, can be set
162 * to 0 to indicate a default behaviour.
163 */
164 typedef struct FT_Driver_ClassRec_
165 {
167
171
174
177
180
182
186
187 /* since version 2.2 */
190
192
193
194 /**************************************************************************
195 *
196 * @macro:
197 * FT_DECLARE_DRIVER
198 *
199 * @description:
200 * Used to create a forward declaration of an FT_Driver_ClassRec struct
201 * instance.
202 *
203 * @macro:
204 * FT_DEFINE_DRIVER
205 *
206 * @description:
207 * Used to initialize an instance of FT_Driver_ClassRec struct.
208 *
209 * `ftinit.c` (ft_create_default_module_classes) already contains a
210 * mechanism to call these functions for the default modules described in
211 * `ftmodule.h`.
212 *
213 * The struct will be allocated in the global scope (or the scope where
214 * the macro is used).
215 */
216#define FT_DECLARE_DRIVER( class_ ) \
217 FT_CALLBACK_TABLE \
218 const FT_Driver_ClassRec class_;
219
220#define FT_DEFINE_DRIVER( \
221 class_, \
222 flags_, \
223 size_, \
224 name_, \
225 version_, \
226 requires_, \
227 interface_, \
228 init_, \
229 done_, \
230 get_interface_, \
231 face_object_size_, \
232 size_object_size_, \
233 slot_object_size_, \
234 init_face_, \
235 done_face_, \
236 init_size_, \
237 done_size_, \
238 init_slot_, \
239 done_slot_, \
240 load_glyph_, \
241 get_kerning_, \
242 attach_file_, \
243 get_advances_, \
244 request_size_, \
245 select_size_ ) \
246 FT_CALLBACK_TABLE_DEF \
247 const FT_Driver_ClassRec class_ = \
248 { \
249 FT_DEFINE_ROOT_MODULE( flags_, \
250 size_, \
251 name_, \
252 version_, \
253 requires_, \
254 interface_, \
255 init_, \
256 done_, \
257 get_interface_ ) \
258 \
259 face_object_size_, \
260 size_object_size_, \
261 slot_object_size_, \
262 \
263 init_face_, \
264 done_face_, \
265 \
266 init_size_, \
267 done_size_, \
268 \
269 init_slot_, \
270 done_slot_, \
271 \
272 load_glyph_, \
273 \
274 get_kerning_, \
275 attach_file_, \
276 get_advances_, \
277 \
278 request_size_, \
279 select_size_ \
280 };
281
282
284
285#endif /* FTDRV_H_ */
286
287
288/* END */
WORD face[3]
Definition: mesh.c:4747
void(* FT_Face_DoneFunc)(FT_Face face)
Definition: ftdrv.h:38
FT_Error(* FT_Size_RequestFunc)(FT_Size size, FT_Size_Request req)
Definition: ftdrv.h:56
FT_Error(* FT_Slot_LoadFunc)(FT_GlyphSlot slot, FT_Size size, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: ftdrv.h:64
FT_Error(* FT_Face_GetKerningFunc)(FT_Face face, FT_UInt left_glyph, FT_UInt right_glyph, FT_Vector *kerning)
Definition: ftdrv.h:71
struct FT_Driver_ClassRec_ FT_Driver_ClassRec
void(* FT_Size_DoneFunc)(FT_Size size)
Definition: ftdrv.h:45
FT_Error(* FT_Slot_InitFunc)(FT_GlyphSlot slot)
Definition: ftdrv.h:49
FT_Error(* FT_Face_AttachFunc)(FT_Face face, FT_Stream stream)
Definition: ftdrv.h:78
FT_Error(* FT_Size_InitFunc)(FT_Size size)
Definition: ftdrv.h:42
struct FT_Driver_ClassRec_ * FT_Driver_Class
void(* FT_Slot_DoneFunc)(FT_GlyphSlot slot)
Definition: ftdrv.h:52
FT_Error(* FT_Face_GetAdvancesFunc)(FT_Face face, FT_UInt first, FT_UInt count, FT_Int32 flags, FT_Fixed *advances)
Definition: ftdrv.h:83
FT_Error(* FT_Size_SelectFunc)(FT_Size size, FT_ULong size_index)
Definition: ftdrv.h:60
FT_BEGIN_HEADER typedef FT_Error(* FT_Face_InitFunc)(FT_Stream stream, FT_Face face, FT_Int typeface_index, FT_Int num_params, FT_Parameter *parameters)
Definition: ftdrv.h:31
#define FT_END_HEADER
Definition: ftheader.h:54
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
unsigned long FT_ULong
Definition: fttypes.h:253
signed long FT_Fixed
Definition: fttypes.h:287
int FT_Error
Definition: fttypes.h:299
signed long FT_Long
Definition: fttypes.h:242
unsigned int FT_UInt
Definition: fttypes.h:231
signed int FT_Int
Definition: fttypes.h:220
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLbitfield flags
Definition: glext.h:7161
const GLint * first
Definition: glext.h:5794
FT_Size_RequestFunc request_size
Definition: ftdrv.h:188
FT_Module_Class root
Definition: ftdrv.h:166
FT_Size_InitFunc init_size
Definition: ftdrv.h:175
FT_Long face_object_size
Definition: ftdrv.h:168
FT_Size_SelectFunc select_size
Definition: ftdrv.h:189
FT_Face_GetKerningFunc get_kerning
Definition: ftdrv.h:183
FT_Long size_object_size
Definition: ftdrv.h:169
FT_Slot_LoadFunc load_glyph
Definition: ftdrv.h:181
FT_Slot_DoneFunc done_slot
Definition: ftdrv.h:179
FT_Size_DoneFunc done_size
Definition: ftdrv.h:176
FT_Face_InitFunc init_face
Definition: ftdrv.h:172
FT_Face_DoneFunc done_face
Definition: ftdrv.h:173
FT_Face_AttachFunc attach_file
Definition: ftdrv.h:184
FT_Face_GetAdvancesFunc get_advances
Definition: ftdrv.h:185
FT_Long slot_object_size
Definition: ftdrv.h:170
FT_Slot_InitFunc init_slot
Definition: ftdrv.h:178
Definition: parse.h:23
FT_UInt FT_UInt FT_Vector * kerning
Definition: ttdriver.c:207
FT_UInt left_glyph
Definition: ttdriver.c:204
FT_UInt FT_UInt right_glyph
Definition: ttdriver.c:205
struct _slot slot
Definition: vfat.h:196