28 #ifdef FT_OPTION_AUTOFIT2
32 #ifndef FT_CONFIG_OPTION_PIC
40 &af_dummy_script_class,
41 #ifdef FT_OPTION_AUTOFIT2
42 &af_latin2_script_class,
44 &af_latin_script_class,
46 &af_indic_script_class,
53 #define AF_SCRIPT_LIST_DEFAULT 2
55 #define AF_SCRIPT_LIST_NONE 0x7F
65 typedef struct AF_FaceGlobalsRec_
84 FT_Byte* gscripts = globals->glyph_scripts;
91 globals->glyph_count );
111 if ( clazz->script_uni_ranges ==
NULL )
118 for ( range = clazz->script_uni_ranges; range->
first != 0; range++ )
127 gindex < (
FT_ULong)globals->glyph_count &&
129 gscripts[gindex] = (
FT_Byte)ss;
135 if ( gindex == 0 || charcode > range->
last )
138 if ( gindex < (
FT_ULong)globals->glyph_count &&
140 gscripts[gindex] = (
FT_Byte)ss;
146 for ( i = 0x30; i <= 0x39; i++ )
151 if ( gindex != 0 && gindex < (
FT_ULong)globals->glyph_count )
164 for ( nn = 0; nn < globals->glyph_count; nn++ )
188 memory = face->memory;
190 if ( !
FT_ALLOC( globals,
sizeof ( *globals ) +
193 globals->face =
face;
194 globals->glyph_count = face->num_glyphs;
195 globals->glyph_scripts = (
FT_Byte*)( globals + 1 );
215 FT_Memory memory = globals->face->memory;
221 if ( globals->metrics[nn] )
226 FT_ASSERT( globals->metrics[nn]->clazz == clazz );
228 if ( clazz->script_metrics_done )
229 clazz->script_metrics_done( globals->metrics[nn] );
231 FT_FREE( globals->metrics[nn] );
235 globals->glyph_count = 0;
236 globals->glyph_scripts =
NULL;
237 globals->face =
NULL;
259 if ( gindex >= (
FT_ULong)globals->glyph_count )
261 error = AF_Err_Invalid_Argument;
266 if ( gidx == 0 || gidx + 1 >= script_max )
271 script = clazz->script;
273 metrics = globals->metrics[clazz->script];
274 if ( metrics ==
NULL )
277 FT_Memory memory = globals->face->memory;
280 if (
FT_ALLOC( metrics, clazz->script_metrics_size ) )
283 metrics->
clazz = clazz;
285 if ( clazz->script_metrics_init )
287 error = clazz->script_metrics_init( metrics, globals->face );
290 if ( clazz->script_metrics_done )
291 clazz->script_metrics_done( metrics );
298 globals->metrics[clazz->script] =
metrics;
312 if ( gindex < (
FT_ULong)globals->glyph_count )
#define FT_ALLOC(ptr, size)
FT_Get_Next_Char(FT_Face face, FT_ULong char_code, FT_UInt *agindex)
GLuint GLsizei GLsizei GLfloat * metrics
FT_BEGIN_HEADER typedef unsigned char FT_Bool
af_face_globals_new(FT_Face face, AF_FaceGlobals *aglobals)
#define FT_ASSERT(condition)
#define AF_SCRIPT_CLASSES_GET
struct AF_ScriptClassRec_ const * AF_ScriptClass
typedefFT_BEGIN_HEADER struct AF_FaceGlobalsRec_ * AF_FaceGlobals
#define AF_SCRIPT_LIST_NONE
FT_Get_Char_Index(FT_Face face, FT_ULong charcode)
FT_Select_Charmap(FT_Face face, FT_Encoding encoding)
af_face_globals_free(AF_FaceGlobals globals)
FT_Set_Charmap(FT_Face face, FT_CharMap charmap)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
af_face_globals_is_digit(AF_FaceGlobals globals, FT_UInt gindex)
struct AF_FaceGlobalsRec_ AF_FaceGlobalsRec
#define AF_SCRIPT_LIST_DEFAULT
#define FT_MEM_SET(dest, byte, count)
static AF_ScriptClass const af_script_classes[]
static FT_Error af_face_globals_compute_script_coverage(AF_FaceGlobals globals)
af_face_globals_get_metrics(AF_FaceGlobals globals, FT_UInt gindex, FT_UInt options, AF_ScriptMetrics *ametrics)