sync with trunk r46493
[reactos.git] / lib / 3rdparty / freetype / include / freetype / internal / ftobjs.h
1 /***************************************************************************/
2 /* */
3 /* ftobjs.h */
4 /* */
5 /* The FreeType private base classes (specification). */
6 /* */
7 /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 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 /*************************************************************************/
20 /* */
21 /* This file contains the definition of all internal FreeType classes. */
22 /* */
23 /*************************************************************************/
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
39 #ifdef FT_CONFIG_OPTION_INCREMENTAL
40 #include FT_INCREMENTAL_H
41 #endif
42
43
44 FT_BEGIN_HEADER
45
46
47 /*************************************************************************/
48 /* */
49 /* Some generic definitions. */
50 /* */
51 #ifndef TRUE
52 #define TRUE 1
53 #endif
54
55 #ifndef FALSE
56 #define FALSE 0
57 #endif
58
59 #ifndef NULL
60 #define NULL (void*)0
61 #endif
62
63
64 /*************************************************************************/
65 /* */
66 /* The min and max functions missing in C. As usual, be careful not to */
67 /* write things like FT_MIN( a++, b++ ) to avoid side effects. */
68 /* */
69 #define FT_MIN( a, b ) ( (a) < (b) ? (a) : (b) )
70 #define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
71
72 #define FT_ABS( a ) ( (a) < 0 ? -(a) : (a) )
73
74
75 #define FT_PAD_FLOOR( x, n ) ( (x) & ~((n)-1) )
76 #define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n )
77 #define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + ((n)-1), n )
78
79 #define FT_PIX_FLOOR( x ) ( (x) & ~63 )
80 #define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
81 #define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
82
83
84 /*
85 * Return the highest power of 2 that is <= value; this correspond to
86 * the highest bit in a given 32-bit value.
87 */
88 FT_BASE( FT_UInt32 )
89 ft_highpow2( FT_UInt32 value );
90
91
92 /*
93 * character classification functions -- since these are used to parse
94 * font files, we must not use those in <ctypes.h> which are
95 * locale-dependent
96 */
97 #define ft_isdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U )
98
99 #define ft_isxdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U || \
100 ( (unsigned)(x) - 'a' ) < 6U || \
101 ( (unsigned)(x) - 'A' ) < 6U )
102
103 /* the next two macros assume ASCII representation */
104 #define ft_isupper( x ) ( ( (unsigned)(x) - 'A' ) < 26U )
105 #define ft_islower( x ) ( ( (unsigned)(x) - 'a' ) < 26U )
106
107 #define ft_isalpha( x ) ( ft_isupper( x ) || ft_islower( x ) )
108 #define ft_isalnum( x ) ( ft_isdigit( x ) || ft_isalpha( x ) )
109
110
111 /*************************************************************************/
112 /*************************************************************************/
113 /*************************************************************************/
114 /**** ****/
115 /**** ****/
116 /**** C H A R M A P S ****/
117 /**** ****/
118 /**** ****/
119 /*************************************************************************/
120 /*************************************************************************/
121 /*************************************************************************/
122
123 /* handle to internal charmap object */
124 typedef struct FT_CMapRec_* FT_CMap;
125
126 /* handle to charmap class structure */
127 typedef const struct FT_CMap_ClassRec_* FT_CMap_Class;
128
129 /* internal charmap object structure */
130 typedef struct FT_CMapRec_
131 {
132 FT_CharMapRec charmap;
133 FT_CMap_Class clazz;
134
135 } FT_CMapRec;
136
137 /* typecase any pointer to a charmap handle */
138 #define FT_CMAP( x ) ((FT_CMap)( x ))
139
140 /* obvious macros */
141 #define FT_CMAP_PLATFORM_ID( x ) FT_CMAP( x )->charmap.platform_id
142 #define FT_CMAP_ENCODING_ID( x ) FT_CMAP( x )->charmap.encoding_id
143 #define FT_CMAP_ENCODING( x ) FT_CMAP( x )->charmap.encoding
144 #define FT_CMAP_FACE( x ) FT_CMAP( x )->charmap.face
145
146
147 /* class method definitions */
148 typedef FT_Error
149 (*FT_CMap_InitFunc)( FT_CMap cmap,
150 FT_Pointer init_data );
151
152 typedef void
153 (*FT_CMap_DoneFunc)( FT_CMap cmap );
154
155 typedef FT_UInt
156 (*FT_CMap_CharIndexFunc)( FT_CMap cmap,
157 FT_UInt32 char_code );
158
159 typedef FT_UInt
160 (*FT_CMap_CharNextFunc)( FT_CMap cmap,
161 FT_UInt32 *achar_code );
162
163
164 typedef struct FT_CMap_ClassRec_
165 {
166 FT_ULong size;
167 FT_CMap_InitFunc init;
168 FT_CMap_DoneFunc done;
169 FT_CMap_CharIndexFunc char_index;
170 FT_CMap_CharNextFunc char_next;
171
172 } FT_CMap_ClassRec;
173
174
175 /* create a new charmap and add it to charmap->face */
176 FT_BASE( FT_Error )
177 FT_CMap_New( FT_CMap_Class clazz,
178 FT_Pointer init_data,
179 FT_CharMap charmap,
180 FT_CMap *acmap );
181
182 /* destroy a charmap and remove it from face's list */
183 FT_BASE( void )
184 FT_CMap_Done( FT_CMap cmap );
185
186
187 /*************************************************************************/
188 /* */
189 /* <Struct> */
190 /* FT_Face_InternalRec */
191 /* */
192 /* <Description> */
193 /* This structure contains the internal fields of each FT_Face */
194 /* object. These fields may change between different releases of */
195 /* FreeType. */
196 /* */
197 /* <Fields> */
198 /* max_points :: */
199 /* The maximal number of points used to store the vectorial outline */
200 /* of any glyph in this face. If this value cannot be known in */
201 /* advance, or if the face isn't scalable, this should be set to 0. */
202 /* Only relevant for scalable formats. */
203 /* */
204 /* max_contours :: */
205 /* The maximal number of contours used to store the vectorial */
206 /* outline of any glyph in this face. If this value cannot be */
207 /* known in advance, or if the face isn't scalable, this should be */
208 /* set to 0. Only relevant for scalable formats. */
209 /* */
210 /* transform_matrix :: */
211 /* A 2x2 matrix of 16.16 coefficients used to transform glyph */
212 /* outlines after they are loaded from the font. Only used by the */
213 /* convenience functions. */
214 /* */
215 /* transform_delta :: */
216 /* A translation vector used to transform glyph outlines after they */
217 /* are loaded from the font. Only used by the convenience */
218 /* functions. */
219 /* */
220 /* transform_flags :: */
221 /* Some flags used to classify the transform. Only used by the */
222 /* convenience functions. */
223 /* */
224 /* services :: */
225 /* A cache for frequently used services. It should be only */
226 /* accessed with the macro `FT_FACE_LOOKUP_SERVICE'. */
227 /* */
228 /* incremental_interface :: */
229 /* If non-null, the interface through which glyph data and metrics */
230 /* are loaded incrementally for faces that do not provide all of */
231 /* this data when first opened. This field exists only if */
232 /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
233 /* */
234 /* ignore_unpatented_hinter :: */
235 /* This boolean flag instructs the glyph loader to ignore the */
236 /* native font hinter, if one is found. This is exclusively used */
237 /* in the case when the unpatented hinter is compiled within the */
238 /* library. */
239 /* */
240 typedef struct FT_Face_InternalRec_
241 {
242 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
243 FT_UShort reserved1;
244 FT_Short reserved2;
245 #endif
246 FT_Matrix transform_matrix;
247 FT_Vector transform_delta;
248 FT_Int transform_flags;
249
250 FT_ServiceCacheRec services;
251
252 #ifdef FT_CONFIG_OPTION_INCREMENTAL
253 FT_Incremental_InterfaceRec* incremental_interface;
254 #endif
255
256 FT_Bool ignore_unpatented_hinter;
257
258 } FT_Face_InternalRec;
259
260
261 /*************************************************************************/
262 /* */
263 /* <Struct> */
264 /* FT_Slot_InternalRec */
265 /* */
266 /* <Description> */
267 /* This structure contains the internal fields of each FT_GlyphSlot */
268 /* object. These fields may change between different releases of */
269 /* FreeType. */
270 /* */
271 /* <Fields> */
272 /* loader :: The glyph loader object used to load outlines */
273 /* into the glyph slot. */
274 /* */
275 /* flags :: Possible values are zero or */
276 /* FT_GLYPH_OWN_BITMAP. The latter indicates */
277 /* that the FT_GlyphSlot structure owns the */
278 /* bitmap buffer. */
279 /* */
280 /* glyph_transformed :: Boolean. Set to TRUE when the loaded glyph */
281 /* must be transformed through a specific */
282 /* font transformation. This is _not_ the same */
283 /* as the face transform set through */
284 /* FT_Set_Transform(). */
285 /* */
286 /* glyph_matrix :: The 2x2 matrix corresponding to the glyph */
287 /* transformation, if necessary. */
288 /* */
289 /* glyph_delta :: The 2d translation vector corresponding to */
290 /* the glyph transformation, if necessary. */
291 /* */
292 /* glyph_hints :: Format-specific glyph hints management. */
293 /* */
294
295 #define FT_GLYPH_OWN_BITMAP 0x1
296
297 typedef struct FT_Slot_InternalRec_
298 {
299 FT_GlyphLoader loader;
300 FT_UInt flags;
301 FT_Bool glyph_transformed;
302 FT_Matrix glyph_matrix;
303 FT_Vector glyph_delta;
304 void* glyph_hints;
305
306 } FT_GlyphSlot_InternalRec;
307
308
309 /*************************************************************************/
310 /*************************************************************************/
311 /*************************************************************************/
312 /**** ****/
313 /**** ****/
314 /**** M O D U L E S ****/
315 /**** ****/
316 /**** ****/
317 /*************************************************************************/
318 /*************************************************************************/
319 /*************************************************************************/
320
321
322 /*************************************************************************/
323 /* */
324 /* <Struct> */
325 /* FT_ModuleRec */
326 /* */
327 /* <Description> */
328 /* A module object instance. */
329 /* */
330 /* <Fields> */
331 /* clazz :: A pointer to the module's class. */
332 /* */
333 /* library :: A handle to the parent library object. */
334 /* */
335 /* memory :: A handle to the memory manager. */
336 /* */
337 /* generic :: A generic structure for user-level extensibility (?). */
338 /* */
339 typedef struct FT_ModuleRec_
340 {
341 FT_Module_Class* clazz;
342 FT_Library library;
343 FT_Memory memory;
344 FT_Generic generic;
345
346 } FT_ModuleRec;
347
348
349 /* typecast an object to a FT_Module */
350 #define FT_MODULE( x ) ((FT_Module)( x ))
351 #define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
352 #define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
353 #define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
354
355
356 #define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
357 FT_MODULE_FONT_DRIVER )
358
359 #define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
360 FT_MODULE_RENDERER )
361
362 #define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
363 FT_MODULE_HINTER )
364
365 #define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
366 FT_MODULE_STYLER )
367
368 #define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS( x )->module_flags & \
369 FT_MODULE_DRIVER_SCALABLE )
370
371 #define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS( x )->module_flags & \
372 FT_MODULE_DRIVER_NO_OUTLINES )
373
374 #define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
375 FT_MODULE_DRIVER_HAS_HINTER )
376
377
378 /*************************************************************************/
379 /* */
380 /* <Function> */
381 /* FT_Get_Module_Interface */
382 /* */
383 /* <Description> */
384 /* Finds a module and returns its specific interface as a typeless */
385 /* pointer. */
386 /* */
387 /* <Input> */
388 /* library :: A handle to the library object. */
389 /* */
390 /* module_name :: The module's name (as an ASCII string). */
391 /* */
392 /* <Return> */
393 /* A module-specific interface if available, 0 otherwise. */
394 /* */
395 /* <Note> */
396 /* You should better be familiar with FreeType internals to know */
397 /* which module to look for, and what its interface is :-) */
398 /* */
399 FT_BASE( const void* )
400 FT_Get_Module_Interface( FT_Library library,
401 const char* mod_name );
402
403 FT_BASE( FT_Pointer )
404 ft_module_get_service( FT_Module module,
405 const char* service_id );
406
407 /* */
408
409
410 /*************************************************************************/
411 /*************************************************************************/
412 /*************************************************************************/
413 /**** ****/
414 /**** ****/
415 /**** FACE, SIZE & GLYPH SLOT OBJECTS ****/
416 /**** ****/
417 /**** ****/
418 /*************************************************************************/
419 /*************************************************************************/
420 /*************************************************************************/
421
422 /* a few macros used to perform easy typecasts with minimal brain damage */
423
424 #define FT_FACE( x ) ((FT_Face)(x))
425 #define FT_SIZE( x ) ((FT_Size)(x))
426 #define FT_SLOT( x ) ((FT_GlyphSlot)(x))
427
428 #define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
429 #define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
430 #define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
431 #define FT_FACE_STREAM( x ) FT_FACE( x )->stream
432
433 #define FT_SIZE_FACE( x ) FT_SIZE( x )->face
434 #define FT_SLOT_FACE( x ) FT_SLOT( x )->face
435
436 #define FT_FACE_SLOT( x ) FT_FACE( x )->glyph
437 #define FT_FACE_SIZE( x ) FT_FACE( x )->size
438
439
440 /*************************************************************************/
441 /* */
442 /* <Function> */
443 /* FT_New_GlyphSlot */
444 /* */
445 /* <Description> */
446 /* It is sometimes useful to have more than one glyph slot for a */
447 /* given face object. This function is used to create additional */
448 /* slots. All of them are automatically discarded when the face is */
449 /* destroyed. */
450 /* */
451 /* <Input> */
452 /* face :: A handle to a parent face object. */
453 /* */
454 /* <Output> */
455 /* aslot :: A handle to a new glyph slot object. */
456 /* */
457 /* <Return> */
458 /* FreeType error code. 0 means success. */
459 /* */
460 FT_BASE( FT_Error )
461 FT_New_GlyphSlot( FT_Face face,
462 FT_GlyphSlot *aslot );
463
464
465 /*************************************************************************/
466 /* */
467 /* <Function> */
468 /* FT_Done_GlyphSlot */
469 /* */
470 /* <Description> */
471 /* Destroys a given glyph slot. Remember however that all slots are */
472 /* automatically destroyed with its parent. Using this function is */
473 /* not always mandatory. */
474 /* */
475 /* <Input> */
476 /* slot :: A handle to a target glyph slot. */
477 /* */
478 FT_BASE( void )
479 FT_Done_GlyphSlot( FT_GlyphSlot slot );
480
481 /* */
482
483 #define FT_REQUEST_WIDTH( req ) \
484 ( (req)->horiResolution \
485 ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \
486 : (req)->width )
487
488 #define FT_REQUEST_HEIGHT( req ) \
489 ( (req)->vertResolution \
490 ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \
491 : (req)->height )
492
493
494 /* Set the metrics according to a bitmap strike. */
495 FT_BASE( void )
496 FT_Select_Metrics( FT_Face face,
497 FT_ULong strike_index );
498
499
500 /* Set the metrics according to a size request. */
501 FT_BASE( void )
502 FT_Request_Metrics( FT_Face face,
503 FT_Size_Request req );
504
505
506 /* Match a size request against `available_sizes'. */
507 FT_BASE( FT_Error )
508 FT_Match_Size( FT_Face face,
509 FT_Size_Request req,
510 FT_Bool ignore_width,
511 FT_ULong* size_index );
512
513
514 /* Use the horizontal metrics to synthesize the vertical metrics. */
515 /* If `advance' is zero, it is also synthesized. */
516 FT_BASE( void )
517 ft_synthesize_vertical_metrics( FT_Glyph_Metrics* metrics,
518 FT_Pos advance );
519
520
521 /* Free the bitmap of a given glyphslot when needed (i.e., only when it */
522 /* was allocated with ft_glyphslot_alloc_bitmap). */
523 FT_BASE( void )
524 ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
525
526
527 /* Allocate a new bitmap buffer in a glyph slot. */
528 FT_BASE( FT_Error )
529 ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
530 FT_ULong size );
531
532
533 /* Set the bitmap buffer in a glyph slot to a given pointer. The buffer */
534 /* will not be freed by a later call to ft_glyphslot_free_bitmap. */
535 FT_BASE( void )
536 ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
537 FT_Byte* buffer );
538
539
540 /*************************************************************************/
541 /*************************************************************************/
542 /*************************************************************************/
543 /**** ****/
544 /**** ****/
545 /**** R E N D E R E R S ****/
546 /**** ****/
547 /**** ****/
548 /*************************************************************************/
549 /*************************************************************************/
550 /*************************************************************************/
551
552
553 #define FT_RENDERER( x ) ((FT_Renderer)( x ))
554 #define FT_GLYPH( x ) ((FT_Glyph)( x ))
555 #define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x ))
556 #define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
557
558
559 typedef struct FT_RendererRec_
560 {
561 FT_ModuleRec root;
562 FT_Renderer_Class* clazz;
563 FT_Glyph_Format glyph_format;
564 FT_Glyph_Class glyph_class;
565
566 FT_Raster raster;
567 FT_Raster_Render_Func raster_render;
568 FT_Renderer_RenderFunc render;
569
570 } FT_RendererRec;
571
572
573 /*************************************************************************/
574 /*************************************************************************/
575 /*************************************************************************/
576 /**** ****/
577 /**** ****/
578 /**** F O N T D R I V E R S ****/
579 /**** ****/
580 /**** ****/
581 /*************************************************************************/
582 /*************************************************************************/
583 /*************************************************************************/
584
585
586 /* typecast a module into a driver easily */
587 #define FT_DRIVER( x ) ((FT_Driver)(x))
588
589 /* typecast a module as a driver, and get its driver class */
590 #define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
591
592
593 /*************************************************************************/
594 /* */
595 /* <Struct> */
596 /* FT_DriverRec */
597 /* */
598 /* <Description> */
599 /* The root font driver class. A font driver is responsible for */
600 /* managing and loading font files of a given format. */
601 /* */
602 /* <Fields> */
603 /* root :: Contains the fields of the root module class. */
604 /* */
605 /* clazz :: A pointer to the font driver's class. Note that */
606 /* this is NOT root.clazz. `class' wasn't used */
607 /* as it is a reserved word in C++. */
608 /* */
609 /* faces_list :: The list of faces currently opened by this */
610 /* driver. */
611 /* */
612 /* extensions :: A typeless pointer to the driver's extensions */
613 /* registry, if they are supported through the */
614 /* configuration macro FT_CONFIG_OPTION_EXTENSIONS. */
615 /* */
616 /* glyph_loader :: The glyph loader for all faces managed by this */
617 /* driver. This object isn't defined for unscalable */
618 /* formats. */
619 /* */
620 typedef struct FT_DriverRec_
621 {
622 FT_ModuleRec root;
623 FT_Driver_Class clazz;
624
625 FT_ListRec faces_list;
626 void* extensions;
627
628 FT_GlyphLoader glyph_loader;
629
630 } FT_DriverRec;
631
632
633 /*************************************************************************/
634 /*************************************************************************/
635 /*************************************************************************/
636 /**** ****/
637 /**** ****/
638 /**** L I B R A R I E S ****/
639 /**** ****/
640 /**** ****/
641 /*************************************************************************/
642 /*************************************************************************/
643 /*************************************************************************/
644
645
646 /* This hook is used by the TrueType debugger. It must be set to an */
647 /* alternate truetype bytecode interpreter function. */
648 #define FT_DEBUG_HOOK_TRUETYPE 0
649
650
651 /* Set this debug hook to a non-null pointer to force unpatented hinting */
652 /* for all faces when both TT_USE_BYTECODE_INTERPRETER and */
653 /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. This is only used */
654 /* during debugging. */
655 #define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
656
657
658 typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
659 FT_Render_Mode render_mode,
660 FT_Library library );
661
662
663 /*************************************************************************/
664 /* */
665 /* <Struct> */
666 /* FT_LibraryRec */
667 /* */
668 /* <Description> */
669 /* The FreeType library class. This is the root of all FreeType */
670 /* data. Use FT_New_Library() to create a library object, and */
671 /* FT_Done_Library() to discard it and all child objects. */
672 /* */
673 /* <Fields> */
674 /* memory :: The library's memory object. Manages memory */
675 /* allocation. */
676 /* */
677 /* generic :: Client data variable. Used to extend the */
678 /* Library class by higher levels and clients. */
679 /* */
680 /* version_major :: The major version number of the library. */
681 /* */
682 /* version_minor :: The minor version number of the library. */
683 /* */
684 /* version_patch :: The current patch level of the library. */
685 /* */
686 /* num_modules :: The number of modules currently registered */
687 /* within this library. This is set to 0 for new */
688 /* libraries. New modules are added through the */
689 /* FT_Add_Module() API function. */
690 /* */
691 /* modules :: A table used to store handles to the currently */
692 /* registered modules. Note that each font driver */
693 /* contains a list of its opened faces. */
694 /* */
695 /* renderers :: The list of renderers currently registered */
696 /* within the library. */
697 /* */
698 /* cur_renderer :: The current outline renderer. This is a */
699 /* shortcut used to avoid parsing the list on */
700 /* each call to FT_Outline_Render(). It is a */
701 /* handle to the current renderer for the */
702 /* FT_GLYPH_FORMAT_OUTLINE format. */
703 /* */
704 /* auto_hinter :: XXX */
705 /* */
706 /* raster_pool :: The raster object's render pool. This can */
707 /* ideally be changed dynamically at run-time. */
708 /* */
709 /* raster_pool_size :: The size of the render pool in bytes. */
710 /* */
711 /* debug_hooks :: XXX */
712 /* */
713 typedef struct FT_LibraryRec_
714 {
715 FT_Memory memory; /* library's memory manager */
716
717 FT_Generic generic;
718
719 FT_Int version_major;
720 FT_Int version_minor;
721 FT_Int version_patch;
722
723 FT_UInt num_modules;
724 FT_Module modules[FT_MAX_MODULES]; /* module objects */
725
726 FT_ListRec renderers; /* list of renderers */
727 FT_Renderer cur_renderer; /* current outline renderer */
728 FT_Module auto_hinter;
729
730 FT_Byte* raster_pool; /* scan-line conversion */
731 /* render pool */
732 FT_ULong raster_pool_size; /* size of render pool in bytes */
733
734 FT_DebugHook_Func debug_hooks[4];
735
736 #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
737 FT_LcdFilter lcd_filter;
738 FT_Int lcd_extra; /* number of extra pixels */
739 FT_Byte lcd_weights[7]; /* filter weights, if any */
740 FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
741 #endif
742
743 } FT_LibraryRec;
744
745
746 FT_BASE( FT_Renderer )
747 FT_Lookup_Renderer( FT_Library library,
748 FT_Glyph_Format format,
749 FT_ListNode* node );
750
751 FT_BASE( FT_Error )
752 FT_Render_Glyph_Internal( FT_Library library,
753 FT_GlyphSlot slot,
754 FT_Render_Mode render_mode );
755
756 typedef const char*
757 (*FT_Face_GetPostscriptNameFunc)( FT_Face face );
758
759 typedef FT_Error
760 (*FT_Face_GetGlyphNameFunc)( FT_Face face,
761 FT_UInt glyph_index,
762 FT_Pointer buffer,
763 FT_UInt buffer_max );
764
765 typedef FT_UInt
766 (*FT_Face_GetGlyphNameIndexFunc)( FT_Face face,
767 FT_String* glyph_name );
768
769
770 #ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
771
772 /*************************************************************************/
773 /* */
774 /* <Function> */
775 /* FT_New_Memory */
776 /* */
777 /* <Description> */
778 /* Creates a new memory object. */
779 /* */
780 /* <Return> */
781 /* A pointer to the new memory object. 0 in case of error. */
782 /* */
783 FT_BASE( FT_Memory )
784 FT_New_Memory( void );
785
786
787 /*************************************************************************/
788 /* */
789 /* <Function> */
790 /* FT_Done_Memory */
791 /* */
792 /* <Description> */
793 /* Discards memory manager. */
794 /* */
795 /* <Input> */
796 /* memory :: A handle to the memory manager. */
797 /* */
798 FT_BASE( void )
799 FT_Done_Memory( FT_Memory memory );
800
801 #endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
802
803
804 /* Define default raster's interface. The default raster is located in */
805 /* `src/base/ftraster.c'. */
806 /* */
807 /* Client applications can register new rasters through the */
808 /* FT_Set_Raster() API. */
809
810 #ifndef FT_NO_DEFAULT_RASTER
811 FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
812 #endif
813
814
815 FT_END_HEADER
816
817 #endif /* __FTOBJS_H__ */
818
819
820 /* END */