|
|
|
@ -686,6 +686,10 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
ft_cmap_done_internal( FT_CMap cmap ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
destroy_charmaps( FT_Face face, |
|
|
|
|
FT_Memory memory ) |
|
|
|
@ -698,7 +702,7 @@ |
|
|
|
|
FT_CMap cmap = FT_CMAP( face->charmaps[n] ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FT_CMap_Done( cmap ); |
|
|
|
|
ft_cmap_done_internal( cmap ); |
|
|
|
|
|
|
|
|
|
face->charmaps[n] = NULL; |
|
|
|
|
} |
|
|
|
@ -2255,20 +2259,63 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void |
|
|
|
|
ft_cmap_done_internal( FT_CMap cmap ) |
|
|
|
|
{ |
|
|
|
|
FT_CMap_Class clazz = cmap->clazz; |
|
|
|
|
FT_Face face = cmap->charmap.face; |
|
|
|
|
FT_Memory memory = FT_FACE_MEMORY(face); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( clazz->done ) |
|
|
|
|
clazz->done( cmap ); |
|
|
|
|
|
|
|
|
|
FT_FREE( cmap ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FT_BASE_DEF( void ) |
|
|
|
|
FT_CMap_Done( FT_CMap cmap ) |
|
|
|
|
{ |
|
|
|
|
if ( cmap ) |
|
|
|
|
{ |
|
|
|
|
FT_CMap_Class clazz = cmap->clazz; |
|
|
|
|
FT_Face face = cmap->charmap.face; |
|
|
|
|
FT_Memory memory = FT_FACE_MEMORY(face); |
|
|
|
|
FT_Face face = cmap->charmap.face; |
|
|
|
|
FT_Memory memory = FT_FACE_MEMORY( face ); |
|
|
|
|
FT_Error error; |
|
|
|
|
FT_Int i, j; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for ( i = 0; i < face->num_charmaps; i++ ) |
|
|
|
|
{ |
|
|
|
|
if ( (FT_CMap)face->charmaps[i] == cmap ) |
|
|
|
|
{ |
|
|
|
|
FT_CharMap last_charmap = face->charmaps[face->num_charmaps - 1]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( FT_RENEW_ARRAY( face->charmaps, |
|
|
|
|
face->num_charmaps, |
|
|
|
|
face->num_charmaps - 1 ) ) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
/* remove it from our list of charmaps */ |
|
|
|
|
for ( j = i + 1; j < face->num_charmaps; j++ ) |
|
|
|
|
{ |
|
|
|
|
if ( j == face->num_charmaps - 1 ) |
|
|
|
|
face->charmaps[j - 1] = last_charmap; |
|
|
|
|
else |
|
|
|
|
face->charmaps[j - 1] = face->charmaps[j]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
face->num_charmaps--; |
|
|
|
|
|
|
|
|
|
if ( (FT_CMap)face->charmap == cmap ) |
|
|
|
|
face->charmap = NULL; |
|
|
|
|
|
|
|
|
|
if ( clazz->done ) |
|
|
|
|
clazz->done( cmap ); |
|
|
|
|
ft_cmap_done_internal( cmap ); |
|
|
|
|
|
|
|
|
|
FT_FREE( cmap ); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2319,7 +2366,7 @@ |
|
|
|
|
return error; |
|
|
|
|
|
|
|
|
|
Fail: |
|
|
|
|
FT_CMap_Done( cmap ); |
|
|
|
|
ft_cmap_done_internal( cmap ); |
|
|
|
|
cmap = NULL; |
|
|
|
|
goto Exit; |
|
|
|
|
} |
|
|
|
|