54876
|
1 |
/****************************************************************************
|
|
2 |
*
|
|
3 |
* ftobjs.h
|
|
4 |
*
|
|
5 |
* The FreeType private base classes (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 |
*/
|
49234
|
17 |
|
|
18 |
|
54876
|
19 |
/**************************************************************************
|
|
20 |
*
|
|
21 |
* This file contains the definition of all internal FreeType classes.
|
|
22 |
*
|
|
23 |
*/
|
49234
|
24 |
|
|
25 |
|
|
26 |
#ifndef FTOBJS_H_
|
|
27 |
#define FTOBJS_H_
|
|
28 |
|
|
29 |
#include <ft2build.h>
|
|
30 |
#include FT_RENDER_H
|
|
31 |
#include FT_SIZES_H
|
|
32 |
#include FT_LCD_FILTER_H
|
|
33 |
#include FT_INTERNAL_MEMORY_H
|
|
34 |
#include FT_INTERNAL_GLYPH_LOADER_H
|
|
35 |
#include FT_INTERNAL_DRIVER_H
|
|
36 |
#include FT_INTERNAL_AUTOHINT_H
|
|
37 |
#include FT_INTERNAL_SERVICE_H
|
|
38 |
#include FT_INTERNAL_CALC_H
|
|
39 |
|
|
40 |
#ifdef FT_CONFIG_OPTION_INCREMENTAL
|
|
41 |
#include FT_INCREMENTAL_H
|
|
42 |
#endif
|
|
43 |
|
|
44 |
|
|
45 |
FT_BEGIN_HEADER
|
|
46 |
|
|
47 |
|
54876
|
48 |
/**************************************************************************
|
|
49 |
*
|
|
50 |
* Some generic definitions.
|
|
51 |
*/
|
49234
|
52 |
#ifndef TRUE
|
|
53 |
#define TRUE 1
|
|
54 |
#endif
|
|
55 |
|
|
56 |
#ifndef FALSE
|
|
57 |
#define FALSE 0
|
|
58 |
#endif
|
|
59 |
|
|
60 |
#ifndef NULL
|
|
61 |
#define NULL (void*)0
|
|
62 |
#endif
|
|
63 |
|
|
64 |
|
54876
|
65 |
/**************************************************************************
|
|
66 |
*
|
|
67 |
* The min and max functions missing in C. As usual, be careful not to
|
|
68 |
* write things like FT_MIN( a++, b++ ) to avoid side effects.
|
|
69 |
*/
|
49234
|
70 |
#define FT_MIN( a, b ) ( (a) < (b) ? (a) : (b) )
|
|
71 |
#define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
|
|
72 |
|
|
73 |
#define FT_ABS( a ) ( (a) < 0 ? -(a) : (a) )
|
|
74 |
|
|
75 |
/*
|
54876
|
76 |
* Approximate sqrt(x*x+y*y) using the `alpha max plus beta min' algorithm.
|
|
77 |
* We use alpha = 1, beta = 3/8, giving us results with a largest error
|
|
78 |
* less than 7% compared to the exact value.
|
49234
|
79 |
*/
|
|
80 |
#define FT_HYPOT( x, y ) \
|
|
81 |
( x = FT_ABS( x ), \
|
|
82 |
y = FT_ABS( y ), \
|
|
83 |
x > y ? x + ( 3 * y >> 3 ) \
|
|
84 |
: y + ( 3 * x >> 3 ) )
|
|
85 |
|
|
86 |
/* we use FT_TYPEOF to suppress signedness compilation warnings */
|
|
87 |
#define FT_PAD_FLOOR( x, n ) ( (x) & ~FT_TYPEOF( x )( (n) - 1 ) )
|
|
88 |
#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + (n) / 2, n )
|
|
89 |
#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + (n) - 1, n )
|
|
90 |
|
|
91 |
#define FT_PIX_FLOOR( x ) ( (x) & ~FT_TYPEOF( x )63 )
|
|
92 |
#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
|
|
93 |
#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
|
|
94 |
|
|
95 |
/* specialized versions (for signed values) */
|
|
96 |
/* that don't produce run-time errors due to integer overflow */
|
|
97 |
#define FT_PAD_ROUND_LONG( x, n ) FT_PAD_FLOOR( ADD_LONG( (x), (n) / 2 ), \
|
|
98 |
n )
|
|
99 |
#define FT_PAD_CEIL_LONG( x, n ) FT_PAD_FLOOR( ADD_LONG( (x), (n) - 1 ), \
|
|
100 |
n )
|
|
101 |
#define FT_PIX_ROUND_LONG( x ) FT_PIX_FLOOR( ADD_LONG( (x), 32 ) )
|
|
102 |
#define FT_PIX_CEIL_LONG( x ) FT_PIX_FLOOR( ADD_LONG( (x), 63 ) )
|
|
103 |
|
|
104 |
#define FT_PAD_ROUND_INT32( x, n ) FT_PAD_FLOOR( ADD_INT32( (x), (n) / 2 ), \
|
|
105 |
n )
|
|
106 |
#define FT_PAD_CEIL_INT32( x, n ) FT_PAD_FLOOR( ADD_INT32( (x), (n) - 1 ), \
|
|
107 |
n )
|
|
108 |
#define FT_PIX_ROUND_INT32( x ) FT_PIX_FLOOR( ADD_INT32( (x), 32 ) )
|
|
109 |
#define FT_PIX_CEIL_INT32( x ) FT_PIX_FLOOR( ADD_INT32( (x), 63 ) )
|
|
110 |
|
|
111 |
|
|
112 |
/*
|
54876
|
113 |
* character classification functions -- since these are used to parse font
|
|
114 |
* files, we must not use those in <ctypes.h> which are locale-dependent
|
49234
|
115 |
*/
|
|
116 |
#define ft_isdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U )
|
|
117 |
|
|
118 |
#define ft_isxdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U || \
|
|
119 |
( (unsigned)(x) - 'a' ) < 6U || \
|
|
120 |
( (unsigned)(x) - 'A' ) < 6U )
|
|
121 |
|
|
122 |
/* the next two macros assume ASCII representation */
|
|
123 |
#define ft_isupper( x ) ( ( (unsigned)(x) - 'A' ) < 26U )
|
|
124 |
#define ft_islower( x ) ( ( (unsigned)(x) - 'a' ) < 26U )
|
|
125 |
|
|
126 |
#define ft_isalpha( x ) ( ft_isupper( x ) || ft_islower( x ) )
|
|
127 |
#define ft_isalnum( x ) ( ft_isdigit( x ) || ft_isalpha( x ) )
|
|
128 |
|
|
129 |
|
|
130 |
/*************************************************************************/
|
|
131 |
/*************************************************************************/
|
|
132 |
/*************************************************************************/
|
|
133 |
/**** ****/
|
|
134 |
/**** ****/
|
|
135 |
/**** C H A R M A P S ****/
|
|
136 |
/**** ****/
|
|
137 |
/**** ****/
|
|
138 |
/*************************************************************************/
|
|
139 |
/*************************************************************************/
|
|
140 |
/*************************************************************************/
|
|
141 |
|
|
142 |
/* handle to internal charmap object */
|
|
143 |
typedef struct FT_CMapRec_* FT_CMap;
|
|
144 |
|
|
145 |
/* handle to charmap class structure */
|
|
146 |
typedef const struct FT_CMap_ClassRec_* FT_CMap_Class;
|
|
147 |
|
|
148 |
/* internal charmap object structure */
|
|
149 |
typedef struct FT_CMapRec_
|
|
150 |
{
|
|
151 |
FT_CharMapRec charmap;
|
|
152 |
FT_CMap_Class clazz;
|
|
153 |
|
|
154 |
} FT_CMapRec;
|
|
155 |
|
50479
|
156 |
/* typecast any pointer to a charmap handle */
|
49234
|
157 |
#define FT_CMAP( x ) ( (FT_CMap)( x ) )
|
|
158 |
|
|
159 |
/* obvious macros */
|
|
160 |
#define FT_CMAP_PLATFORM_ID( x ) FT_CMAP( x )->charmap.platform_id
|
|
161 |
#define FT_CMAP_ENCODING_ID( x ) FT_CMAP( x )->charmap.encoding_id
|
|
162 |
#define FT_CMAP_ENCODING( x ) FT_CMAP( x )->charmap.encoding
|
|
163 |
#define FT_CMAP_FACE( x ) FT_CMAP( x )->charmap.face
|
|
164 |
|
|
165 |
|
|
166 |
/* class method definitions */
|
|
167 |
typedef FT_Error
|
|
168 |
(*FT_CMap_InitFunc)( FT_CMap cmap,
|
|
169 |
FT_Pointer init_data );
|
|
170 |
|
|
171 |
typedef void
|
|
172 |
(*FT_CMap_DoneFunc)( FT_CMap cmap );
|
|
173 |
|
|
174 |
typedef FT_UInt
|
|
175 |
(*FT_CMap_CharIndexFunc)( FT_CMap cmap,
|
|
176 |
FT_UInt32 char_code );
|
|
177 |
|
|
178 |
typedef FT_UInt
|
|
179 |
(*FT_CMap_CharNextFunc)( FT_CMap cmap,
|
|
180 |
FT_UInt32 *achar_code );
|
|
181 |
|
|
182 |
typedef FT_UInt
|
|
183 |
(*FT_CMap_CharVarIndexFunc)( FT_CMap cmap,
|
|
184 |
FT_CMap unicode_cmap,
|
|
185 |
FT_UInt32 char_code,
|
|
186 |
FT_UInt32 variant_selector );
|
|
187 |
|
54876
|
188 |
typedef FT_Int
|
49234
|
189 |
(*FT_CMap_CharVarIsDefaultFunc)( FT_CMap cmap,
|
|
190 |
FT_UInt32 char_code,
|
|
191 |
FT_UInt32 variant_selector );
|
|
192 |
|
|
193 |
typedef FT_UInt32 *
|
|
194 |
(*FT_CMap_VariantListFunc)( FT_CMap cmap,
|
|
195 |
FT_Memory mem );
|
|
196 |
|
|
197 |
typedef FT_UInt32 *
|
|
198 |
(*FT_CMap_CharVariantListFunc)( FT_CMap cmap,
|
|
199 |
FT_Memory mem,
|
|
200 |
FT_UInt32 char_code );
|
|
201 |
|
|
202 |
typedef FT_UInt32 *
|
|
203 |
(*FT_CMap_VariantCharListFunc)( FT_CMap cmap,
|
|
204 |
FT_Memory mem,
|
|
205 |
FT_UInt32 variant_selector );
|
|
206 |
|
|
207 |
|
|
208 |
typedef struct FT_CMap_ClassRec_
|
|
209 |
{
|
|
210 |
FT_ULong size;
|
|
211 |
|
|
212 |
FT_CMap_InitFunc init;
|
|
213 |
FT_CMap_DoneFunc done;
|
|
214 |
FT_CMap_CharIndexFunc char_index;
|
|
215 |
FT_CMap_CharNextFunc char_next;
|
|
216 |
|
|
217 |
/* Subsequent entries are special ones for format 14 -- the variant */
|
|
218 |
/* selector subtable which behaves like no other */
|
|
219 |
|
|
220 |
FT_CMap_CharVarIndexFunc char_var_index;
|
|
221 |
FT_CMap_CharVarIsDefaultFunc char_var_default;
|
|
222 |
FT_CMap_VariantListFunc variant_list;
|
|
223 |
FT_CMap_CharVariantListFunc charvariant_list;
|
|
224 |
FT_CMap_VariantCharListFunc variantchar_list;
|
|
225 |
|
|
226 |
} FT_CMap_ClassRec;
|
|
227 |
|
|
228 |
|
|
229 |
#define FT_DECLARE_CMAP_CLASS( class_ ) \
|
|
230 |
FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
|
|
231 |
|
|
232 |
#define FT_DEFINE_CMAP_CLASS( \
|
|
233 |
class_, \
|
|
234 |
size_, \
|
|
235 |
init_, \
|
|
236 |
done_, \
|
|
237 |
char_index_, \
|
|
238 |
char_next_, \
|
|
239 |
char_var_index_, \
|
|
240 |
char_var_default_, \
|
|
241 |
variant_list_, \
|
|
242 |
charvariant_list_, \
|
|
243 |
variantchar_list_ ) \
|
|
244 |
FT_CALLBACK_TABLE_DEF \
|
|
245 |
const FT_CMap_ClassRec class_ = \
|
|
246 |
{ \
|
|
247 |
size_, \
|
|
248 |
init_, \
|
|
249 |
done_, \
|
|
250 |
char_index_, \
|
|
251 |
char_next_, \
|
|
252 |
char_var_index_, \
|
|
253 |
char_var_default_, \
|
|
254 |
variant_list_, \
|
|
255 |
charvariant_list_, \
|
|
256 |
variantchar_list_ \
|
|
257 |
};
|
|
258 |
|
|
259 |
|
|
260 |
/* create a new charmap and add it to charmap->face */
|
|
261 |
FT_BASE( FT_Error )
|
|
262 |
FT_CMap_New( FT_CMap_Class clazz,
|
|
263 |
FT_Pointer init_data,
|
|
264 |
FT_CharMap charmap,
|
|
265 |
FT_CMap *acmap );
|
|
266 |
|
|
267 |
/* destroy a charmap and remove it from face's list */
|
|
268 |
FT_BASE( void )
|
|
269 |
FT_CMap_Done( FT_CMap cmap );
|
|
270 |
|
|
271 |
|
54876
|
272 |
/* add LCD padding to CBox */
|
49234
|
273 |
FT_BASE( void )
|
54876
|
274 |
ft_lcd_padding( FT_BBox* cbox,
|
|
275 |
FT_GlyphSlot slot,
|
|
276 |
FT_Render_Mode mode );
|
49234
|
277 |
|
|
278 |
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
|
279 |
|
|
280 |
typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
|
|
281 |
FT_Render_Mode render_mode,
|
|
282 |
FT_Byte* weights );
|
|
283 |
|
|
284 |
|
|
285 |
/* This is the default LCD filter, an in-place, 5-tap FIR filter. */
|
|
286 |
FT_BASE( void )
|
|
287 |
ft_lcd_filter_fir( FT_Bitmap* bitmap,
|
|
288 |
FT_Render_Mode mode,
|
|
289 |
FT_LcdFiveTapFilter weights );
|
|
290 |
|
|
291 |
#endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
|
|
292 |
|
54876
|
293 |
/**************************************************************************
|
|
294 |
*
|
|
295 |
* @struct:
|
|
296 |
* FT_Face_InternalRec
|
|
297 |
*
|
|
298 |
* @description:
|
|
299 |
* This structure contains the internal fields of each FT_Face object.
|
|
300 |
* These fields may change between different releases of FreeType.
|
|
301 |
*
|
|
302 |
* @fields:
|
|
303 |
* max_points ::
|
|
304 |
* The maximum number of points used to store the vectorial outline of
|
|
305 |
* any glyph in this face. If this value cannot be known in advance,
|
|
306 |
* or if the face isn't scalable, this should be set to 0. Only
|
|
307 |
* relevant for scalable formats.
|
|
308 |
*
|
|
309 |
* max_contours ::
|
|
310 |
* The maximum number of contours used to store the vectorial outline
|
|
311 |
* of any glyph in this face. If this value cannot be known in
|
|
312 |
* advance, or if the face isn't scalable, this should be set to 0.
|
|
313 |
* Only relevant for scalable formats.
|
|
314 |
*
|
|
315 |
* transform_matrix ::
|
|
316 |
* A 2x2 matrix of 16.16 coefficients used to transform glyph outlines
|
|
317 |
* after they are loaded from the font. Only used by the convenience
|
|
318 |
* functions.
|
|
319 |
*
|
|
320 |
* transform_delta ::
|
|
321 |
* A translation vector used to transform glyph outlines after they are
|
|
322 |
* loaded from the font. Only used by the convenience functions.
|
|
323 |
*
|
|
324 |
* transform_flags ::
|
|
325 |
* Some flags used to classify the transform. Only used by the
|
|
326 |
* convenience functions.
|
|
327 |
*
|
|
328 |
* services ::
|
|
329 |
* A cache for frequently used services. It should be only accessed
|
|
330 |
* with the macro `FT_FACE_LOOKUP_SERVICE`.
|
|
331 |
*
|
|
332 |
* incremental_interface ::
|
|
333 |
* If non-null, the interface through which glyph data and metrics are
|
|
334 |
* loaded incrementally for faces that do not provide all of this data
|
|
335 |
* when first opened. This field exists only if
|
|
336 |
* @FT_CONFIG_OPTION_INCREMENTAL is defined.
|
|
337 |
*
|
|
338 |
* no_stem_darkening ::
|
|
339 |
* Overrides the module-level default, see @stem-darkening[cff], for
|
|
340 |
* example. FALSE and TRUE toggle stem darkening on and off,
|
|
341 |
* respectively, value~-1 means to use the module/driver default.
|
|
342 |
*
|
|
343 |
* random_seed ::
|
|
344 |
* If positive, override the seed value for the CFF 'random' operator.
|
|
345 |
* Value~0 means to use the font's value. Value~-1 means to use the
|
|
346 |
* CFF driver's default.
|
|
347 |
*
|
|
348 |
* lcd_weights ::
|
|
349 |
* lcd_filter_func ::
|
|
350 |
* These fields specify the LCD filtering weights and callback function
|
|
351 |
* for ClearType-style subpixel rendering.
|
|
352 |
*
|
|
353 |
* refcount ::
|
|
354 |
* A counter initialized to~1 at the time an @FT_Face structure is
|
|
355 |
* created. @FT_Reference_Face increments this counter, and
|
|
356 |
* @FT_Done_Face only destroys a face if the counter is~1, otherwise it
|
|
357 |
* simply decrements it.
|
|
358 |
*/
|
49234
|
359 |
typedef struct FT_Face_InternalRec_
|
|
360 |
{
|
|
361 |
FT_Matrix transform_matrix;
|
|
362 |
FT_Vector transform_delta;
|
|
363 |
FT_Int transform_flags;
|
|
364 |
|
|
365 |
FT_ServiceCacheRec services;
|
|
366 |
|
|
367 |
#ifdef FT_CONFIG_OPTION_INCREMENTAL
|
|
368 |
FT_Incremental_InterfaceRec* incremental_interface;
|
|
369 |
#endif
|
|
370 |
|
|
371 |
FT_Char no_stem_darkening;
|
|
372 |
FT_Int32 random_seed;
|
|
373 |
|
|
374 |
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
|
375 |
FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */
|
|
376 |
FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
|
|
377 |
#endif
|
|
378 |
|
|
379 |
FT_Int refcount;
|
|
380 |
|
|
381 |
} FT_Face_InternalRec;
|
|
382 |
|
|
383 |
|
54876
|
384 |
/**************************************************************************
|
|
385 |
*
|
|
386 |
* @struct:
|
|
387 |
* FT_Slot_InternalRec
|
|
388 |
*
|
|
389 |
* @description:
|
|
390 |
* This structure contains the internal fields of each FT_GlyphSlot
|
|
391 |
* object. These fields may change between different releases of
|
|
392 |
* FreeType.
|
|
393 |
*
|
|
394 |
* @fields:
|
|
395 |
* loader ::
|
|
396 |
* The glyph loader object used to load outlines into the glyph slot.
|
|
397 |
*
|
|
398 |
* flags ::
|
|
399 |
* Possible values are zero or FT_GLYPH_OWN_BITMAP. The latter
|
|
400 |
* indicates that the FT_GlyphSlot structure owns the bitmap buffer.
|
|
401 |
*
|
|
402 |
* glyph_transformed ::
|
|
403 |
* Boolean. Set to TRUE when the loaded glyph must be transformed
|
|
404 |
* through a specific font transformation. This is _not_ the same as
|
|
405 |
* the face transform set through FT_Set_Transform().
|
|
406 |
*
|
|
407 |
* glyph_matrix ::
|
|
408 |
* The 2x2 matrix corresponding to the glyph transformation, if
|
|
409 |
* necessary.
|
|
410 |
*
|
|
411 |
* glyph_delta ::
|
|
412 |
* The 2d translation vector corresponding to the glyph transformation,
|
|
413 |
* if necessary.
|
|
414 |
*
|
|
415 |
* glyph_hints ::
|
|
416 |
* Format-specific glyph hints management.
|
|
417 |
*
|
|
418 |
* load_flags ::
|
|
419 |
* The load flags passed as an argument to @FT_Load_Glyph while
|
|
420 |
* initializing the glyph slot.
|
|
421 |
*/
|
49234
|
422 |
|
|
423 |
#define FT_GLYPH_OWN_BITMAP 0x1U
|
|
424 |
|
|
425 |
typedef struct FT_Slot_InternalRec_
|
|
426 |
{
|
|
427 |
FT_GlyphLoader loader;
|
|
428 |
FT_UInt flags;
|
|
429 |
FT_Bool glyph_transformed;
|
|
430 |
FT_Matrix glyph_matrix;
|
|
431 |
FT_Vector glyph_delta;
|
|
432 |
void* glyph_hints;
|
|
433 |
|
54876
|
434 |
FT_Int32 load_flags;
|
|
435 |
|
49234
|
436 |
} FT_GlyphSlot_InternalRec;
|
|
437 |
|
|
438 |
|
54876
|
439 |
/**************************************************************************
|
|
440 |
*
|
|
441 |
* @struct:
|
|
442 |
* FT_Size_InternalRec
|
|
443 |
*
|
|
444 |
* @description:
|
|
445 |
* This structure contains the internal fields of each FT_Size object.
|
|
446 |
*
|
|
447 |
* @fields:
|
|
448 |
* module_data ::
|
|
449 |
* Data specific to a driver module.
|
|
450 |
*
|
|
451 |
* autohint_mode ::
|
|
452 |
* The used auto-hinting mode.
|
|
453 |
*
|
|
454 |
* autohint_metrics ::
|
|
455 |
* Metrics used by the auto-hinter.
|
|
456 |
*
|
|
457 |
*/
|
49234
|
458 |
|
|
459 |
typedef struct FT_Size_InternalRec_
|
|
460 |
{
|
|
461 |
void* module_data;
|
|
462 |
|
|
463 |
FT_Render_Mode autohint_mode;
|
|
464 |
FT_Size_Metrics autohint_metrics;
|
|
465 |
|
|
466 |
} FT_Size_InternalRec;
|
|
467 |
|
|
468 |
|
|
469 |
/*************************************************************************/
|
|
470 |
/*************************************************************************/
|
|
471 |
/*************************************************************************/
|
|
472 |
/**** ****/
|
|
473 |
/**** ****/
|
|
474 |
/**** M O D U L E S ****/
|
|
475 |
/**** ****/
|
|
476 |
/**** ****/
|
|
477 |
/*************************************************************************/
|
|
478 |
/*************************************************************************/
|
|
479 |
/*************************************************************************/
|
|
480 |
|
|
481 |
|
54876
|
482 |
/**************************************************************************
|
|
483 |
*
|
|
484 |
* @struct:
|
|
485 |
* FT_ModuleRec
|
|
486 |
*
|
|
487 |
* @description:
|
|
488 |
* A module object instance.
|
|
489 |
*
|
|
490 |
* @fields:
|
|
491 |
* clazz ::
|
|
492 |
* A pointer to the module's class.
|
|
493 |
*
|
|
494 |
* library ::
|
|
495 |
* A handle to the parent library object.
|
|
496 |
*
|
|
497 |
* memory ::
|
|
498 |
* A handle to the memory manager.
|
|
499 |
*/
|
49234
|
500 |
typedef struct FT_ModuleRec_
|
|
501 |
{
|
|
502 |
FT_Module_Class* clazz;
|
|
503 |
FT_Library library;
|
|
504 |
FT_Memory memory;
|
|
505 |
|
|
506 |
} FT_ModuleRec;
|
|
507 |
|
|
508 |
|
|
509 |
/* typecast an object to an FT_Module */
|
|
510 |
#define FT_MODULE( x ) ( (FT_Module)(x) )
|
|
511 |
|
|
512 |
#define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
|
|
513 |
#define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
|
|
514 |
#define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
|
|
515 |
|
|
516 |
|
|
517 |
#define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
|
518 |
FT_MODULE_FONT_DRIVER )
|
|
519 |
|
|
520 |
#define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
|
521 |
FT_MODULE_RENDERER )
|
|
522 |
|
|
523 |
#define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
|
524 |
FT_MODULE_HINTER )
|
|
525 |
|
|
526 |
#define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
|
527 |
FT_MODULE_STYLER )
|
|
528 |
|
|
529 |
#define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
|
530 |
FT_MODULE_DRIVER_SCALABLE )
|
|
531 |
|
|
532 |
#define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS( x )->module_flags & \
|
|
533 |
FT_MODULE_DRIVER_NO_OUTLINES )
|
|
534 |
|
|
535 |
#define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
|
536 |
FT_MODULE_DRIVER_HAS_HINTER )
|
|
537 |
|
|
538 |
#define FT_DRIVER_HINTS_LIGHTLY( x ) ( FT_MODULE_CLASS( x )->module_flags & \
|
|
539 |
FT_MODULE_DRIVER_HINTS_LIGHTLY )
|
|
540 |
|
|
541 |
|
54876
|
542 |
/**************************************************************************
|
|
543 |
*
|
|
544 |
* @function:
|
|
545 |
* FT_Get_Module_Interface
|
|
546 |
*
|
|
547 |
* @description:
|
|
548 |
* Finds a module and returns its specific interface as a typeless
|
|
549 |
* pointer.
|
|
550 |
*
|
|
551 |
* @input:
|
|
552 |
* library ::
|
|
553 |
* A handle to the library object.
|
|
554 |
*
|
|
555 |
* module_name ::
|
|
556 |
* The module's name (as an ASCII string).
|
|
557 |
*
|
|
558 |
* @return:
|
|
559 |
* A module-specific interface if available, 0 otherwise.
|
|
560 |
*
|
|
561 |
* @note:
|
|
562 |
* You should better be familiar with FreeType internals to know which
|
|
563 |
* module to look for, and what its interface is :-)
|
|
564 |
*/
|
49234
|
565 |
FT_BASE( const void* )
|
|
566 |
FT_Get_Module_Interface( FT_Library library,
|
|
567 |
const char* mod_name );
|
|
568 |
|
|
569 |
FT_BASE( FT_Pointer )
|
|
570 |
ft_module_get_service( FT_Module module,
|
|
571 |
const char* service_id,
|
|
572 |
FT_Bool global );
|
|
573 |
|
|
574 |
#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
|
|
575 |
FT_BASE( FT_Error )
|
|
576 |
ft_property_string_set( FT_Library library,
|
|
577 |
const FT_String* module_name,
|
|
578 |
const FT_String* property_name,
|
|
579 |
FT_String* value );
|
|
580 |
#endif
|
|
581 |
|
|
582 |
/* */
|
|
583 |
|
|
584 |
|
|
585 |
/*************************************************************************/
|
|
586 |
/*************************************************************************/
|
|
587 |
/*************************************************************************/
|
|
588 |
/**** ****/
|
|
589 |
/**** ****/
|
|
590 |
/**** F A C E, S I Z E & G L Y P H S L O T O B J E C T S ****/
|
|
591 |
/**** ****/
|
|
592 |
/**** ****/
|
|
593 |
/*************************************************************************/
|
|
594 |
/*************************************************************************/
|
|
595 |
/*************************************************************************/
|
|
596 |
|
|
597 |
/* a few macros used to perform easy typecasts with minimal brain damage */
|
|
598 |
|
|
599 |
#define FT_FACE( x ) ( (FT_Face)(x) )
|
|
600 |
#define FT_SIZE( x ) ( (FT_Size)(x) )
|
|
601 |
#define FT_SLOT( x ) ( (FT_GlyphSlot)(x) )
|
|
602 |
|
|
603 |
#define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
|
|
604 |
#define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
|
|
605 |
#define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
|
|
606 |
#define FT_FACE_STREAM( x ) FT_FACE( x )->stream
|
|
607 |
|
|
608 |
#define FT_SIZE_FACE( x ) FT_SIZE( x )->face
|
|
609 |
#define FT_SLOT_FACE( x ) FT_SLOT( x )->face
|
|
610 |
|
|
611 |
#define FT_FACE_SLOT( x ) FT_FACE( x )->glyph
|
|
612 |
#define FT_FACE_SIZE( x ) FT_FACE( x )->size
|
|
613 |
|
|
614 |
|
54876
|
615 |
/**************************************************************************
|
|
616 |
*
|
|
617 |
* @function:
|
|
618 |
* FT_New_GlyphSlot
|
|
619 |
*
|
|
620 |
* @description:
|
|
621 |
* It is sometimes useful to have more than one glyph slot for a given
|
|
622 |
* face object. This function is used to create additional slots. All
|
|
623 |
* of them are automatically discarded when the face is destroyed.
|
|
624 |
*
|
|
625 |
* @input:
|
|
626 |
* face ::
|
|
627 |
* A handle to a parent face object.
|
|
628 |
*
|
|
629 |
* @output:
|
|
630 |
* aslot ::
|
|
631 |
* A handle to a new glyph slot object.
|
|
632 |
*
|
|
633 |
* @return:
|
|
634 |
* FreeType error code. 0 means success.
|
|
635 |
*/
|
49234
|
636 |
FT_BASE( FT_Error )
|
|
637 |
FT_New_GlyphSlot( FT_Face face,
|
|
638 |
FT_GlyphSlot *aslot );
|
|
639 |
|
|
640 |
|
54876
|
641 |
/**************************************************************************
|
|
642 |
*
|
|
643 |
* @function:
|
|
644 |
* FT_Done_GlyphSlot
|
|
645 |
*
|
|
646 |
* @description:
|
|
647 |
* Destroys a given glyph slot. Remember however that all slots are
|
|
648 |
* automatically destroyed with its parent. Using this function is not
|
|
649 |
* always mandatory.
|
|
650 |
*
|
|
651 |
* @input:
|
|
652 |
* slot ::
|
|
653 |
* A handle to a target glyph slot.
|
|
654 |
*/
|
49234
|
655 |
FT_BASE( void )
|
|
656 |
FT_Done_GlyphSlot( FT_GlyphSlot slot );
|
|
657 |
|
|
658 |
/* */
|
|
659 |
|
|
660 |
#define FT_REQUEST_WIDTH( req ) \
|
|
661 |
( (req)->horiResolution \
|
|
662 |
? ( (req)->width * (FT_Pos)(req)->horiResolution + 36 ) / 72 \
|
|
663 |
: (req)->width )
|
|
664 |
|
|
665 |
#define FT_REQUEST_HEIGHT( req ) \
|
|
666 |
( (req)->vertResolution \
|
|
667 |
? ( (req)->height * (FT_Pos)(req)->vertResolution + 36 ) / 72 \
|
|
668 |
: (req)->height )
|
|
669 |
|
|
670 |
|
|
671 |
/* Set the metrics according to a bitmap strike. */
|
|
672 |
FT_BASE( void )
|
|
673 |
FT_Select_Metrics( FT_Face face,
|
|
674 |
FT_ULong strike_index );
|
|
675 |
|
|
676 |
|
|
677 |
/* Set the metrics according to a size request. */
|
|
678 |
FT_BASE( void )
|
|
679 |
FT_Request_Metrics( FT_Face face,
|
|
680 |
FT_Size_Request req );
|
|
681 |
|
|
682 |
|
|
683 |
/* Match a size request against `available_sizes'. */
|
|
684 |
FT_BASE( FT_Error )
|
|
685 |
FT_Match_Size( FT_Face face,
|
|
686 |
FT_Size_Request req,
|
|
687 |
FT_Bool ignore_width,
|
|
688 |
FT_ULong* size_index );
|
|
689 |
|
|
690 |
|
|
691 |
/* Use the horizontal metrics to synthesize the vertical metrics. */
|
|
692 |
/* If `advance' is zero, it is also synthesized. */
|
|
693 |
FT_BASE( void )
|
|
694 |
ft_synthesize_vertical_metrics( FT_Glyph_Metrics* metrics,
|
|
695 |
FT_Pos advance );
|
|
696 |
|
|
697 |
|
|
698 |
/* Free the bitmap of a given glyphslot when needed (i.e., only when it */
|
|
699 |
/* was allocated with ft_glyphslot_alloc_bitmap). */
|
|
700 |
FT_BASE( void )
|
|
701 |
ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
|
|
702 |
|
|
703 |
|
54876
|
704 |
/* Preset bitmap metrics of an outline glyphslot prior to rendering */
|
|
705 |
/* and check whether the truncated bbox is too large for rendering. */
|
|
706 |
FT_BASE( FT_Bool )
|
49234
|
707 |
ft_glyphslot_preset_bitmap( FT_GlyphSlot slot,
|
|
708 |
FT_Render_Mode mode,
|
|
709 |
const FT_Vector* origin );
|
|
710 |
|
|
711 |
/* Allocate a new bitmap buffer in a glyph slot. */
|
|
712 |
FT_BASE( FT_Error )
|
|
713 |
ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
|
|
714 |
FT_ULong size );
|
|
715 |
|
|
716 |
|
|
717 |
/* Set the bitmap buffer in a glyph slot to a given pointer. The buffer */
|
|
718 |
/* will not be freed by a later call to ft_glyphslot_free_bitmap. */
|
|
719 |
FT_BASE( void )
|
|
720 |
ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
|
|
721 |
FT_Byte* buffer );
|
|
722 |
|
|
723 |
|
|
724 |
/*************************************************************************/
|
|
725 |
/*************************************************************************/
|
|
726 |
/*************************************************************************/
|
|
727 |
/**** ****/
|
|
728 |
/**** ****/
|
|
729 |
/**** R E N D E R E R S ****/
|
|
730 |
/**** ****/
|
|
731 |
/**** ****/
|
|
732 |
/*************************************************************************/
|
|
733 |
/*************************************************************************/
|
|
734 |
/*************************************************************************/
|
|
735 |
|
|
736 |
|
|
737 |
#define FT_RENDERER( x ) ( (FT_Renderer)(x) )
|
|
738 |
#define FT_GLYPH( x ) ( (FT_Glyph)(x) )
|
|
739 |
#define FT_BITMAP_GLYPH( x ) ( (FT_BitmapGlyph)(x) )
|
|
740 |
#define FT_OUTLINE_GLYPH( x ) ( (FT_OutlineGlyph)(x) )
|
|
741 |
|
|
742 |
|
|
743 |
typedef struct FT_RendererRec_
|
|
744 |
{
|
|
745 |
FT_ModuleRec root;
|
|
746 |
FT_Renderer_Class* clazz;
|
|
747 |
FT_Glyph_Format glyph_format;
|
|
748 |
FT_Glyph_Class glyph_class;
|
|
749 |
|
|
750 |
FT_Raster raster;
|
|
751 |
FT_Raster_Render_Func raster_render;
|
|
752 |
FT_Renderer_RenderFunc render;
|
|
753 |
|
|
754 |
} FT_RendererRec;
|
|
755 |
|
|
756 |
|
|
757 |
/*************************************************************************/
|
|
758 |
/*************************************************************************/
|
|
759 |
/*************************************************************************/
|
|
760 |
/**** ****/
|
|
761 |
/**** ****/
|
|
762 |
/**** F O N T D R I V E R S ****/
|
|
763 |
/**** ****/
|
|
764 |
/**** ****/
|
|
765 |
/*************************************************************************/
|
|
766 |
/*************************************************************************/
|
|
767 |
/*************************************************************************/
|
|
768 |
|
|
769 |
|
|
770 |
/* typecast a module into a driver easily */
|
|
771 |
#define FT_DRIVER( x ) ( (FT_Driver)(x) )
|
|
772 |
|
|
773 |
/* typecast a module as a driver, and get its driver class */
|
|
774 |
#define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
|
|
775 |
|
|
776 |
|
54876
|
777 |
/**************************************************************************
|
|
778 |
*
|
|
779 |
* @struct:
|
|
780 |
* FT_DriverRec
|
|
781 |
*
|
|
782 |
* @description:
|
|
783 |
* The root font driver class. A font driver is responsible for managing
|
|
784 |
* and loading font files of a given format.
|
|
785 |
*
|
|
786 |
* @fields:
|
|
787 |
* root ::
|
|
788 |
* Contains the fields of the root module class.
|
|
789 |
*
|
|
790 |
* clazz ::
|
|
791 |
* A pointer to the font driver's class. Note that this is NOT
|
|
792 |
* root.clazz. 'class' wasn't used as it is a reserved word in C++.
|
|
793 |
*
|
|
794 |
* faces_list ::
|
|
795 |
* The list of faces currently opened by this driver.
|
|
796 |
*
|
|
797 |
* glyph_loader ::
|
|
798 |
* Unused. Used to be glyph loader for all faces managed by this
|
|
799 |
* driver.
|
|
800 |
*/
|
49234
|
801 |
typedef struct FT_DriverRec_
|
|
802 |
{
|
|
803 |
FT_ModuleRec root;
|
|
804 |
FT_Driver_Class clazz;
|
|
805 |
FT_ListRec faces_list;
|
|
806 |
FT_GlyphLoader glyph_loader;
|
|
807 |
|
|
808 |
} FT_DriverRec;
|
|
809 |
|
|
810 |
|
|
811 |
/*************************************************************************/
|
|
812 |
/*************************************************************************/
|
|
813 |
/*************************************************************************/
|
|
814 |
/**** ****/
|
|
815 |
/**** ****/
|
|
816 |
/**** L I B R A R I E S ****/
|
|
817 |
/**** ****/
|
|
818 |
/**** ****/
|
|
819 |
/*************************************************************************/
|
|
820 |
/*************************************************************************/
|
|
821 |
/*************************************************************************/
|
|
822 |
|
|
823 |
|
54876
|
824 |
/**************************************************************************
|
|
825 |
*
|
|
826 |
* @struct:
|
|
827 |
* FT_LibraryRec
|
|
828 |
*
|
|
829 |
* @description:
|
|
830 |
* The FreeType library class. This is the root of all FreeType data.
|
|
831 |
* Use FT_New_Library() to create a library object, and FT_Done_Library()
|
|
832 |
* to discard it and all child objects.
|
|
833 |
*
|
|
834 |
* @fields:
|
|
835 |
* memory ::
|
|
836 |
* The library's memory object. Manages memory allocation.
|
|
837 |
*
|
|
838 |
* version_major ::
|
|
839 |
* The major version number of the library.
|
|
840 |
*
|
|
841 |
* version_minor ::
|
|
842 |
* The minor version number of the library.
|
|
843 |
*
|
|
844 |
* version_patch ::
|
|
845 |
* The current patch level of the library.
|
|
846 |
*
|
|
847 |
* num_modules ::
|
|
848 |
* The number of modules currently registered within this library.
|
|
849 |
* This is set to 0 for new libraries. New modules are added through
|
|
850 |
* the FT_Add_Module() API function.
|
|
851 |
*
|
|
852 |
* modules ::
|
|
853 |
* A table used to store handles to the currently registered
|
|
854 |
* modules. Note that each font driver contains a list of its opened
|
|
855 |
* faces.
|
|
856 |
*
|
|
857 |
* renderers ::
|
|
858 |
* The list of renderers currently registered within the library.
|
|
859 |
*
|
|
860 |
* cur_renderer ::
|
|
861 |
* The current outline renderer. This is a shortcut used to avoid
|
|
862 |
* parsing the list on each call to FT_Outline_Render(). It is a
|
|
863 |
* handle to the current renderer for the FT_GLYPH_FORMAT_OUTLINE
|
|
864 |
* format.
|
|
865 |
*
|
|
866 |
* auto_hinter ::
|
|
867 |
* The auto-hinter module interface.
|
|
868 |
*
|
|
869 |
* debug_hooks ::
|
|
870 |
* An array of four function pointers that allow debuggers to hook into
|
|
871 |
* a font format's interpreter. Currently, only the TrueType bytecode
|
|
872 |
* debugger uses this.
|
|
873 |
*
|
|
874 |
* lcd_weights ::
|
|
875 |
* The LCD filter weights for ClearType-style subpixel rendering.
|
|
876 |
*
|
|
877 |
* lcd_filter_func ::
|
|
878 |
* The LCD filtering callback function for for ClearType-style subpixel
|
|
879 |
* rendering.
|
|
880 |
*
|
|
881 |
* lcd_geometry ::
|
|
882 |
* This array specifies LCD subpixel geometry and controls Harmony LCD
|
|
883 |
* rendering technique, alternative to ClearType.
|
|
884 |
*
|
|
885 |
* pic_container ::
|
|
886 |
* Contains global structs and tables, instead of defining them
|
|
887 |
* globally.
|
|
888 |
*
|
|
889 |
* refcount ::
|
|
890 |
* A counter initialized to~1 at the time an @FT_Library structure is
|
|
891 |
* created. @FT_Reference_Library increments this counter, and
|
|
892 |
* @FT_Done_Library only destroys a library if the counter is~1,
|
|
893 |
* otherwise it simply decrements it.
|
|
894 |
*/
|
49234
|
895 |
typedef struct FT_LibraryRec_
|
|
896 |
{
|
|
897 |
FT_Memory memory; /* library's memory manager */
|
|
898 |
|
|
899 |
FT_Int version_major;
|
|
900 |
FT_Int version_minor;
|
|
901 |
FT_Int version_patch;
|
|
902 |
|
|
903 |
FT_UInt num_modules;
|
|
904 |
FT_Module modules[FT_MAX_MODULES]; /* module objects */
|
|
905 |
|
|
906 |
FT_ListRec renderers; /* list of renderers */
|
|
907 |
FT_Renderer cur_renderer; /* current outline renderer */
|
|
908 |
FT_Module auto_hinter;
|
|
909 |
|
|
910 |
FT_DebugHook_Func debug_hooks[4];
|
|
911 |
|
|
912 |
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
|
913 |
FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */
|
|
914 |
FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
|
54876
|
915 |
#else
|
|
916 |
FT_Vector lcd_geometry[3]; /* RGB subpixel positions */
|
49234
|
917 |
#endif
|
|
918 |
|
|
919 |
FT_Int refcount;
|
|
920 |
|
|
921 |
} FT_LibraryRec;
|
|
922 |
|
|
923 |
|
|
924 |
FT_BASE( FT_Renderer )
|
|
925 |
FT_Lookup_Renderer( FT_Library library,
|
|
926 |
FT_Glyph_Format format,
|
|
927 |
FT_ListNode* node );
|
|
928 |
|
|
929 |
FT_BASE( FT_Error )
|
|
930 |
FT_Render_Glyph_Internal( FT_Library library,
|
|
931 |
FT_GlyphSlot slot,
|
|
932 |
FT_Render_Mode render_mode );
|
|
933 |
|
|
934 |
typedef const char*
|
|
935 |
(*FT_Face_GetPostscriptNameFunc)( FT_Face face );
|
|
936 |
|
|
937 |
typedef FT_Error
|
|
938 |
(*FT_Face_GetGlyphNameFunc)( FT_Face face,
|
|
939 |
FT_UInt glyph_index,
|
|
940 |
FT_Pointer buffer,
|
|
941 |
FT_UInt buffer_max );
|
|
942 |
|
|
943 |
typedef FT_UInt
|
|
944 |
(*FT_Face_GetGlyphNameIndexFunc)( FT_Face face,
|
|
945 |
FT_String* glyph_name );
|
|
946 |
|
|
947 |
|
|
948 |
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
|
949 |
|
54876
|
950 |
/**************************************************************************
|
|
951 |
*
|
|
952 |
* @function:
|
|
953 |
* FT_New_Memory
|
|
954 |
*
|
|
955 |
* @description:
|
|
956 |
* Creates a new memory object.
|
|
957 |
*
|
|
958 |
* @return:
|
|
959 |
* A pointer to the new memory object. 0 in case of error.
|
|
960 |
*/
|
49234
|
961 |
FT_BASE( FT_Memory )
|
|
962 |
FT_New_Memory( void );
|
|
963 |
|
|
964 |
|
54876
|
965 |
/**************************************************************************
|
|
966 |
*
|
|
967 |
* @function:
|
|
968 |
* FT_Done_Memory
|
|
969 |
*
|
|
970 |
* @description:
|
|
971 |
* Discards memory manager.
|
|
972 |
*
|
|
973 |
* @input:
|
|
974 |
* memory ::
|
|
975 |
* A handle to the memory manager.
|
|
976 |
*/
|
49234
|
977 |
FT_BASE( void )
|
|
978 |
FT_Done_Memory( FT_Memory memory );
|
|
979 |
|
|
980 |
#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
|
|
981 |
|
|
982 |
|
|
983 |
/* Define default raster's interface. The default raster is located in */
|
|
984 |
/* `src/base/ftraster.c'. */
|
|
985 |
/* */
|
|
986 |
/* Client applications can register new rasters through the */
|
|
987 |
/* FT_Set_Raster() API. */
|
|
988 |
|
|
989 |
#ifndef FT_NO_DEFAULT_RASTER
|
|
990 |
FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
|
|
991 |
#endif
|
|
992 |
|
|
993 |
|
54876
|
994 |
/**************************************************************************
|
|
995 |
*
|
|
996 |
* @macro:
|
|
997 |
* FT_DEFINE_OUTLINE_FUNCS
|
|
998 |
*
|
|
999 |
* @description:
|
|
1000 |
* Used to initialize an instance of FT_Outline_Funcs struct. The struct
|
|
1001 |
* will be allocated in the global scope (or the scope where the macro is
|
|
1002 |
* used).
|
|
1003 |
*/
|
49234
|
1004 |
#define FT_DEFINE_OUTLINE_FUNCS( \
|
|
1005 |
class_, \
|
|
1006 |
move_to_, \
|
|
1007 |
line_to_, \
|
|
1008 |
conic_to_, \
|
|
1009 |
cubic_to_, \
|
|
1010 |
shift_, \
|
|
1011 |
delta_ ) \
|
|
1012 |
static const FT_Outline_Funcs class_ = \
|
|
1013 |
{ \
|
|
1014 |
move_to_, \
|
|
1015 |
line_to_, \
|
|
1016 |
conic_to_, \
|
|
1017 |
cubic_to_, \
|
|
1018 |
shift_, \
|
|
1019 |
delta_ \
|
|
1020 |
};
|
|
1021 |
|
|
1022 |
|
54876
|
1023 |
/**************************************************************************
|
|
1024 |
*
|
|
1025 |
* @macro:
|
|
1026 |
* FT_DEFINE_RASTER_FUNCS
|
|
1027 |
*
|
|
1028 |
* @description:
|
|
1029 |
* Used to initialize an instance of FT_Raster_Funcs struct. The struct
|
|
1030 |
* will be allocated in the global scope (or the scope where the macro is
|
|
1031 |
* used).
|
|
1032 |
*/
|
49234
|
1033 |
#define FT_DEFINE_RASTER_FUNCS( \
|
|
1034 |
class_, \
|
|
1035 |
glyph_format_, \
|
|
1036 |
raster_new_, \
|
|
1037 |
raster_reset_, \
|
|
1038 |
raster_set_mode_, \
|
|
1039 |
raster_render_, \
|
|
1040 |
raster_done_ ) \
|
|
1041 |
const FT_Raster_Funcs class_ = \
|
|
1042 |
{ \
|
|
1043 |
glyph_format_, \
|
|
1044 |
raster_new_, \
|
|
1045 |
raster_reset_, \
|
|
1046 |
raster_set_mode_, \
|
|
1047 |
raster_render_, \
|
|
1048 |
raster_done_ \
|
|
1049 |
};
|
|
1050 |
|
|
1051 |
|
|
1052 |
|
54876
|
1053 |
/**************************************************************************
|
|
1054 |
*
|
|
1055 |
* @macro:
|
|
1056 |
* FT_DEFINE_GLYPH
|
|
1057 |
*
|
|
1058 |
* @description:
|
|
1059 |
* The struct will be allocated in the global scope (or the scope where
|
|
1060 |
* the macro is used).
|
|
1061 |
*/
|
49234
|
1062 |
#define FT_DEFINE_GLYPH( \
|
|
1063 |
class_, \
|
|
1064 |
size_, \
|
|
1065 |
format_, \
|
|
1066 |
init_, \
|
|
1067 |
done_, \
|
|
1068 |
copy_, \
|
|
1069 |
transform_, \
|
|
1070 |
bbox_, \
|
|
1071 |
prepare_ ) \
|
|
1072 |
FT_CALLBACK_TABLE_DEF \
|
|
1073 |
const FT_Glyph_Class class_ = \
|
|
1074 |
{ \
|
|
1075 |
size_, \
|
|
1076 |
format_, \
|
|
1077 |
init_, \
|
|
1078 |
done_, \
|
|
1079 |
copy_, \
|
|
1080 |
transform_, \
|
|
1081 |
bbox_, \
|
|
1082 |
prepare_ \
|
|
1083 |
};
|
|
1084 |
|
|
1085 |
|
54876
|
1086 |
/**************************************************************************
|
|
1087 |
*
|
|
1088 |
* @macro:
|
|
1089 |
* FT_DECLARE_RENDERER
|
|
1090 |
*
|
|
1091 |
* @description:
|
|
1092 |
* Used to create a forward declaration of a FT_Renderer_Class struct
|
|
1093 |
* instance.
|
|
1094 |
*
|
|
1095 |
* @macro:
|
|
1096 |
* FT_DEFINE_RENDERER
|
|
1097 |
*
|
|
1098 |
* @description:
|
|
1099 |
* Used to initialize an instance of FT_Renderer_Class struct.
|
|
1100 |
*
|
|
1101 |
* The struct will be allocated in the global scope (or the scope where
|
|
1102 |
* the macro is used).
|
|
1103 |
*/
|
49234
|
1104 |
#define FT_DECLARE_RENDERER( class_ ) \
|
|
1105 |
FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
|
|
1106 |
|
|
1107 |
#define FT_DEFINE_RENDERER( \
|
|
1108 |
class_, \
|
|
1109 |
flags_, \
|
|
1110 |
size_, \
|
|
1111 |
name_, \
|
|
1112 |
version_, \
|
|
1113 |
requires_, \
|
|
1114 |
interface_, \
|
|
1115 |
init_, \
|
|
1116 |
done_, \
|
|
1117 |
get_interface_, \
|
|
1118 |
glyph_format_, \
|
|
1119 |
render_glyph_, \
|
|
1120 |
transform_glyph_, \
|
|
1121 |
get_glyph_cbox_, \
|
|
1122 |
set_mode_, \
|
|
1123 |
raster_class_ ) \
|
|
1124 |
FT_CALLBACK_TABLE_DEF \
|
|
1125 |
const FT_Renderer_Class class_ = \
|
|
1126 |
{ \
|
|
1127 |
FT_DEFINE_ROOT_MODULE( flags_, \
|
|
1128 |
size_, \
|
|
1129 |
name_, \
|
|
1130 |
version_, \
|
|
1131 |
requires_, \
|
|
1132 |
interface_, \
|
|
1133 |
init_, \
|
|
1134 |
done_, \
|
|
1135 |
get_interface_ ) \
|
|
1136 |
glyph_format_, \
|
|
1137 |
\
|
|
1138 |
render_glyph_, \
|
|
1139 |
transform_glyph_, \
|
|
1140 |
get_glyph_cbox_, \
|
|
1141 |
set_mode_, \
|
|
1142 |
\
|
|
1143 |
raster_class_ \
|
|
1144 |
};
|
|
1145 |
|
|
1146 |
|
54876
|
1147 |
/**************************************************************************
|
|
1148 |
*
|
|
1149 |
* @macro:
|
|
1150 |
* FT_DECLARE_MODULE
|
|
1151 |
*
|
|
1152 |
* @description:
|
|
1153 |
* Used to create a forward declaration of a FT_Module_Class struct
|
|
1154 |
* instance.
|
|
1155 |
*
|
|
1156 |
* @macro:
|
|
1157 |
* FT_DEFINE_MODULE
|
|
1158 |
*
|
|
1159 |
* @description:
|
|
1160 |
* Used to initialize an instance of an FT_Module_Class struct.
|
|
1161 |
*
|
|
1162 |
* The struct will be allocated in the global scope (or the scope where
|
|
1163 |
* the macro is used).
|
|
1164 |
*
|
|
1165 |
* @macro:
|
|
1166 |
* FT_DEFINE_ROOT_MODULE
|
|
1167 |
*
|
|
1168 |
* @description:
|
|
1169 |
* Used to initialize an instance of an FT_Module_Class struct inside
|
|
1170 |
* another struct that contains it or in a function that initializes that
|
|
1171 |
* containing struct.
|
|
1172 |
*/
|
49234
|
1173 |
#define FT_DECLARE_MODULE( class_ ) \
|
|
1174 |
FT_CALLBACK_TABLE \
|
|
1175 |
const FT_Module_Class class_;
|
|
1176 |
|
|
1177 |
#define FT_DEFINE_ROOT_MODULE( \
|
|
1178 |
flags_, \
|
|
1179 |
size_, \
|
|
1180 |
name_, \
|
|
1181 |
version_, \
|
|
1182 |
requires_, \
|
|
1183 |
interface_, \
|
|
1184 |
init_, \
|
|
1185 |
done_, \
|
|
1186 |
get_interface_ ) \
|
|
1187 |
{ \
|
|
1188 |
flags_, \
|
|
1189 |
size_, \
|
|
1190 |
\
|
|
1191 |
name_, \
|
|
1192 |
version_, \
|
|
1193 |
requires_, \
|
|
1194 |
\
|
|
1195 |
interface_, \
|
|
1196 |
\
|
|
1197 |
init_, \
|
|
1198 |
done_, \
|
|
1199 |
get_interface_, \
|
|
1200 |
},
|
|
1201 |
|
|
1202 |
#define FT_DEFINE_MODULE( \
|
|
1203 |
class_, \
|
|
1204 |
flags_, \
|
|
1205 |
size_, \
|
|
1206 |
name_, \
|
|
1207 |
version_, \
|
|
1208 |
requires_, \
|
|
1209 |
interface_, \
|
|
1210 |
init_, \
|
|
1211 |
done_, \
|
|
1212 |
get_interface_ ) \
|
|
1213 |
FT_CALLBACK_TABLE_DEF \
|
|
1214 |
const FT_Module_Class class_ = \
|
|
1215 |
{ \
|
|
1216 |
flags_, \
|
|
1217 |
size_, \
|
|
1218 |
\
|
|
1219 |
name_, \
|
|
1220 |
version_, \
|
|
1221 |
requires_, \
|
|
1222 |
\
|
|
1223 |
interface_, \
|
|
1224 |
\
|
|
1225 |
init_, \
|
|
1226 |
done_, \
|
|
1227 |
get_interface_, \
|
|
1228 |
};
|
|
1229 |
|
|
1230 |
|
|
1231 |
FT_END_HEADER
|
|
1232 |
|
|
1233 |
#endif /* FTOBJS_H_ */
|
|
1234 |
|
|
1235 |
|
|
1236 |
/* END */
|