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
40 #ifdef FT_CONFIG_OPTION_INCREMENTAL
41 #include FT_INCREMENTAL_H
70 #define FT_MIN( a, b ) ( (a) < (b) ? (a) : (b) )
71 #define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) )
73 #define FT_ABS( a ) ( (a) < 0 ? -(a) : (a) )
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 )
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 )
98 #define ft_isdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U )
100 #define ft_isxdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U || \
101 ( (unsigned)(x) - 'a' ) < 6U || \
102 ( (unsigned)(x) - 'A' ) < 6U )
105 #define ft_isupper( x ) ( ( (unsigned)(x) - 'A' ) < 26U )
106 #define ft_islower( x ) ( ( (unsigned)(x) - 'a' ) < 26U )
108 #define ft_isalpha( x ) ( ft_isupper( x ) || ft_islower( x ) )
109 #define ft_isalnum( x ) ( ft_isdigit( x ) || ft_isalpha( x ) )
139 #define FT_CMAP( x ) ((FT_CMap)( x ))
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
158 FT_UInt32 char_code );
162 FT_UInt32 *achar_code );
166 FT_CMap unicode_cmap,
168 FT_UInt32 variant_selector );
173 FT_UInt32 variant_selector );
176 (*FT_CMap_VariantListFunc)( FT_CMap
cmap,
180 (*FT_CMap_CharVariantListFunc)( FT_CMap
cmap,
182 FT_UInt32 char_code );
185 (*FT_CMap_VariantCharListFunc)( FT_CMap
cmap,
187 FT_UInt32 variant_selector );
209 #ifndef FT_CONFIG_OPTION_PIC
211 #define FT_DECLARE_CMAP_CLASS(class_) \
212 FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
214 #define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_, \
215 char_next_, char_var_index_, char_var_default_, variant_list_, \
216 charvariant_list_, variantchar_list_) \
217 FT_CALLBACK_TABLE_DEF \
218 const FT_CMap_ClassRec class_ = \
220 size_, init_, done_, char_index_, char_next_, char_var_index_, \
221 char_var_default_, variant_list_, charvariant_list_, variantchar_list_ \
225 #define FT_DECLARE_CMAP_CLASS(class_) \
226 void FT_Init_Class_##class_( FT_Library library, FT_CMap_ClassRec* clazz);
228 #define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_, \
229 char_next_, char_var_index_, char_var_default_, variant_list_, \
230 charvariant_list_, variantchar_list_) \
232 FT_Init_Class_##class_( FT_Library library, \
233 FT_CMap_ClassRec* clazz) \
235 FT_UNUSED(library); \
236 clazz->size = size_; \
237 clazz->init = init_; \
238 clazz->done = done_; \
239 clazz->char_index = char_index_; \
240 clazz->char_next = char_next_; \
241 clazz->char_var_index = char_var_index_; \
242 clazz->char_var_default = char_var_default_; \
243 clazz->variant_list = variant_list_; \
244 clazz->charvariant_list = charvariant_list_; \
245 clazz->variantchar_list = variantchar_list_; \
322 #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
332 #ifdef FT_CONFIG_OPTION_INCREMENTAL
376 #define FT_GLYPH_OWN_BITMAP 0x1
403 typedef struct FT_Size_InternalRec_
407 } FT_Size_InternalRec;
449 #define FT_MODULE( x ) ((FT_Module)( x ))
450 #define FT_MODULE_CLASS( x ) FT_MODULE( x )->clazz
451 #define FT_MODULE_LIBRARY( x ) FT_MODULE( x )->library
452 #define FT_MODULE_MEMORY( x ) FT_MODULE( x )->memory
455 #define FT_MODULE_IS_DRIVER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
456 FT_MODULE_FONT_DRIVER )
458 #define FT_MODULE_IS_RENDERER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
461 #define FT_MODULE_IS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
464 #define FT_MODULE_IS_STYLER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
467 #define FT_DRIVER_IS_SCALABLE( x ) ( FT_MODULE_CLASS( x )->module_flags & \
468 FT_MODULE_DRIVER_SCALABLE )
470 #define FT_DRIVER_USES_OUTLINES( x ) !( FT_MODULE_CLASS( x )->module_flags & \
471 FT_MODULE_DRIVER_NO_OUTLINES )
473 #define FT_DRIVER_HAS_HINTER( x ) ( FT_MODULE_CLASS( x )->module_flags & \
474 FT_MODULE_DRIVER_HAS_HINTER )
500 const char* mod_name );
504 const char* service_id );
523 #define FT_FACE( x ) ((FT_Face)(x))
524 #define FT_SIZE( x ) ((FT_Size)(x))
525 #define FT_SLOT( x ) ((FT_GlyphSlot)(x))
527 #define FT_FACE_DRIVER( x ) FT_FACE( x )->driver
528 #define FT_FACE_LIBRARY( x ) FT_FACE_DRIVER( x )->root.library
529 #define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
530 #define FT_FACE_STREAM( x ) FT_FACE( x )->stream
532 #define FT_SIZE_FACE( x ) FT_SIZE( x )->face
533 #define FT_SLOT_FACE( x ) FT_SLOT( x )->face
535 #define FT_FACE_SLOT( x ) FT_FACE( x )->glyph
536 #define FT_FACE_SIZE( x ) FT_FACE( x )->size
582 #define FT_REQUEST_WIDTH( req ) \
583 ( (req)->horiResolution \
584 ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \
587 #define FT_REQUEST_HEIGHT( req ) \
588 ( (req)->vertResolution \
589 ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \
652 #define FT_RENDERER( x ) ((FT_Renderer)( x ))
653 #define FT_GLYPH( x ) ((FT_Glyph)( x ))
654 #define FT_BITMAP_GLYPH( x ) ((FT_BitmapGlyph)( x ))
655 #define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
686 #define FT_DRIVER( x ) ((FT_Driver)(x))
689 #define FT_DRIVER_CLASS( x ) FT_DRIVER( x )->clazz
740 #define FT_DEBUG_HOOK_TRUETYPE 0
747 #define FT_DEBUG_HOOK_UNPATENTED_HINTING 1
845 #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
852 #ifdef FT_CONFIG_OPTION_PIC
853 FT_PIC_Container pic_container;
885 #ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
925 #ifndef FT_NO_DEFAULT_RASTER
955 #ifndef FT_CONFIG_OPTION_PIC
957 #define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \
958 cubic_to_, shift_, delta_) \
959 static const FT_Outline_Funcs class_ = \
961 move_to_, line_to_, conic_to_, cubic_to_, shift_, delta_ \
966 #define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_, \
967 cubic_to_, shift_, delta_) \
969 Init_Class_##class_( FT_Outline_Funcs* clazz ) \
971 clazz->move_to = move_to_; \
972 clazz->line_to = line_to_; \
973 clazz->conic_to = conic_to_; \
974 clazz->cubic_to = cubic_to_; \
975 clazz->shift = shift_; \
976 clazz->delta = delta_; \
995 #ifndef FT_CONFIG_OPTION_PIC
997 #define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \
998 raster_reset_, raster_set_mode_, \
999 raster_render_, raster_done_) \
1000 const FT_Raster_Funcs class_ = \
1002 glyph_format_, raster_new_, raster_reset_, \
1003 raster_set_mode_, raster_render_, raster_done_ \
1008 #define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_, \
1009 raster_reset_, raster_set_mode_, raster_render_, raster_done_) \
1011 FT_Init_Class_##class_( FT_Raster_Funcs* clazz ) \
1013 clazz->glyph_format = glyph_format_; \
1014 clazz->raster_new = raster_new_; \
1015 clazz->raster_reset = raster_reset_; \
1016 clazz->raster_set_mode = raster_set_mode_; \
1017 clazz->raster_render = raster_render_; \
1018 clazz->raster_done = raster_done_; \
1050 #ifndef FT_CONFIG_OPTION_PIC
1052 #define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \
1053 transform_, bbox_, prepare_) \
1054 FT_CALLBACK_TABLE_DEF \
1055 const FT_Glyph_Class class_ = \
1057 size_, format_, init_, done_, copy_, transform_, bbox_, prepare_ \
1062 #define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_, \
1063 transform_, bbox_, prepare_) \
1065 FT_Init_Class_##class_( FT_Glyph_Class* clazz ) \
1067 clazz->glyph_size = size_; \
1068 clazz->glyph_format = format_; \
1069 clazz->glyph_init = init_; \
1070 clazz->glyph_done = done_; \
1071 clazz->glyph_copy = copy_; \
1072 clazz->glyph_transform = transform_; \
1073 clazz->glyph_bbox = bbox_; \
1074 clazz->glyph_prepare = prepare_; \
1115 #ifndef FT_CONFIG_OPTION_PIC
1117 #define FT_DECLARE_RENDERER(class_) \
1118 FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
1120 #define FT_DEFINE_RENDERER(class_, \
1121 flags_, size_, name_, version_, requires_, \
1122 interface_, init_, done_, get_interface_, \
1123 glyph_format_, render_glyph_, transform_glyph_, \
1124 get_glyph_cbox_, set_mode_, raster_class_ ) \
1125 FT_CALLBACK_TABLE_DEF \
1126 const FT_Renderer_Class class_ = \
1128 FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_, \
1129 interface_,init_,done_,get_interface_) \
1142 #define FT_DECLARE_RENDERER(class_) FT_DECLARE_MODULE(class_)
1144 #define FT_DEFINE_RENDERER(class_, \
1145 flags_, size_, name_, version_, requires_, \
1146 interface_, init_, done_, get_interface_, \
1147 glyph_format_, render_glyph_, transform_glyph_, \
1148 get_glyph_cbox_, set_mode_, raster_class_ ) \
1151 FT_Destroy_Class_##class_( FT_Library library, \
1152 FT_Module_Class* clazz ) \
1154 FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz; \
1155 FT_Memory memory = library->memory; \
1156 class_##_pic_free( library ); \
1158 FT_FREE( rclazz ); \
1162 FT_Create_Class_##class_( FT_Library library, \
1163 FT_Module_Class** output_class ) \
1165 FT_Renderer_Class* clazz; \
1167 FT_Memory memory = library->memory; \
1169 if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \
1172 error = class_##_pic_init( library ); \
1179 FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_, \
1180 interface_,init_,done_,get_interface_) \
1182 clazz->glyph_format = glyph_format_; \
1184 clazz->render_glyph = render_glyph_; \
1185 clazz->transform_glyph = transform_glyph_; \
1186 clazz->get_glyph_cbox = get_glyph_cbox_; \
1187 clazz->set_mode = set_mode_; \
1189 clazz->raster_class = raster_class_; \
1191 *output_class = (FT_Module_Class*)clazz; \
1212 #ifdef FT_CONFIG_OPTION_PIC
1245 (*FT_Module_Destroyer)(
FT_Memory memory,
1294 #ifndef FT_CONFIG_OPTION_PIC
1296 #define FT_DECLARE_MODULE(class_) \
1298 const FT_Module_Class class_; \
1300 #define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_, \
1301 interface_, init_, done_, get_interface_) \
1317 #define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \
1318 interface_, init_, done_, get_interface_) \
1319 FT_CALLBACK_TABLE_DEF \
1320 const FT_Module_Class class_ = \
1339 #define FT_DECLARE_MODULE(class_) \
1340 FT_Error FT_Create_Class_##class_( FT_Library library, \
1341 FT_Module_Class** output_class ); \
1342 void FT_Destroy_Class_##class_( FT_Library library, \
1343 FT_Module_Class* clazz );
1345 #define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_, \
1346 interface_, init_, done_, get_interface_) \
1347 clazz->root.module_flags = flags_; \
1348 clazz->root.module_size = size_; \
1349 clazz->root.module_name = name_; \
1350 clazz->root.module_version = version_; \
1351 clazz->root.module_requires = requires_; \
1353 clazz->root.module_interface = interface_; \
1355 clazz->root.module_init = init_; \
1356 clazz->root.module_done = done_; \
1357 clazz->root.get_interface = get_interface_;
1359 #define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_, \
1360 interface_, init_, done_, get_interface_) \
1363 FT_Destroy_Class_##class_( FT_Library library, \
1364 FT_Module_Class* clazz ) \
1366 FT_Memory memory = library->memory; \
1367 class_##_pic_free( library ); \
1373 FT_Create_Class_##class_( FT_Library library, \
1374 FT_Module_Class** output_class ) \
1376 FT_Memory memory = library->memory; \
1377 FT_Module_Class* clazz; \
1380 if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \
1382 error = class_##_pic_init( library ); \
1389 clazz->module_flags = flags_; \
1390 clazz->module_size = size_; \
1391 clazz->module_name = name_; \
1392 clazz->module_version = version_; \
1393 clazz->module_requires = requires_; \
1395 clazz->module_interface = interface_; \
1397 clazz->module_init = init_; \
1398 clazz->module_done = done_; \
1399 clazz->get_interface = get_interface_; \
1401 *output_class = clazz; \
ft_glyphslot_set_bitmap(FT_GlyphSlot slot, FT_Byte *buffer)
FT_ULong raster_pool_size
FT_Raster_Render_Func raster_render
FT_UInt(* FT_CMap_CharVarIndexFunc)(FT_CMap cmap, FT_CMap unicode_cmap, FT_UInt32 char_code, FT_UInt32 variant_selector)
FT_BEGIN_HEADER typedef signed long FT_Pos
FT_Renderer_RenderFunc render
FT_CMap_CharVarIndexFunc char_var_index
ft_synthesize_vertical_metrics(FT_Glyph_Metrics *metrics, FT_Pos advance)
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
typedefFT_BEGIN_HEADER struct FT_Glyph_Class_ FT_Glyph_Class
FT_Select_Metrics(FT_Face face, FT_ULong strike_index)
struct FT_RasterRec_ * FT_Raster
FT_UInt(* FT_CMap_CharIndexFunc)(FT_CMap cmap, FT_UInt32 char_code)
struct FT_LibraryRec_ FT_LibraryRec
enum FT_Render_Mode_ FT_Render_Mode
struct FT_ModuleRec_ FT_ModuleRec
GLuint GLsizei GLsizei GLfloat * metrics
FT_New_GlyphSlot(FT_Face face, FT_GlyphSlot *aslot)
FT_Bool ignore_unpatented_hinter
FT_UInt(* FT_CMap_CharNextFunc)(FT_CMap cmap, FT_UInt32 *achar_code)
FT_Error(* FT_Face_GetGlyphNameFunc)(FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max)
FT_Done_GlyphSlot(FT_GlyphSlot slot)
FT_Render_Glyph_Internal(FT_Library library, FT_GlyphSlot slot, FT_Render_Mode render_mode)
const char *(* FT_Face_GetPostscriptNameFunc)(FT_Face face)
FT_Lookup_Renderer(FT_Library library, FT_Glyph_Format format, FT_ListNode *node)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
typedefFT_BEGIN_HEADER struct FT_GlyphLoaderRec_ * FT_GlyphLoader
struct FT_Slot_InternalRec_ FT_GlyphSlot_InternalRec
FT_CMap_CharIndexFunc char_index
void(* FT_CMap_DoneFunc)(FT_CMap cmap)
FT_CMap_VariantListFunc variant_list
FT_UInt32 *(* FT_CMap_VariantListFunc)(FT_CMap cmap, FT_Memory mem)
struct FT_CMapRec_ * FT_CMap
FT_Bool glyph_transformed
struct FT_CMap_ClassRec_ * FT_CMap_Class
FT_CMap_CharVariantListFunc charvariant_list
EGLContext EGLenum EGLClientBuffer buffer
FT_Match_Size(FT_Face face, FT_Size_Request req, FT_Bool ignore_width, FT_ULong *size_index)
struct FT_CMapRec_ FT_CMapRec
ft_module_get_service(FT_Module module, const char *service_id)
struct FT_CMap_ClassRec_ FT_CMap_ClassRec
#define FT_Raster_Render_Func
FT_Request_Metrics(FT_Face face, FT_Size_Request req)
ft_glyphslot_alloc_bitmap(FT_GlyphSlot slot, FT_ULong size)
FT_UInt32 *(* FT_CMap_VariantCharListFunc)(FT_CMap cmap, FT_Memory mem, FT_UInt32 variant_selector)
FT_Glyph_Class glyph_class
FT_GlyphLoader glyph_loader
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
FT_DebugHook_Func debug_hooks[4]
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_Glyph_Format glyph_format
FT_Bool(* FT_CMap_CharVarIsDefaultFunc)(FT_CMap cmap, FT_UInt32 char_code, FT_UInt32 variant_selector)
ft_glyphslot_free_bitmap(FT_GlyphSlot slot)
struct FT_RendererRec_ FT_RendererRec
FT_CMap_New(FT_CMap_Class clazz, FT_Pointer init_data, FT_CharMap charmap, FT_CMap *acmap)
FT_CMap_Done(FT_CMap cmap)
EGLSurface EGLint void ** value
FT_BEGIN_HEADER struct FT_Glyph_Metrics_ FT_Glyph_Metrics
struct FT_Face_InternalRec_ FT_Face_InternalRec
enum FT_Glyph_Format_ FT_Glyph_Format
FT_BEGIN_HEADER enum FT_LcdFilter_ FT_LcdFilter
FT_Error(* FT_CMap_InitFunc)(FT_CMap cmap, FT_Pointer init_data)
FT_ServiceCacheRec services
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
FT_Get_Module_Interface(FT_Library library, const char *mod_name)
FT_Matrix transform_matrix
struct FT_DriverRec_ FT_DriverRec
FT_Renderer_Class * clazz
void(* FT_Bitmap_LcdFilterFunc)(FT_Bitmap *bitmap, FT_Render_Mode render_mode, FT_Library library)
FT_CMap_CharNextFunc char_next
void(* FT_DebugHook_Func)(void *arg)
FT_UInt(* FT_Face_GetGlyphNameIndexFunc)(FT_Face face, FT_String *glyph_name)
FT_Error(* FT_Renderer_RenderFunc)(FT_Renderer renderer, FT_GlyphSlot slot, FT_UInt mode, const FT_Vector *origin)
FT_CMap_VariantCharListFunc variantchar_list
FT_UInt32 *(* FT_CMap_CharVariantListFunc)(FT_CMap cmap, FT_Memory mem, FT_UInt32 char_code)
FT_Done_Memory(FT_Memory memory)
FT_Module modules[FT_MAX_MODULES]
FT_CMap_CharVarIsDefaultFunc char_var_default
FT_Vector transform_delta
ft_highpow2(FT_UInt32 value)