Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
ftobjs.h
Go to the documentation of this file.
1 /***************************************************************************/
2 /* */
3 /* ftobjs.h */
4 /* */
5 /* The FreeType private base classes (specification). */
6 /* */
7 /* Copyright 1996-2006, 2008, 2010, 2012 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 #include FT_INTERNAL_PIC_H
39 
40 #ifdef FT_CONFIG_OPTION_INCREMENTAL
41 #include FT_INCREMENTAL_H
42 #endif
43 
44 
46 
47 
48  /*************************************************************************/
49  /* */
50  /* Some generic definitions. */
51  /* */
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 
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  /* */
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 
76 #define FT_PAD_FLOOR( x, n ) ( (x) & ~((n)-1) )
77 #define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + ((n)/2), n )
78 #define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + ((n)-1), n )
79 
80 #define FT_PIX_FLOOR( x ) ( (x) & ~63 )
81 #define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
82 #define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
83 
84 
85  /*
86  * Return the highest power of 2 that is <= value; this correspond to
87  * the highest bit in a given 32-bit value.
88  */
91 
92 
93  /*
94  * character classification functions -- since these are used to parse
95  * font files, we must not use those in <ctypes.h> which are
96  * locale-dependent
97  */
98 #define ft_isdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U )
99 
100 #define ft_isxdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U || \
101  ( (unsigned)(x) - 'a' ) < 6U || \
102  ( (unsigned)(x) - 'A' ) < 6U )
103 
104  /* the next two macros assume ASCII representation */
105 #define ft_isupper( x ) ( ( (unsigned)(x) - 'A' ) < 26U )
106 #define ft_islower( x ) ( ( (unsigned)(x) - 'a' ) < 26U )
107 
108 #define ft_isalpha( x ) ( ft_isupper( x ) || ft_islower( x ) )
109 #define ft_isalnum( x ) ( ft_isdigit( x ) || ft_isalpha( x ) )
110 
111 
112  /*************************************************************************/
113  /*************************************************************************/
114  /*************************************************************************/
115  /**** ****/
116  /**** ****/
117  /**** C H A R M A P S ****/
118  /**** ****/
119  /**** ****/
120  /*************************************************************************/
121  /*************************************************************************/
122  /*************************************************************************/
123 
124  /* handle to internal charmap object */
125  typedef struct FT_CMapRec_* FT_CMap;
126 
127  /* handle to charmap class structure */
128  typedef const struct FT_CMap_ClassRec_* FT_CMap_Class;
129 
130  /* internal charmap object structure */
131  typedef struct FT_CMapRec_
132  {
134  FT_CMap_Class clazz;
135 
136  } FT_CMapRec;
137 
138  /* typecase any pointer to a charmap handle */
139 #define FT_CMAP( x ) ((FT_CMap)( x ))
140 
141  /* obvious macros */
142 #define FT_CMAP_PLATFORM_ID( x ) FT_CMAP( x )->charmap.platform_id
143 #define FT_CMAP_ENCODING_ID( x ) FT_CMAP( x )->charmap.encoding_id
144 #define FT_CMAP_ENCODING( x ) FT_CMAP( x )->charmap.encoding
145 #define FT_CMAP_FACE( x ) FT_CMAP( x )->charmap.face
146 
147 
148  /* class method definitions */
149  typedef FT_Error
150  (*FT_CMap_InitFunc)( FT_CMap cmap,
151  FT_Pointer init_data );
152 
153  typedef void
154  (*FT_CMap_DoneFunc)( FT_CMap cmap );
155 
156  typedef FT_UInt
157  (*FT_CMap_CharIndexFunc)( FT_CMap cmap,
158  FT_UInt32 char_code );
159 
160  typedef FT_UInt
161  (*FT_CMap_CharNextFunc)( FT_CMap cmap,
162  FT_UInt32 *achar_code );
163 
164  typedef FT_UInt
165  (*FT_CMap_CharVarIndexFunc)( FT_CMap cmap,
166  FT_CMap unicode_cmap,
167  FT_UInt32 char_code,
168  FT_UInt32 variant_selector );
169 
170  typedef FT_Bool
172  FT_UInt32 char_code,
173  FT_UInt32 variant_selector );
174 
175  typedef FT_UInt32 *
176  (*FT_CMap_VariantListFunc)( FT_CMap cmap,
177  FT_Memory mem );
178 
179  typedef FT_UInt32 *
180  (*FT_CMap_CharVariantListFunc)( FT_CMap cmap,
181  FT_Memory mem,
182  FT_UInt32 char_code );
183 
184  typedef FT_UInt32 *
185  (*FT_CMap_VariantCharListFunc)( FT_CMap cmap,
186  FT_Memory mem,
187  FT_UInt32 variant_selector );
188 
189 
190  typedef struct FT_CMap_ClassRec_
191  {
197 
198  /* Subsequent entries are special ones for format 14 -- the variant */
199  /* selector subtable which behaves like no other */
200 
206 
208 
209 
210 #ifndef FT_CONFIG_OPTION_PIC
211 
212 #define FT_DECLARE_CMAP_CLASS( class_ ) \
213  FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
214 
215 #define FT_DEFINE_CMAP_CLASS( \
216  class_, \
217  size_, \
218  init_, \
219  done_, \
220  char_index_, \
221  char_next_, \
222  char_var_index_, \
223  char_var_default_, \
224  variant_list_, \
225  charvariant_list_, \
226  variantchar_list_ ) \
227  FT_CALLBACK_TABLE_DEF \
228  const FT_CMap_ClassRec class_ = \
229  { \
230  size_, \
231  init_, \
232  done_, \
233  char_index_, \
234  char_next_, \
235  char_var_index_, \
236  char_var_default_, \
237  variant_list_, \
238  charvariant_list_, \
239  variantchar_list_ \
240  };
241 
242 #else /* FT_CONFIG_OPTION_PIC */
243 
244 #define FT_DECLARE_CMAP_CLASS( class_ ) \
245  void \
246  FT_Init_Class_ ## class_( FT_Library library, \
247  FT_CMap_ClassRec* clazz );
248 
249 #define FT_DEFINE_CMAP_CLASS( \
250  class_, \
251  size_, \
252  init_, \
253  done_, \
254  char_index_, \
255  char_next_, \
256  char_var_index_, \
257  char_var_default_, \
258  variant_list_, \
259  charvariant_list_, \
260  variantchar_list_ ) \
261  void \
262  FT_Init_Class_ ## class_( FT_Library library, \
263  FT_CMap_ClassRec* clazz ) \
264  { \
265  FT_UNUSED( library ); \
266  \
267  clazz->size = size_; \
268  clazz->init = init_; \
269  clazz->done = done_; \
270  clazz->char_index = char_index_; \
271  clazz->char_next = char_next_; \
272  clazz->char_var_index = char_var_index_; \
273  clazz->char_var_default = char_var_default_; \
274  clazz->variant_list = variant_list_; \
275  clazz->charvariant_list = charvariant_list_; \
276  clazz->variantchar_list = variantchar_list_; \
277  }
278 
279 #endif /* FT_CONFIG_OPTION_PIC */
280 
281 
282  /* create a new charmap and add it to charmap->face */
283  FT_BASE( FT_Error )
284  FT_CMap_New( FT_CMap_Class clazz,
285  FT_Pointer init_data,
287  FT_CMap *acmap );
288 
289  /* destroy a charmap and remove it from face's list */
290  FT_BASE( void )
291  FT_CMap_Done( FT_CMap cmap );
292 
293 
294  /*************************************************************************/
295  /* */
296  /* <Struct> */
297  /* FT_Face_InternalRec */
298  /* */
299  /* <Description> */
300  /* This structure contains the internal fields of each FT_Face */
301  /* object. These fields may change between different releases of */
302  /* FreeType. */
303  /* */
304  /* <Fields> */
305  /* max_points :: */
306  /* The maximum number of points used to store the vectorial outline */
307  /* of any glyph in this face. If this value cannot be known in */
308  /* advance, or if the face isn't scalable, this should be set to 0. */
309  /* Only relevant for scalable formats. */
310  /* */
311  /* max_contours :: */
312  /* The maximum number of contours used to store the vectorial */
313  /* outline of any glyph in this face. If this value cannot be */
314  /* known in advance, or if the face isn't scalable, this should be */
315  /* set to 0. Only relevant for scalable formats. */
316  /* */
317  /* transform_matrix :: */
318  /* A 2x2 matrix of 16.16 coefficients used to transform glyph */
319  /* outlines after they are loaded from the font. Only used by the */
320  /* convenience functions. */
321  /* */
322  /* transform_delta :: */
323  /* A translation vector used to transform glyph outlines after they */
324  /* are loaded from the font. Only used by the convenience */
325  /* functions. */
326  /* */
327  /* transform_flags :: */
328  /* Some flags used to classify the transform. Only used by the */
329  /* convenience functions. */
330  /* */
331  /* services :: */
332  /* A cache for frequently used services. It should be only */
333  /* accessed with the macro `FT_FACE_LOOKUP_SERVICE'. */
334  /* */
335  /* incremental_interface :: */
336  /* If non-null, the interface through which glyph data and metrics */
337  /* are loaded incrementally for faces that do not provide all of */
338  /* this data when first opened. This field exists only if */
339  /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */
340  /* */
341  /* ignore_unpatented_hinter :: */
342  /* This boolean flag instructs the glyph loader to ignore the */
343  /* native font hinter, if one is found. This is exclusively used */
344  /* in the case when the unpatented hinter is compiled within the */
345  /* library. */
346  /* */
347  /* refcount :: */
348  /* A counter initialized to~1 at the time an @FT_Face structure is */
349  /* created. @FT_Reference_Face increments this counter, and */
350  /* @FT_Done_Face only destroys a face if the counter is~1, */
351  /* otherwise it simply decrements it. */
352  /* */
353  typedef struct FT_Face_InternalRec_
354  {
355 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
356  FT_UShort reserved1;
357  FT_Short reserved2;
358 #endif
362 
364 
365 #ifdef FT_CONFIG_OPTION_INCREMENTAL
366  FT_Incremental_InterfaceRec* incremental_interface;
367 #endif
368 
371 
373 
374 
375  /*************************************************************************/
376  /* */
377  /* <Struct> */
378  /* FT_Slot_InternalRec */
379  /* */
380  /* <Description> */
381  /* This structure contains the internal fields of each FT_GlyphSlot */
382  /* object. These fields may change between different releases of */
383  /* FreeType. */
384  /* */
385  /* <Fields> */
386  /* loader :: The glyph loader object used to load outlines */
387  /* into the glyph slot. */
388  /* */
389  /* flags :: Possible values are zero or */
390  /* FT_GLYPH_OWN_BITMAP. The latter indicates */
391  /* that the FT_GlyphSlot structure owns the */
392  /* bitmap buffer. */
393  /* */
394  /* glyph_transformed :: Boolean. Set to TRUE when the loaded glyph */
395  /* must be transformed through a specific */
396  /* font transformation. This is _not_ the same */
397  /* as the face transform set through */
398  /* FT_Set_Transform(). */
399  /* */
400  /* glyph_matrix :: The 2x2 matrix corresponding to the glyph */
401  /* transformation, if necessary. */
402  /* */
403  /* glyph_delta :: The 2d translation vector corresponding to */
404  /* the glyph transformation, if necessary. */
405  /* */
406  /* glyph_hints :: Format-specific glyph hints management. */
407  /* */
408 
409 #define FT_GLYPH_OWN_BITMAP 0x1
410 
411  typedef struct FT_Slot_InternalRec_
412  {
418  void* glyph_hints;
419 
421 
422 
423 #if 0
424 
425  /*************************************************************************/
426  /* */
427  /* <Struct> */
428  /* FT_Size_InternalRec */
429  /* */
430  /* <Description> */
431  /* This structure contains the internal fields of each FT_Size */
432  /* object. Currently, it's empty. */
433  /* */
434  /*************************************************************************/
435 
436  typedef struct FT_Size_InternalRec_
437  {
438  /* empty */
439 
440  } FT_Size_InternalRec;
441 
442 #endif
443 
444 
445  /*************************************************************************/
446  /*************************************************************************/
447  /*************************************************************************/
448  /**** ****/
449  /**** ****/
450  /**** M O D U L E S ****/
451  /**** ****/
452  /**** ****/
453  /*************************************************************************/
454  /*************************************************************************/
455  /*************************************************************************/
456 
457 
458  /*************************************************************************/
459  /* */
460  /* <Struct> */
461  /* FT_ModuleRec */
462  /* */
463  /* <Description> */
464  /* A module object instance. */
465  /* */
466  /* <Fields> */
467  /* clazz :: A pointer to the module's class. */
468  /* */
469  /* library :: A handle to the parent library object. */
470  /* */
471  /* memory :: A handle to the memory manager. */
472  /* */
473  typedef struct FT_ModuleRec_
474  {
478 
479  } FT_ModuleRec;
480 
481 
482  /* typecast an object to an FT_Module */
483 #define FT_MODULE( x ) ((FT_Module)( x ))
484 #define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
485 #define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
486 #define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
487 
488 
489 #define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
490  FT_MODULE_FONT_DRIVER )
491 
492 #define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
493  FT_MODULE_RENDERER )
494 
495 #define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
496  FT_MODULE_HINTER )
497 
498 #define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
499  FT_MODULE_STYLER )
500 
501 #define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS( x )->module_flags & \
502  FT_MODULE_DRIVER_SCALABLE )
503 
504 #define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS( x )->module_flags & \
505  FT_MODULE_DRIVER_NO_OUTLINES )
506 
507 #define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
508  FT_MODULE_DRIVER_HAS_HINTER )
509 
510 
511  /*************************************************************************/
512  /* */
513  /* <Function> */
514  /* FT_Get_Module_Interface */
515  /* */
516  /* <Description> */
517  /* Finds a module and returns its specific interface as a typeless */
518  /* pointer. */
519  /* */
520  /* <Input> */
521  /* library :: A handle to the library object. */
522  /* */
523  /* module_name :: The module's name (as an ASCII string). */
524  /* */
525  /* <Return> */
526  /* A module-specific interface if available, 0 otherwise. */
527  /* */
528  /* <Note> */
529  /* You should better be familiar with FreeType internals to know */
530  /* which module to look for, and what its interface is :-) */
531  /* */
532  FT_BASE( const void* )
534  const char* mod_name );
535 
538  const char* service_id );
539 
540  /* */
541 
542 
543  /*************************************************************************/
544  /*************************************************************************/
545  /*************************************************************************/
546  /**** ****/
547  /**** ****/
548  /**** F A C E, S I Z E & G L Y P H S L O T O B J E C T S ****/
549  /**** ****/
550  /**** ****/
551  /*************************************************************************/
552  /*************************************************************************/
553  /*************************************************************************/
554 
555  /* a few macros used to perform easy typecasts with minimal brain damage */
556 
557 #define FT_FACE( x ) ((FT_Face)(x))
558 #define FT_SIZE( x ) ((FT_Size)(x))
559 #define FT_SLOT( x ) ((FT_GlyphSlot)(x))
560 
561 #define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
562 #define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
563 #define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
564 #define FT_FACE_STREAM( x ) FT_FACE( x )->stream
565 
566 #define FT_SIZE_FACE( x ) FT_SIZE( x )->face
567 #define FT_SLOT_FACE( x ) FT_SLOT( x )->face
568 
569 #define FT_FACE_SLOT( x ) FT_FACE( x )->glyph
570 #define FT_FACE_SIZE( x ) FT_FACE( x )->size
571 
572 
573  /*************************************************************************/
574  /* */
575  /* <Function> */
576  /* FT_New_GlyphSlot */
577  /* */
578  /* <Description> */
579  /* It is sometimes useful to have more than one glyph slot for a */
580  /* given face object. This function is used to create additional */
581  /* slots. All of them are automatically discarded when the face is */
582  /* destroyed. */
583  /* */
584  /* <Input> */
585  /* face :: A handle to a parent face object. */
586  /* */
587  /* <Output> */
588  /* aslot :: A handle to a new glyph slot object. */
589  /* */
590  /* <Return> */
591  /* FreeType error code. 0 means success. */
592  /* */
593  FT_BASE( FT_Error )
595  FT_GlyphSlot *aslot );
596 
597 
598  /*************************************************************************/
599  /* */
600  /* <Function> */
601  /* FT_Done_GlyphSlot */
602  /* */
603  /* <Description> */
604  /* Destroys a given glyph slot. Remember however that all slots are */
605  /* automatically destroyed with its parent. Using this function is */
606  /* not always mandatory. */
607  /* */
608  /* <Input> */
609  /* slot :: A handle to a target glyph slot. */
610  /* */
611  FT_BASE( void )
613 
614  /* */
615 
616 #define FT_REQUEST_WIDTH( req ) \
617  ( (req)->horiResolution \
618  ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \
619  : (req)->width )
620 
621 #define FT_REQUEST_HEIGHT( req ) \
622  ( (req)->vertResolution \
623  ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \
624  : (req)->height )
625 
626 
627  /* Set the metrics according to a bitmap strike. */
628  FT_BASE( void )
630  FT_ULong strike_index );
631 
632 
633  /* Set the metrics according to a size request. */
634  FT_BASE( void )
636  FT_Size_Request req );
637 
638 
639  /* Match a size request against `available_sizes'. */
640  FT_BASE( FT_Error )
642  FT_Size_Request req,
643  FT_Bool ignore_width,
644  FT_ULong* size_index );
645 
646 
647  /* Use the horizontal metrics to synthesize the vertical metrics. */
648  /* If `advance' is zero, it is also synthesized. */
649  FT_BASE( void )
651  FT_Pos advance );
652 
653 
654  /* Free the bitmap of a given glyphslot when needed (i.e., only when it */
655  /* was allocated with ft_glyphslot_alloc_bitmap). */
656  FT_BASE( void )
658 
659 
660  /* Allocate a new bitmap buffer in a glyph slot. */
661  FT_BASE( FT_Error )
663  FT_ULong size );
664 
665 
666  /* Set the bitmap buffer in a glyph slot to a given pointer. The buffer */
667  /* will not be freed by a later call to ft_glyphslot_free_bitmap. */
668  FT_BASE( void )
670  FT_Byte* buffer );
671 
672 
673  /*************************************************************************/
674  /*************************************************************************/
675  /*************************************************************************/
676  /**** ****/
677  /**** ****/
678  /**** R E N D E R E R S ****/
679  /**** ****/
680  /**** ****/
681  /*************************************************************************/
682  /*************************************************************************/
683  /*************************************************************************/
684 
685 
686 #define FT_RENDERER( x ) ((FT_Renderer)( x ))
687 #define FT_GLYPH( x ) ((FT_Glyph)( x ))
688 #define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x ))
689 #define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
690 
691 
692  typedef struct FT_RendererRec_
693  {
698 
702 
703  } FT_RendererRec;
704 
705 
706  /*************************************************************************/
707  /*************************************************************************/
708  /*************************************************************************/
709  /**** ****/
710  /**** ****/
711  /**** F O N T D R I V E R S ****/
712  /**** ****/
713  /**** ****/
714  /*************************************************************************/
715  /*************************************************************************/
716  /*************************************************************************/
717 
718 
719  /* typecast a module into a driver easily */
720 #define FT_DRIVER( x ) ((FT_Driver)(x))
721 
722  /* typecast a module as a driver, and get its driver class */
723 #define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
724 
725 
726  /*************************************************************************/
727  /* */
728  /* <Struct> */
729  /* FT_DriverRec */
730  /* */
731  /* <Description> */
732  /* The root font driver class. A font driver is responsible for */
733  /* managing and loading font files of a given format. */
734  /* */
735  /* <Fields> */
736  /* root :: Contains the fields of the root module class. */
737  /* */
738  /* clazz :: A pointer to the font driver's class. Note that */
739  /* this is NOT root.clazz. `class' wasn't used */
740  /* as it is a reserved word in C++. */
741  /* */
742  /* faces_list :: The list of faces currently opened by this */
743  /* driver. */
744  /* */
745  /* glyph_loader :: The glyph loader for all faces managed by this */
746  /* driver. This object isn't defined for unscalable */
747  /* formats. */
748  /* */
749  typedef struct FT_DriverRec_
750  {
755 
756  } FT_DriverRec;
757 
758 
759  /*************************************************************************/
760  /*************************************************************************/
761  /*************************************************************************/
762  /**** ****/
763  /**** ****/
764  /**** L I B R A R I E S ****/
765  /**** ****/
766  /**** ****/
767  /*************************************************************************/
768  /*************************************************************************/
769  /*************************************************************************/
770 
771 
772  /* This hook is used by the TrueType debugger. It must be set to an */
773  /* alternate truetype bytecode interpreter function. */
774 #define FT_DEBUG_HOOK_TRUETYPE 0
775 
776 
777  /* Set this debug hook to a non-null pointer to force unpatented hinting */
778  /* for all faces when both TT_USE_BYTECODE_INTERPRETER and */
779  /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined. This is only used */
780  /* during debugging. */
781 #define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
782 
783 
785  FT_Render_Mode render_mode,
787 
788 
789  /*************************************************************************/
790  /* */
791  /* <Struct> */
792  /* FT_LibraryRec */
793  /* */
794  /* <Description> */
795  /* The FreeType library class. This is the root of all FreeType */
796  /* data. Use FT_New_Library() to create a library object, and */
797  /* FT_Done_Library() to discard it and all child objects. */
798  /* */
799  /* <Fields> */
800  /* memory :: The library's memory object. Manages memory */
801  /* allocation. */
802  /* */
803  /* version_major :: The major version number of the library. */
804  /* */
805  /* version_minor :: The minor version number of the library. */
806  /* */
807  /* version_patch :: The current patch level of the library. */
808  /* */
809  /* num_modules :: The number of modules currently registered */
810  /* within this library. This is set to 0 for new */
811  /* libraries. New modules are added through the */
812  /* FT_Add_Module() API function. */
813  /* */
814  /* modules :: A table used to store handles to the currently */
815  /* registered modules. Note that each font driver */
816  /* contains a list of its opened faces. */
817  /* */
818  /* renderers :: The list of renderers currently registered */
819  /* within the library. */
820  /* */
821  /* cur_renderer :: The current outline renderer. This is a */
822  /* shortcut used to avoid parsing the list on */
823  /* each call to FT_Outline_Render(). It is a */
824  /* handle to the current renderer for the */
825  /* FT_GLYPH_FORMAT_OUTLINE format. */
826  /* */
827  /* auto_hinter :: XXX */
828  /* */
829  /* raster_pool :: The raster object's render pool. This can */
830  /* ideally be changed dynamically at run-time. */
831  /* */
832  /* raster_pool_size :: The size of the render pool in bytes. */
833  /* */
834  /* debug_hooks :: XXX */
835  /* */
836  /* lcd_filter :: If subpixel rendering is activated, the */
837  /* selected LCD filter mode. */
838  /* */
839  /* lcd_extra :: If subpixel rendering is activated, the number */
840  /* of extra pixels needed for the LCD filter. */
841  /* */
842  /* lcd_weights :: If subpixel rendering is activated, the LCD */
843  /* filter weights, if any. */
844  /* */
845  /* lcd_filter_func :: If subpixel rendering is activated, the LCD */
846  /* filtering callback function. */
847  /* */
848  /* pic_container :: Contains global structs and tables, instead */
849  /* of defining them globallly. */
850  /* */
851  /* refcount :: A counter initialized to~1 at the time an */
852  /* @FT_Library structure is created. */
853  /* @FT_Reference_Library increments this counter, */
854  /* and @FT_Done_Library only destroys a library */
855  /* if the counter is~1, otherwise it simply */
856  /* decrements it. */
857  /* */
858  typedef struct FT_LibraryRec_
859  {
860  FT_Memory memory; /* library's memory manager */
861 
865 
867  FT_Module modules[FT_MAX_MODULES]; /* module objects */
868 
869  FT_ListRec renderers; /* list of renderers */
870  FT_Renderer cur_renderer; /* current outline renderer */
872 
873  FT_Byte* raster_pool; /* scan-line conversion */
874  /* render pool */
875  FT_ULong raster_pool_size; /* size of render pool in bytes */
876 
877  FT_DebugHook_Func debug_hooks[4];
878 
879 #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
880  FT_LcdFilter lcd_filter;
881  FT_Int lcd_extra; /* number of extra pixels */
882  FT_Byte lcd_weights[7]; /* filter weights, if any */
883  FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */
884 #endif
885 
886 #ifdef FT_CONFIG_OPTION_PIC
887  FT_PIC_Container pic_container;
888 #endif
889 
891 
892  } FT_LibraryRec;
893 
894 
898  FT_ListNode* node );
899 
900  FT_BASE( FT_Error )
902  FT_GlyphSlot slot,
903  FT_Render_Mode render_mode );
904 
905  typedef const char*
906  (*FT_Face_GetPostscriptNameFunc)( FT_Face face );
907 
908  typedef FT_Error
910  FT_UInt glyph_index,
912  FT_UInt buffer_max );
913 
914  typedef FT_UInt
916  FT_String* glyph_name );
917 
918 
919 #ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
920 
921  /*************************************************************************/
922  /* */
923  /* <Function> */
924  /* FT_New_Memory */
925  /* */
926  /* <Description> */
927  /* Creates a new memory object. */
928  /* */
929  /* <Return> */
930  /* A pointer to the new memory object. 0 in case of error. */
931  /* */
932  FT_BASE( FT_Memory )
933  FT_New_Memory( void );
934 
935 
936  /*************************************************************************/
937  /* */
938  /* <Function> */
939  /* FT_Done_Memory */
940  /* */
941  /* <Description> */
942  /* Discards memory manager. */
943  /* */
944  /* <Input> */
945  /* memory :: A handle to the memory manager. */
946  /* */
947  FT_BASE( void )
948  FT_Done_Memory( FT_Memory memory );
949 
950 #endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
951 
952 
953  /* Define default raster's interface. The default raster is located in */
954  /* `src/base/ftraster.c'. */
955  /* */
956  /* Client applications can register new rasters through the */
957  /* FT_Set_Raster() API. */
958 
959 #ifndef FT_NO_DEFAULT_RASTER
960  FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
961 #endif
962 
963 
964  /*************************************************************************/
965  /*************************************************************************/
966  /*************************************************************************/
967  /**** ****/
968  /**** ****/
969  /**** P I C S U P P O R T ****/
970  /**** ****/
971  /**** ****/
972  /*************************************************************************/
973  /*************************************************************************/
974  /*************************************************************************/
975 
976 
977  /* PIC support macros for ftimage.h */
978 
979 
980  /*************************************************************************/
981  /* */
982  /* <Macro> */
983  /* FT_DEFINE_OUTLINE_FUNCS */
984  /* */
985  /* <Description> */
986  /* Used to initialize an instance of FT_Outline_Funcs struct. */
987  /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
988  /* be called with a pre-allocated structure to be filled. */
989  /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
990  /* allocated in the global scope (or the scope where the macro */
991  /* is used). */
992  /* */
993 #ifndef FT_CONFIG_OPTION_PIC
994 
995 #define FT_DEFINE_OUTLINE_FUNCS( \
996  class_, \
997  move_to_, \
998  line_to_, \
999  conic_to_, \
1000  cubic_to_, \
1001  shift_, \
1002  delta_ ) \
1003  static const FT_Outline_Funcs class_ = \
1004  { \
1005  move_to_, \
1006  line_to_, \
1007  conic_to_, \
1008  cubic_to_, \
1009  shift_, \
1010  delta_ \
1011  };
1012 
1013 #else /* FT_CONFIG_OPTION_PIC */
1014 
1015 #define FT_DEFINE_OUTLINE_FUNCS( \
1016  class_, \
1017  move_to_, \
1018  line_to_, \
1019  conic_to_, \
1020  cubic_to_, \
1021  shift_, \
1022  delta_ ) \
1023  static FT_Error \
1024  Init_Class_ ## class_( FT_Outline_Funcs* clazz ) \
1025  { \
1026  clazz->move_to = move_to_; \
1027  clazz->line_to = line_to_; \
1028  clazz->conic_to = conic_to_; \
1029  clazz->cubic_to = cubic_to_; \
1030  clazz->shift = shift_; \
1031  clazz->delta = delta_; \
1032  \
1033  return FT_Err_Ok; \
1034  }
1035 
1036 #endif /* FT_CONFIG_OPTION_PIC */
1037 
1038 
1039  /*************************************************************************/
1040  /* */
1041  /* <Macro> */
1042  /* FT_DEFINE_RASTER_FUNCS */
1043  /* */
1044  /* <Description> */
1045  /* Used to initialize an instance of FT_Raster_Funcs struct. */
1046  /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
1047  /* be called with a pre-allocated structure to be filled. */
1048  /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
1049  /* allocated in the global scope (or the scope where the macro */
1050  /* is used). */
1051  /* */
1052 #ifndef FT_CONFIG_OPTION_PIC
1053 
1054 #define FT_DEFINE_RASTER_FUNCS( \
1055  class_, \
1056  glyph_format_, \
1057  raster_new_, \
1058  raster_reset_, \
1059  raster_set_mode_, \
1060  raster_render_, \
1061  raster_done_ ) \
1062  const FT_Raster_Funcs class_ = \
1063  { \
1064  glyph_format_, \
1065  raster_new_, \
1066  raster_reset_, \
1067  raster_set_mode_, \
1068  raster_render_, \
1069  raster_done_ \
1070  };
1071 
1072 #else /* FT_CONFIG_OPTION_PIC */
1073 
1074 #define FT_DEFINE_RASTER_FUNCS( \
1075  class_, \
1076  glyph_format_, \
1077  raster_new_, \
1078  raster_reset_, \
1079  raster_set_mode_, \
1080  raster_render_, \
1081  raster_done_ ) \
1082  void \
1083  FT_Init_Class_ ## class_( FT_Raster_Funcs* clazz ) \
1084  { \
1085  clazz->glyph_format = glyph_format_; \
1086  clazz->raster_new = raster_new_; \
1087  clazz->raster_reset = raster_reset_; \
1088  clazz->raster_set_mode = raster_set_mode_; \
1089  clazz->raster_render = raster_render_; \
1090  clazz->raster_done = raster_done_; \
1091  }
1092 
1093 #endif /* FT_CONFIG_OPTION_PIC */
1094 
1095 
1096  /* PIC support macros for ftrender.h */
1097 
1098 
1099  /*************************************************************************/
1100  /* */
1101  /* <Macro> */
1102  /* FT_DEFINE_GLYPH */
1103  /* */
1104  /* <Description> */
1105  /* Used to initialize an instance of FT_Glyph_Class struct. */
1106  /* When FT_CONFIG_OPTION_PIC is defined an init funtion will need to */
1107  /* be called with a pre-allocated stcture to be filled. */
1108  /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
1109  /* allocated in the global scope (or the scope where the macro */
1110  /* is used). */
1111  /* */
1112 #ifndef FT_CONFIG_OPTION_PIC
1113 
1114 #define FT_DEFINE_GLYPH( \
1115  class_, \
1116  size_, \
1117  format_, \
1118  init_, \
1119  done_, \
1120  copy_, \
1121  transform_, \
1122  bbox_, \
1123  prepare_ ) \
1124  FT_CALLBACK_TABLE_DEF \
1125  const FT_Glyph_Class class_ = \
1126  { \
1127  size_, \
1128  format_, \
1129  init_, \
1130  done_, \
1131  copy_, \
1132  transform_, \
1133  bbox_, \
1134  prepare_ \
1135  };
1136 
1137 #else /* FT_CONFIG_OPTION_PIC */
1138 
1139 #define FT_DEFINE_GLYPH( \
1140  class_, \
1141  size_, \
1142  format_, \
1143  init_, \
1144  done_, \
1145  copy_, \
1146  transform_, \
1147  bbox_, \
1148  prepare_ ) \
1149  void \
1150  FT_Init_Class_ ## class_( FT_Glyph_Class* clazz ) \
1151  { \
1152  clazz->glyph_size = size_; \
1153  clazz->glyph_format = format_; \
1154  clazz->glyph_init = init_; \
1155  clazz->glyph_done = done_; \
1156  clazz->glyph_copy = copy_; \
1157  clazz->glyph_transform = transform_; \
1158  clazz->glyph_bbox = bbox_; \
1159  clazz->glyph_prepare = prepare_; \
1160  }
1161 
1162 #endif /* FT_CONFIG_OPTION_PIC */
1163 
1164 
1165  /*************************************************************************/
1166  /* */
1167  /* <Macro> */
1168  /* FT_DECLARE_RENDERER */
1169  /* */
1170  /* <Description> */
1171  /* Used to create a forward declaration of a */
1172  /* FT_Renderer_Class struct instance. */
1173  /* */
1174  /* <Macro> */
1175  /* FT_DEFINE_RENDERER */
1176  /* */
1177  /* <Description> */
1178  /* Used to initialize an instance of FT_Renderer_Class struct. */
1179  /* */
1180  /* When FT_CONFIG_OPTION_PIC is defined a `create' funtion will need */
1181  /* to be called with a pointer where the allocated structure is */
1182  /* returned. And when it is no longer needed a `destroy' function */
1183  /* needs to be called to release that allocation. */
1184  /* `fcinit.c' (ft_create_default_module_classes) already contains */
1185  /* a mechanism to call these functions for the default modules */
1186  /* described in `ftmodule.h'. */
1187  /* */
1188  /* Notice that the created `create' and `destroy' functions call */
1189  /* `pic_init' and `pic_free' to allow you to manually allocate and */
1190  /* initialize any additional global data, like a module specific */
1191  /* interface, and put them in the global pic container defined in */
1192  /* `ftpic.h'. If you don't need them just implement the functions as */
1193  /* empty to resolve the link error. Also the `pic_init' and */
1194  /* `pic_free' functions should be declared in `pic.h', to be referred */
1195  /* by the renderer definition calling `FT_DEFINE_RENDERER' in the */
1196  /* following. */
1197  /* */
1198  /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
1199  /* allocated in the global scope (or the scope where the macro */
1200  /* is used). */
1201  /* */
1202 #ifndef FT_CONFIG_OPTION_PIC
1203 
1204 #define FT_DECLARE_RENDERER( class_ ) \
1205  FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
1206 
1207 #define FT_DEFINE_RENDERER( \
1208  class_, \
1209  flags_, \
1210  size_, \
1211  name_, \
1212  version_, \
1213  requires_, \
1214  interface_, \
1215  init_, \
1216  done_, \
1217  get_interface_, \
1218  glyph_format_, \
1219  render_glyph_, \
1220  transform_glyph_, \
1221  get_glyph_cbox_, \
1222  set_mode_, \
1223  raster_class_ ) \
1224  FT_CALLBACK_TABLE_DEF \
1225  const FT_Renderer_Class class_ = \
1226  { \
1227  FT_DEFINE_ROOT_MODULE( flags_, \
1228  size_, \
1229  name_, \
1230  version_, \
1231  requires_, \
1232  interface_, \
1233  init_, \
1234  done_, \
1235  get_interface_ ) \
1236  glyph_format_, \
1237  \
1238  render_glyph_, \
1239  transform_glyph_, \
1240  get_glyph_cbox_, \
1241  set_mode_, \
1242  \
1243  raster_class_ \
1244  };
1245 
1246 #else /* FT_CONFIG_OPTION_PIC */
1247 
1248 #define FT_DECLARE_RENDERER( class_ ) FT_DECLARE_MODULE( class_ )
1249 
1250 #define FT_DEFINE_RENDERER( \
1251  class_, \
1252  flags_, \
1253  size_, \
1254  name_, \
1255  version_, \
1256  requires_, \
1257  interface_, \
1258  init_, \
1259  done_, \
1260  get_interface_, \
1261  glyph_format_, \
1262  render_glyph_, \
1263  transform_glyph_, \
1264  get_glyph_cbox_, \
1265  set_mode_, \
1266  raster_class_ ) \
1267  void \
1268  FT_Destroy_Class_ ## class_( FT_Library library, \
1269  FT_Module_Class* clazz ) \
1270  { \
1271  FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \
1272  FT_Memory memory = library->memory; \
1273  \
1274  \
1275  class_ ## _pic_free( library ); \
1276  if ( rclazz ) \
1277  FT_FREE( rclazz ); \
1278  } \
1279  \
1280  \
1281  FT_Error \
1282  FT_Create_Class_ ## class_( FT_Library library, \
1283  FT_Module_Class** output_class ) \
1284  { \
1285  FT_Renderer_Class* clazz = NULL; \
1286  FT_Error error; \
1287  FT_Memory memory = library->memory; \
1288  \
1289  \
1290  if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
1291  return error; \
1292  \
1293  error = class_ ## _pic_init( library ); \
1294  if ( error ) \
1295  { \
1296  FT_FREE( clazz ); \
1297  return error; \
1298  } \
1299  \
1300  FT_DEFINE_ROOT_MODULE( flags_, \
1301  size_, \
1302  name_, \
1303  version_, \
1304  requires_, \
1305  interface_, \
1306  init_, \
1307  done_, \
1308  get_interface_ ) \
1309  \
1310  clazz->glyph_format = glyph_format_; \
1311  \
1312  clazz->render_glyph = render_glyph_; \
1313  clazz->transform_glyph = transform_glyph_; \
1314  clazz->get_glyph_cbox = get_glyph_cbox_; \
1315  clazz->set_mode = set_mode_; \
1316  \
1317  clazz->raster_class = raster_class_; \
1318  \
1319  *output_class = (FT_Module_Class*)clazz; \
1320  \
1321  return FT_Err_Ok; \
1322  }
1323 
1324 #endif /* FT_CONFIG_OPTION_PIC */
1325 
1326 
1327  /* PIC support macros for ftmodapi.h **/
1328 
1329 
1330 #ifdef FT_CONFIG_OPTION_PIC
1331 
1332  /*************************************************************************/
1333  /* */
1334  /* <FuncType> */
1335  /* FT_Module_Creator */
1336  /* */
1337  /* <Description> */
1338  /* A function used to create (allocate) a new module class object. */
1339  /* The object's members are initialized, but the module itself is */
1340  /* not. */
1341  /* */
1342  /* <Input> */
1343  /* memory :: A handle to the memory manager. */
1344  /* output_class :: Initialized with the newly allocated class. */
1345  /* */
1346  typedef FT_Error
1347  (*FT_Module_Creator)( FT_Memory memory,
1348  FT_Module_Class** output_class );
1349 
1350  /*************************************************************************/
1351  /* */
1352  /* <FuncType> */
1353  /* FT_Module_Destroyer */
1354  /* */
1355  /* <Description> */
1356  /* A function used to destroy (deallocate) a module class object. */
1357  /* */
1358  /* <Input> */
1359  /* memory :: A handle to the memory manager. */
1360  /* clazz :: Module class to destroy. */
1361  /* */
1362  typedef void
1363  (*FT_Module_Destroyer)( FT_Memory memory,
1365 
1366 #endif
1367 
1368 
1369  /*************************************************************************/
1370  /* */
1371  /* <Macro> */
1372  /* FT_DECLARE_MODULE */
1373  /* */
1374  /* <Description> */
1375  /* Used to create a forward declaration of a */
1376  /* FT_Module_Class struct instance. */
1377  /* */
1378  /* <Macro> */
1379  /* FT_DEFINE_MODULE */
1380  /* */
1381  /* <Description> */
1382  /* Used to initialize an instance of an FT_Module_Class struct. */
1383  /* */
1384  /* When FT_CONFIG_OPTION_PIC is defined a `create' funtion needs to */
1385  /* be called with a pointer where the allocated structure is */
1386  /* returned. And when it is no longer needed a `destroy' function */
1387  /* needs to be called to release that allocation. */
1388  /* `fcinit.c' (ft_create_default_module_classes) already contains */
1389  /* a mechanism to call these functions for the default modules */
1390  /* described in `ftmodule.h'. */
1391  /* */
1392  /* Notice that the created `create' and `destroy' functions call */
1393  /* `pic_init' and `pic_free' to allow you to manually allocate and */
1394  /* initialize any additional global data, like a module specific */
1395  /* interface, and put them in the global pic container defined in */
1396  /* `ftpic.h'. If you don't need them just implement the functions as */
1397  /* empty to resolve the link error. Also the `pic_init' and */
1398  /* `pic_free' functions should be declared in `pic.h', to be referred */
1399  /* by the module definition calling `FT_DEFINE_MODULE' in the */
1400  /* following. */
1401  /* */
1402  /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
1403  /* allocated in the global scope (or the scope where the macro */
1404  /* is used). */
1405  /* */
1406  /* <Macro> */
1407  /* FT_DEFINE_ROOT_MODULE */
1408  /* */
1409  /* <Description> */
1410  /* Used to initialize an instance of an FT_Module_Class struct inside */
1411  /* another struct that contains it or in a function that initializes */
1412  /* that containing struct. */
1413  /* */
1414 #ifndef FT_CONFIG_OPTION_PIC
1415 
1416 #define FT_DECLARE_MODULE( class_ ) \
1417  FT_CALLBACK_TABLE \
1418  const FT_Module_Class class_;
1419 
1420 #define FT_DEFINE_ROOT_MODULE( \
1421  flags_, \
1422  size_, \
1423  name_, \
1424  version_, \
1425  requires_, \
1426  interface_, \
1427  init_, \
1428  done_, \
1429  get_interface_ ) \
1430  { \
1431  flags_, \
1432  size_, \
1433  \
1434  name_, \
1435  version_, \
1436  requires_, \
1437  \
1438  interface_, \
1439  \
1440  init_, \
1441  done_, \
1442  get_interface_, \
1443  },
1444 
1445 #define FT_DEFINE_MODULE( \
1446  class_, \
1447  flags_, \
1448  size_, \
1449  name_, \
1450  version_, \
1451  requires_, \
1452  interface_, \
1453  init_, \
1454  done_, \
1455  get_interface_ ) \
1456  FT_CALLBACK_TABLE_DEF \
1457  const FT_Module_Class class_ = \
1458  { \
1459  flags_, \
1460  size_, \
1461  \
1462  name_, \
1463  version_, \
1464  requires_, \
1465  \
1466  interface_, \
1467  \
1468  init_, \
1469  done_, \
1470  get_interface_, \
1471  };
1472 
1473 
1474 #else /* FT_CONFIG_OPTION_PIC */
1475 
1476 #define FT_DECLARE_MODULE( class_ ) \
1477  FT_Error \
1478  FT_Create_Class_ ## class_( FT_Library library, \
1479  FT_Module_Class** output_class ); \
1480  void \
1481  FT_Destroy_Class_ ## class_( FT_Library library, \
1482  FT_Module_Class* clazz );
1483 
1484 #define FT_DEFINE_ROOT_MODULE( \
1485  flags_, \
1486  size_, \
1487  name_, \
1488  version_, \
1489  requires_, \
1490  interface_, \
1491  init_, \
1492  done_, \
1493  get_interface_ ) \
1494  clazz->root.module_flags = flags_; \
1495  clazz->root.module_size = size_; \
1496  clazz->root.module_name = name_; \
1497  clazz->root.module_version = version_; \
1498  clazz->root.module_requires = requires_; \
1499  \
1500  clazz->root.module_interface = interface_; \
1501  \
1502  clazz->root.module_init = init_; \
1503  clazz->root.module_done = done_; \
1504  clazz->root.get_interface = get_interface_;
1505 
1506 #define FT_DEFINE_MODULE( \
1507  class_, \
1508  flags_, \
1509  size_, \
1510  name_, \
1511  version_, \
1512  requires_, \
1513  interface_, \
1514  init_, \
1515  done_, \
1516  get_interface_ ) \
1517  void \
1518  FT_Destroy_Class_ ## class_( FT_Library library, \
1519  FT_Module_Class* clazz ) \
1520  { \
1521  FT_Memory memory = library->memory; \
1522  \
1523  \
1524  class_ ## _pic_free( library ); \
1525  if ( clazz ) \
1526  FT_FREE( clazz ); \
1527  } \
1528  \
1529  \
1530  FT_Error \
1531  FT_Create_Class_ ## class_( FT_Library library, \
1532  FT_Module_Class** output_class ) \
1533  { \
1534  FT_Memory memory = library->memory; \
1535  FT_Module_Class* clazz = NULL; \
1536  FT_Error error; \
1537  \
1538  \
1539  if ( FT_ALLOC( clazz, sizeof ( *clazz ) ) ) \
1540  return error; \
1541  error = class_ ## _pic_init( library ); \
1542  if ( error ) \
1543  { \
1544  FT_FREE( clazz ); \
1545  return error; \
1546  } \
1547  \
1548  clazz->module_flags = flags_; \
1549  clazz->module_size = size_; \
1550  clazz->module_name = name_; \
1551  clazz->module_version = version_; \
1552  clazz->module_requires = requires_; \
1553  \
1554  clazz->module_interface = interface_; \
1555  \
1556  clazz->module_init = init_; \
1557  clazz->module_done = done_; \
1558  clazz->get_interface = get_interface_; \
1559  \
1560  *output_class = clazz; \
1561  \
1562  return FT_Err_Ok; \
1563  }
1564 
1565 #endif /* FT_CONFIG_OPTION_PIC */
1566 
1567 
1569 
1570 #endif /* __FTOBJS_H__ */
1571 
1572 
1573 /* END */
void(* FT_DebugHook_Func)(void *arg)
Definition: ftmodapi.h:490
ft_glyphslot_set_bitmap(FT_GlyphSlot slot, FT_Byte *buffer)
Definition: ftobjs.c:294
int FT_Error
Definition: fttypes.h:296
FT_ULong raster_pool_size
Definition: ftobjs.h:875
FT_Raster_Render_Func raster_render
Definition: ftobjs.h:700
unsigned long FT_ULong
Definition: fttypes.h:249
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:59
FT_Renderer_RenderFunc render
Definition: ftobjs.h:701
FT_CMap_CharVarIndexFunc char_var_index
Definition: ftobjs.h:201
ft_synthesize_vertical_metrics(FT_Glyph_Metrics *metrics, FT_Pos advance)
Definition: ftobjs.c:2542
typedefFT_BEGIN_HEADER struct FT_Glyph_Class_ FT_Glyph_Class
Definition: ftglyph.h:69
FT_Vector glyph_delta
Definition: ftobjs.h:417
FT_Driver_Class clazz
Definition: ftobjs.h:752
#define FT_END_HEADER
Definition: ftheader.h:54
FT_Select_Metrics(FT_Face face, FT_ULong strike_index)
Definition: ftobjs.c:2602
struct FT_RasterRec_ * FT_Raster
Definition: ftimage.h:862
FT_UInt(* FT_CMap_CharIndexFunc)(FT_CMap cmap, FT_UInt32 char_code)
Definition: ftobjs.h:157
signed int FT_Int
Definition: fttypes.h:216
struct FT_LibraryRec_ FT_LibraryRec
enum FT_Render_Mode_ FT_Render_Mode
FT_Module_Class * clazz
Definition: ftobjs.h:475
FT_UInt32 *(* FT_CMap_VariantCharListFunc)(FT_CMap cmap, FT_Memory mem, FT_UInt32 variant_selector)
Definition: ftobjs.h:185
FT_UInt(* FT_Face_GetGlyphNameIndexFunc)(FT_Face face, FT_String *glyph_name)
Definition: ftobjs.h:915
struct FT_ModuleRec_ FT_ModuleRec
void(* FT_CMap_DoneFunc)(FT_CMap cmap)
Definition: ftobjs.h:154
FT_Library library
Definition: ftobjs.h:476
FT_New_GlyphSlot(FT_Face face, FT_GlyphSlot *aslot)
Definition: ftobjs.c:387
FT_ListRec faces_list
Definition: ftobjs.h:753
unsigned int FT_UInt32
Definition: ftconfig.h:133
FT_Bool ignore_unpatented_hinter
Definition: ftobjs.h:369
FT_Library library
Definition: cffdrivr.c:414
FT_EXPORT_VAR(FT_Raster_Funcs) ft_default_raster
FT_Raster raster
Definition: ftobjs.h:699
FT_Done_GlyphSlot(FT_GlyphSlot slot)
Definition: ftobjs.c:436
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
FT_Render_Glyph_Internal(FT_Library library, FT_GlyphSlot slot, FT_Render_Mode render_mode)
Definition: ftobjs.c:4005
FT_Lookup_Renderer(FT_Library library, FT_Glyph_Format format, FT_ListNode *node)
Definition: ftobjs.c:3800
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:104
GLenum GLuint GLint GLenum face
FT_Module auto_hinter
Definition: ftobjs.h:871
typedefFT_BEGIN_HEADER struct FT_GlyphLoaderRec_ * FT_GlyphLoader
Definition: ftgloadr.h:43
struct FT_Slot_InternalRec_ FT_GlyphSlot_InternalRec
FT_Int version_patch
Definition: ftobjs.h:864
unsigned char FT_Byte
Definition: fttypes.h:150
#define FT_BEGIN_HEADER
Definition: ftheader.h:36
FT_CMap_CharIndexFunc char_index
Definition: ftobjs.h:195
FT_New_Memory(void)
Definition: ftsystem.c:475
FT_ModuleRec root
Definition: ftobjs.h:694
FT_CMap_VariantListFunc variant_list
Definition: ftobjs.h:203
struct FT_CMapRec_ * FT_CMap
Definition: ftobjs.h:125
FT_Bool glyph_transformed
Definition: ftobjs.h:415
FT_CMap_CharVariantListFunc charvariant_list
Definition: ftobjs.h:204
FT_Memory memory
Definition: ftobjs.h:860
FT_UInt32 *(* FT_CMap_VariantListFunc)(FT_CMap cmap, FT_Memory mem)
Definition: ftobjs.h:176
FT_Match_Size(FT_Face face, FT_Size_Request req, FT_Bool ignore_width, FT_ULong *size_index)
Definition: ftobjs.c:2491
struct FT_CMapRec_ FT_CMapRec
FT_ListRec renderers
Definition: ftobjs.h:869
FT_ULong size
Definition: ftobjs.h:192
ft_module_get_service(FT_Module module, const char *service_id)
Definition: ftobjs.c:4352
struct FT_CMap_ClassRec_ FT_CMap_ClassRec
#define FT_BASE(x)
Definition: ftconfig.h:247
FT_Int transform_flags
Definition: ftobjs.h:361
FT_ModuleRec root
Definition: ftobjs.h:751
#define FT_Raster_Render_Func
Definition: ftimage.h:1266
FT_Request_Metrics(FT_Face face, FT_Size_Request req)
Definition: ftobjs.c:2649
ft_glyphslot_alloc_bitmap(FT_GlyphSlot slot, FT_ULong size)
Definition: ftobjs.c:306
FT_Int version_minor
Definition: ftobjs.h:863
char FT_String
Definition: fttypes.h:183
void * FT_Pointer
Definition: fttypes.h:307
FT_Glyph_Class glyph_class
Definition: ftobjs.h:697
FT_UInt refcount
Definition: ftobjs.h:370
#define FT_MAX_MODULES
Definition: ftoption.h:368
FT_GlyphLoader glyph_loader
Definition: ftobjs.h:754
GLuint buffer
FT_Renderer cur_renderer
Definition: ftobjs.h:870
FT_Int version_major
Definition: ftobjs.h:862
FT_GlyphLoader loader
Definition: ftobjs.h:413
void * glyph_hints
Definition: ftobjs.h:418
GLsizei const GLfloat * value
signed short FT_Short
Definition: fttypes.h:194
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
Definition: ftsystem.h:66
FT_Glyph_Format glyph_format
Definition: ftobjs.h:696
FT_CMap_DoneFunc done
Definition: ftobjs.h:194
ft_glyphslot_free_bitmap(FT_GlyphSlot slot)
Definition: ftobjs.c:274
struct FT_RendererRec_ FT_RendererRec
FT_CMap_New(FT_CMap_Class clazz, FT_Pointer init_data, FT_CharMap charmap, FT_CMap *acmap)
Definition: ftobjs.c:3248
FT_CMap_Done(FT_CMap cmap)
Definition: ftobjs.c:3202
FT_UInt refcount
Definition: ftobjs.h:890
FT_Byte * raster_pool
Definition: ftobjs.h:873
FT_BEGIN_HEADER struct FT_Glyph_Metrics_ FT_Glyph_Metrics
FT_Memory memory
Definition: ftobjs.h:477
struct FT_Face_InternalRec_ FT_Face_InternalRec
unsigned int FT_UInt
Definition: fttypes.h:227
void(* FT_Bitmap_LcdFilterFunc)(FT_Bitmap *bitmap, FT_Render_Mode render_mode, FT_Library library)
Definition: ftobjs.h:784
enum FT_Glyph_Format_ FT_Glyph_Format
FT_Error(* FT_Face_GetGlyphNameFunc)(FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max)
Definition: ftobjs.h:909
FT_BEGIN_HEADER enum FT_LcdFilter_ FT_LcdFilter
const struct FT_CMap_ClassRec_ * FT_CMap_Class
Definition: ftobjs.h:128
FT_UInt(* FT_CMap_CharNextFunc)(FT_CMap cmap, FT_UInt32 *achar_code)
Definition: ftobjs.h:161
FT_ServiceCacheRec services
Definition: ftobjs.h:363
FT_Get_Module_Interface(FT_Library library, const char *mod_name)
Definition: ftobjs.c:4337
FT_Matrix transform_matrix
Definition: ftobjs.h:359
struct FT_DriverRec_ FT_DriverRec
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
FT_Renderer_Class * clazz
Definition: ftobjs.h:695
FT_CharMapRec charmap
Definition: ftobjs.h:133
FT_CMap_Class clazz
Definition: ftobjs.h:134
FT_CMap_CharNextFunc char_next
Definition: ftobjs.h:196
FT_CMap_InitFunc init
Definition: ftobjs.h:193
unsigned short FT_UShort
Definition: fttypes.h:205
FT_Error(* FT_CMap_InitFunc)(FT_CMap cmap, FT_Pointer init_data)
Definition: ftobjs.h:150
FT_CMap_VariantCharListFunc variantchar_list
Definition: ftobjs.h:205
FT_Matrix glyph_matrix
Definition: ftobjs.h:416
GLsizeiptr size
FT_UInt num_modules
Definition: ftobjs.h:866
FT_UInt32 *(* FT_CMap_CharVariantListFunc)(FT_CMap cmap, FT_Memory mem, FT_UInt32 char_code)
Definition: ftobjs.h:180
FT_Done_Memory(FT_Memory memory)
Definition: ftsystem.c:515
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
FT_UInt(* FT_CMap_CharVarIndexFunc)(FT_CMap cmap, FT_CMap unicode_cmap, FT_UInt32 char_code, FT_UInt32 variant_selector)
Definition: ftobjs.h:165
FT_CMap_CharVarIsDefaultFunc char_var_default
Definition: ftobjs.h:202
FT_Bool(* FT_CMap_CharVarIsDefaultFunc)(FT_CMap cmap, FT_UInt32 char_code, FT_UInt32 variant_selector)
Definition: ftobjs.h:171
FT_Error(* FT_Renderer_RenderFunc)(FT_Renderer renderer, FT_GlyphSlot slot, FT_UInt mode, const FT_Vector *origin)
Definition: ftrender.h:88
FT_Vector transform_delta
Definition: ftobjs.h:360
ft_highpow2(FT_UInt32 value)
Definition: ftutil.c:415