43#ifdef FT_CONFIG_OPTION_INCREMENTAL
74#define FT_MIN( a, b ) ( (a) < (b) ? (a) : (b) )
75#define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
77#define FT_ABS( a ) ( (a) < 0 ? -(a) : (a) )
84#define FT_HYPOT( x, y ) \
87 x > y ? x + ( 3 * y >> 3 ) \
88 : y + ( 3 * x >> 3 ) )
91#define FT_PAD_FLOOR( x, n ) ( (x) & ~FT_TYPEOF( x )( (n) - 1 ) )
92#define FT_PAD_ROUND( x, n ) FT_PAD_FLOOR( (x) + (n) / 2, n )
93#define FT_PAD_CEIL( x, n ) FT_PAD_FLOOR( (x) + (n) - 1, n )
95#define FT_PIX_FLOOR( x ) ( (x) & ~FT_TYPEOF( x )63 )
96#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
97#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
101#define FT_PAD_ROUND_LONG( x, n ) FT_PAD_FLOOR( ADD_LONG( (x), (n) / 2 ), \
103#define FT_PAD_CEIL_LONG( x, n ) FT_PAD_FLOOR( ADD_LONG( (x), (n) - 1 ), \
105#define FT_PIX_ROUND_LONG( x ) FT_PIX_FLOOR( ADD_LONG( (x), 32 ) )
106#define FT_PIX_CEIL_LONG( x ) FT_PIX_FLOOR( ADD_LONG( (x), 63 ) )
108#define FT_PAD_ROUND_INT32( x, n ) FT_PAD_FLOOR( ADD_INT32( (x), (n) / 2 ), \
110#define FT_PAD_CEIL_INT32( x, n ) FT_PAD_FLOOR( ADD_INT32( (x), (n) - 1 ), \
112#define FT_PIX_ROUND_INT32( x ) FT_PIX_FLOOR( ADD_INT32( (x), 32 ) )
113#define FT_PIX_CEIL_INT32( x ) FT_PIX_FLOOR( ADD_INT32( (x), 63 ) )
120#define ft_isdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U )
122#define ft_isxdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U || \
123 ( (unsigned)(x) - 'a' ) < 6U || \
124 ( (unsigned)(x) - 'A' ) < 6U )
127#define ft_isupper( x ) ( ( (unsigned)(x) - 'A' ) < 26U )
128#define ft_islower( x ) ( ( (unsigned)(x) - 'a' ) < 26U )
130#define ft_isalpha( x ) ( ft_isupper( x ) || ft_islower( x ) )
131#define ft_isalnum( x ) ( ft_isdigit( x ) || ft_isalpha( x ) )
155 FT_CharMapRec charmap;
161#define FT_CMAP( x ) ( (FT_CMap)( x ) )
164#define FT_CMAP_PLATFORM_ID( x ) FT_CMAP( x )->charmap.platform_id
165#define FT_CMAP_ENCODING_ID( x ) FT_CMAP( x )->charmap.encoding_id
166#define FT_CMAP_ENCODING( x ) FT_CMAP( x )->charmap.encoding
167#define FT_CMAP_FACE( x ) FT_CMAP( x )->charmap.face
172 (*FT_CMap_InitFunc)( FT_CMap cmap,
173 FT_Pointer init_data );
176 (*FT_CMap_DoneFunc)( FT_CMap cmap );
179 (*FT_CMap_CharIndexFunc)( FT_CMap cmap,
180 FT_UInt32 char_code );
183 (*FT_CMap_CharNextFunc)( FT_CMap cmap,
184 FT_UInt32 *achar_code );
187 (*FT_CMap_CharVarIndexFunc)( FT_CMap cmap,
188 FT_CMap unicode_cmap,
190 FT_UInt32 variant_selector );
193 (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap cmap,
195 FT_UInt32 variant_selector );
198 (*FT_CMap_VariantListFunc)( FT_CMap cmap,
202 (*FT_CMap_CharVariantListFunc)( FT_CMap cmap,
204 FT_UInt32 char_code );
207 (*FT_CMap_VariantCharListFunc)( FT_CMap cmap,
209 FT_UInt32 variant_selector );
216 FT_CMap_InitFunc init;
217 FT_CMap_DoneFunc done;
218 FT_CMap_CharIndexFunc char_index;
219 FT_CMap_CharNextFunc char_next;
224 FT_CMap_CharVarIndexFunc char_var_index;
225 FT_CMap_CharVarIsDefaultFunc char_var_default;
226 FT_CMap_VariantListFunc variant_list;
227 FT_CMap_CharVariantListFunc charvariant_list;
228 FT_CMap_VariantCharListFunc variantchar_list;
233#define FT_DECLARE_CMAP_CLASS( class_ ) \
234 FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
236#define FT_DEFINE_CMAP_CLASS( \
247 variantchar_list_ ) \
248 FT_CALLBACK_TABLE_DEF \
249 const FT_CMap_ClassRec class_ = \
266 FT_CMap_New( FT_CMap_Class clazz,
267 FT_Pointer init_data,
273 FT_CMap_Done( FT_CMap cmap );
278 ft_lcd_padding( FT_BBox* cbox,
280 FT_Render_Mode mode );
301 find_unicode_charmap( FT_Face face );
304#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
306 typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
312 ft_lcd_filter_fir( FT_Bitmap* bitmap,
313 FT_LcdFiveTapFilter weights );
385 FT_Matrix transform_matrix;
386 FT_Vector transform_delta;
387 FT_Int transform_flags;
389 FT_ServiceCacheRec services;
391#ifdef FT_CONFIG_OPTION_INCREMENTAL
392 FT_Incremental_InterfaceRec* incremental_interface;
395 FT_Char no_stem_darkening;
396 FT_Int32 random_seed;
398#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
399 FT_LcdFiveTapFilter lcd_weights;
400 FT_Bitmap_LcdFilterFunc lcd_filter_func;
405 } FT_Face_InternalRec;
447#define FT_GLYPH_OWN_BITMAP 0x1U
448#define FT_GLYPH_OWN_GZIP_SVG 0x2U
452 FT_GlyphLoader loader;
454 FT_Bool glyph_transformed;
455 FT_Matrix glyph_matrix;
456 FT_Vector glyph_delta;
461 } FT_GlyphSlot_InternalRec;
488 FT_Render_Mode autohint_mode;
489 FT_Size_Metrics autohint_metrics;
491 } FT_Size_InternalRec;
527 const FT_Module_Class* clazz;
535#define FT_MODULE( x ) ( (FT_Module)(x) )
537#define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
538#define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
539#define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
542#define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
543 FT_MODULE_FONT_DRIVER )
545#define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
548#define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
551#define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
554#define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS( x )->module_flags & \
555 FT_MODULE_DRIVER_SCALABLE )
557#define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS( x )->module_flags & \
558 FT_MODULE_DRIVER_NO_OUTLINES )
560#define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
561 FT_MODULE_DRIVER_HAS_HINTER )
563#define FT_DRIVER_HINTS_LIGHTLY( x ) ( FT_MODULE_CLASS( x )->module_flags & \
564 FT_MODULE_DRIVER_HINTS_LIGHTLY )
590 FT_BASE(
const void* )
591 FT_Get_Module_Interface( FT_Library library,
592 const char* mod_name );
594 FT_BASE( FT_Pointer )
595 ft_module_get_service( FT_Module module,
596 const char* service_id,
599#ifdef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
601 ft_property_string_set( FT_Library library,
602 const FT_String* module_name,
603 const FT_String* property_name,
624#define FT_FACE( x ) ( (FT_Face)(x) )
625#define FT_SIZE( x ) ( (FT_Size)(x) )
626#define FT_SLOT( x ) ( (FT_GlyphSlot)(x) )
628#define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
629#define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
630#define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
631#define FT_FACE_STREAM( x ) FT_FACE( x )->stream
656 FT_New_GlyphSlot( FT_Face face,
657 FT_GlyphSlot *aslot );
675 FT_Done_GlyphSlot( FT_GlyphSlot slot );
679#define FT_REQUEST_WIDTH( req ) \
680 ( (req)->horiResolution \
681 ? ( (req)->width * (FT_Pos)(req)->horiResolution + 36 ) / 72 \
684#define FT_REQUEST_HEIGHT( req ) \
685 ( (req)->vertResolution \
686 ? ( (req)->height * (FT_Pos)(req)->vertResolution + 36 ) / 72 \
692 FT_Select_Metrics( FT_Face face,
693 FT_ULong strike_index );
698 FT_Request_Metrics( FT_Face face,
699 FT_Size_Request req );
704 FT_Match_Size( FT_Face face,
706 FT_Bool ignore_width,
707 FT_ULong* size_index );
713 ft_synthesize_vertical_metrics( FT_Glyph_Metrics* metrics,
720 ft_glyphslot_free_bitmap( FT_GlyphSlot slot );
726 ft_glyphslot_preset_bitmap( FT_GlyphSlot slot,
728 const FT_Vector* origin );
732 ft_glyphslot_alloc_bitmap( FT_GlyphSlot slot,
739 ft_glyphslot_set_bitmap( FT_GlyphSlot slot,
756#define FT_RENDERER( x ) ( (FT_Renderer)(x) )
757#define FT_GLYPH( x ) ( (FT_Glyph)(x) )
758#define FT_BITMAP_GLYPH( x ) ( (FT_BitmapGlyph)(x) )
759#define FT_OUTLINE_GLYPH( x ) ( (FT_OutlineGlyph)(x) )
765 FT_Renderer_Class* clazz;
766 FT_Glyph_Format glyph_format;
767 FT_Glyph_Class glyph_class;
770 FT_Raster_Render_Func raster_render;
771 FT_Renderer_RenderFunc render;
790#define FT_DRIVER( x ) ( (FT_Driver)(x) )
793#define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
823 FT_Driver_Class clazz;
824 FT_ListRec faces_list;
825 FT_GlyphLoader glyph_loader;
918 FT_Int version_major;
919 FT_Int version_minor;
920 FT_Int version_patch;
923 FT_Module modules[FT_MAX_MODULES];
925 FT_ListRec renderers;
926 FT_Renderer cur_renderer;
927 FT_Module auto_hinter;
929 FT_DebugHook_Func debug_hooks[4];
931#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
932 FT_LcdFiveTapFilter lcd_weights;
933 FT_Bitmap_LcdFilterFunc lcd_filter_func;
935 FT_Vector lcd_geometry[3];
943 FT_BASE( FT_Renderer )
944 FT_Lookup_Renderer( FT_Library library,
945 FT_Glyph_Format format,
949 FT_Render_Glyph_Internal( FT_Library library,
951 FT_Render_Mode render_mode );
954 (*FT_Face_GetPostscriptNameFunc)( FT_Face face );
957 (*FT_Face_GetGlyphNameFunc)( FT_Face face,
960 FT_UInt buffer_max );
963 (*FT_Face_GetGlyphNameIndexFunc)( FT_Face face,
964 const FT_String* glyph_name );
967#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
981 FT_New_Memory(
void );
997 FT_Done_Memory( FT_Memory memory );
1008#ifndef FT_NO_DEFAULT_RASTER
1009 FT_EXPORT_VAR( FT_Raster_Funcs ) ft_default_raster;
1023#define FT_DEFINE_OUTLINE_FUNCS( \
1031 static const FT_Outline_Funcs class_ = \
1052#define FT_DEFINE_RASTER_FUNCS( \
1060 const FT_Raster_Funcs class_ = \
1081#define FT_DECLARE_GLYPH( class_ ) \
1082 FT_CALLBACK_TABLE const FT_Glyph_Class class_;
1084#define FT_DEFINE_GLYPH( \
1094 FT_CALLBACK_TABLE_DEF \
1095 const FT_Glyph_Class class_ = \
1126#define FT_DECLARE_RENDERER( class_ ) \
1127 FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
1129#define FT_DEFINE_RENDERER( \
1146 FT_CALLBACK_TABLE_DEF \
1147 const FT_Renderer_Class class_ = \
1149 FT_DEFINE_ROOT_MODULE( flags_, \
1195#define FT_DECLARE_MODULE( class_ ) \
1197 const FT_Module_Class class_;
1199#define FT_DEFINE_ROOT_MODULE( \
1224#define FT_DEFINE_MODULE( \
1235 FT_CALLBACK_TABLE_DEF \
1236 const FT_Module_Class class_ = \