|
|
|
@ -20,6 +20,7 @@ |
|
|
|
|
|
|
|
|
|
#include <t1gload.h> |
|
|
|
|
#include <t1load.h> |
|
|
|
|
#include <t1afm.h> |
|
|
|
|
|
|
|
|
|
#ifndef T1_CONFIG_OPTION_DISABLE_HINTER |
|
|
|
|
#include <t1hinter.h> |
|
|
|
@ -155,11 +156,50 @@ |
|
|
|
|
void T1_Done_Face( T1_Face face ) |
|
|
|
|
{ |
|
|
|
|
FT_Memory memory; |
|
|
|
|
T1_Font* type1 = &face->type1; |
|
|
|
|
|
|
|
|
|
if (face) |
|
|
|
|
{ |
|
|
|
|
memory = face->root.memory; |
|
|
|
|
/* XXXX : TO DO */ |
|
|
|
|
|
|
|
|
|
/* release font info strings */
|
|
|
|
|
{ |
|
|
|
|
T1_FontInfo* info = &type1->font_info; |
|
|
|
|
|
|
|
|
|
FREE( info->version ); |
|
|
|
|
FREE( info->notice ); |
|
|
|
|
FREE( info->full_name ); |
|
|
|
|
FREE( info->family_name ); |
|
|
|
|
FREE( info->weight ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* release top dictionary */
|
|
|
|
|
FREE( type1->charstrings_len ); |
|
|
|
|
FREE( type1->charstrings ); |
|
|
|
|
FREE( type1->glyph_names ); |
|
|
|
|
|
|
|
|
|
FREE( type1->subrs ); |
|
|
|
|
FREE( type1->subrs_len ); |
|
|
|
|
|
|
|
|
|
FREE( type1->subrs_block ); |
|
|
|
|
FREE( type1->charstrings_block ); |
|
|
|
|
FREE( type1->glyph_names_block ); |
|
|
|
|
|
|
|
|
|
FREE( type1->encoding.char_index ); |
|
|
|
|
FREE( type1->font_name ); |
|
|
|
|
|
|
|
|
|
#ifndef T1_CONFIG_OPTION_NO_AFM |
|
|
|
|
/* release afm data if present */ |
|
|
|
|
if ( face->afm_data) |
|
|
|
|
T1_Done_AFM( memory, (T1_AFM*)face->afm_data ); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
/* release unicode map, if any */ |
|
|
|
|
FREE( face->unicode_map.maps ); |
|
|
|
|
face->unicode_map.num_maps = 0; |
|
|
|
|
|
|
|
|
|
face->root.family_name = 0; |
|
|
|
|
face->root.style_name = 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -312,6 +352,66 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* charmap support - synthetize unicode charmap when possible */ |
|
|
|
|
{ |
|
|
|
|
FT_Face root = &face->root; |
|
|
|
|
FT_CharMap charmap = face->charmaprecs; |
|
|
|
|
|
|
|
|
|
/* synthesize a Unicode charmap if there is support in the "psnames" */ |
|
|
|
|
/* module.. */ |
|
|
|
|
if (face->psnames) |
|
|
|
|
{ |
|
|
|
|
PSNames_Interface* psnames = (PSNames_Interface*)face->psnames; |
|
|
|
|
if (psnames->unicode_value) |
|
|
|
|
{ |
|
|
|
|
error = psnames->build_unicodes( root->memory, |
|
|
|
|
face->type1.num_glyphs, |
|
|
|
|
(const char**)face->type1.glyph_names, |
|
|
|
|
&face->unicode_map ); |
|
|
|
|
if (!error) |
|
|
|
|
{ |
|
|
|
|
root->charmap = charmap; |
|
|
|
|
charmap->face = (FT_Face)face; |
|
|
|
|
charmap->encoding = ft_encoding_unicode; |
|
|
|
|
charmap->platform_id = 3; |
|
|
|
|
charmap->encoding_id = 1; |
|
|
|
|
charmap++; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* simply clear the error in case of failure (which really) */ |
|
|
|
|
/* means that out of memory or no unicode glyph names */ |
|
|
|
|
error = 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* now, support either the standard, expert, or custom encodings */ |
|
|
|
|
charmap->face = (FT_Face)face; |
|
|
|
|
charmap->platform_id = 7; /* a new platform id for Adobe fonts ?? */ |
|
|
|
|
|
|
|
|
|
switch (face->type1.encoding_type) |
|
|
|
|
{ |
|
|
|
|
case t1_encoding_standard: |
|
|
|
|
charmap->encoding = ft_encoding_adobe_standard; |
|
|
|
|
charmap->encoding_id = 0; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case t1_encoding_expert: |
|
|
|
|
charmap->encoding = ft_encoding_adobe_expert; |
|
|
|
|
charmap->encoding_id = 1; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
charmap->encoding = ft_encoding_adobe_custom; |
|
|
|
|
charmap->encoding_id = 2; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
root->charmaps = face->charmaps; |
|
|
|
|
root->num_charmaps = charmap - face->charmaprecs + 1; |
|
|
|
|
face->charmaps[0] = &face->charmaprecs[0]; |
|
|
|
|
face->charmaps[1] = &face->charmaprecs[1]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Leave: |
|
|
|
|
Done_Tokenizer( tokenizer ); |
|
|
|
|
|
|
|
|
|