LOCAL_FUNC FT_Error TT_New_GlyphZone(FT_Memory memory, FT_UShort maxPoints, FT_Short maxContours, TT_GlyphZone *zone) { FT_Error error; if(maxPoints > 0) { maxPoints += 2; } MEM_Set(zone, 0, sizeof(*zone)); zone->memory = memory; if(ALLOC_ARRAY(zone->org, maxPoints * 2, FT_F26Dot6) || ALLOC_ARRAY(zone->cur, maxPoints * 2, FT_F26Dot6) || ALLOC_ARRAY(zone->tags, maxPoints, FT_Byte) || ALLOC_ARRAY(zone->contours, maxContours, FT_UShort)) { TT_Done_GlyphZone(zone); } return error; }
LOCAL_FUNC void TT_Done_Size(TT_Size size) { #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER FT_Memory memory = size->root.face->memory; if(size->debug) { /* the debug context must be deleted by the debugger itself */ size->context = NULL; size->debug = FALSE; } FREE(size->cvt); size->cvt_size = 0; /* free storage area */ FREE(size->storage); size->storage_size = 0; /* twilight zone */ TT_Done_GlyphZone(&size->twilight); FREE(size->function_defs); FREE(size->instruction_defs); size->num_function_defs = 0; size->max_function_defs = 0; size->num_instruction_defs = 0; size->max_instruction_defs = 0; size->max_func = 0; size->max_ins = 0; #endif size->ttmetrics.valid = FALSE; }
TT_New_GlyphZone( FT_Memory memory, FT_UShort maxPoints, FT_Short maxContours, TT_GlyphZone zone ) { FT_Error error; if ( maxPoints > 0 ) maxPoints += 2; FT_MEM_SET( zone, 0, sizeof ( *zone ) ); zone->memory = memory; if ( FT_NEW_ARRAY( zone->org, maxPoints * 2 ) || FT_NEW_ARRAY( zone->cur, maxPoints * 2 ) || FT_NEW_ARRAY( zone->tags, maxPoints ) || FT_NEW_ARRAY( zone->contours, maxContours ) ) { TT_Done_GlyphZone( zone ); } return error; }