|
|
|
@ -2731,48 +2731,53 @@ |
|
|
|
|
/* now load the unscaled outline */ |
|
|
|
|
error = cff_get_glyph_data( face, glyph_index, |
|
|
|
|
&charstring, &charstring_len ); |
|
|
|
|
if ( !error ) |
|
|
|
|
{ |
|
|
|
|
error = cff_decoder_prepare( &decoder, size, glyph_index ); |
|
|
|
|
if ( !error ) |
|
|
|
|
{ |
|
|
|
|
error = cff_decoder_parse_charstrings( &decoder, |
|
|
|
|
charstring, |
|
|
|
|
charstring_len ); |
|
|
|
|
if ( error ) |
|
|
|
|
goto Glyph_Build_Finished; |
|
|
|
|
|
|
|
|
|
error = cff_decoder_prepare( &decoder, size, glyph_index ); |
|
|
|
|
if ( error ) |
|
|
|
|
goto Glyph_Build_Finished; |
|
|
|
|
|
|
|
|
|
cff_free_glyph_data( face, &charstring, charstring_len ); |
|
|
|
|
error = cff_decoder_parse_charstrings( &decoder, |
|
|
|
|
charstring, |
|
|
|
|
charstring_len ); |
|
|
|
|
|
|
|
|
|
cff_free_glyph_data( face, &charstring, charstring_len ); |
|
|
|
|
|
|
|
|
|
if ( error ) |
|
|
|
|
goto Glyph_Build_Finished; |
|
|
|
|
|
|
|
|
|
#ifdef FT_CONFIG_OPTION_INCREMENTAL |
|
|
|
|
/* Control data and length may not be available for incremental */ |
|
|
|
|
/* fonts. */ |
|
|
|
|
if ( face->root.internal->incremental_interface ) |
|
|
|
|
{ |
|
|
|
|
glyph->root.control_data = 0; |
|
|
|
|
glyph->root.control_len = 0; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
/* Control data and length may not be available for incremental */ |
|
|
|
|
/* fonts. */ |
|
|
|
|
if ( face->root.internal->incremental_interface ) |
|
|
|
|
{ |
|
|
|
|
glyph->root.control_data = 0; |
|
|
|
|
glyph->root.control_len = 0; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
#endif /* FT_CONFIG_OPTION_INCREMENTAL */ |
|
|
|
|
|
|
|
|
|
/* We set control_data and control_len if charstrings is loaded. */ |
|
|
|
|
/* See how charstring loads at cff_index_access_element() in */ |
|
|
|
|
/* cffload.c. */ |
|
|
|
|
{ |
|
|
|
|
CFF_Index csindex = &cff->charstrings_index; |
|
|
|
|
/* We set control_data and control_len if charstrings is loaded. */ |
|
|
|
|
/* See how charstring loads at cff_index_access_element() in */ |
|
|
|
|
/* cffload.c. */ |
|
|
|
|
{ |
|
|
|
|
CFF_Index csindex = &cff->charstrings_index; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( csindex->offsets ) |
|
|
|
|
{ |
|
|
|
|
glyph->root.control_data = csindex->bytes + |
|
|
|
|
csindex->offsets[glyph_index] - 1; |
|
|
|
|
glyph->root.control_len = charstring_len; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ( csindex->offsets ) |
|
|
|
|
{ |
|
|
|
|
glyph->root.control_data = csindex->bytes + |
|
|
|
|
csindex->offsets[glyph_index] - 1; |
|
|
|
|
glyph->root.control_len = charstring_len; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* save new glyph tables */ |
|
|
|
|
cff_builder_done( &decoder.builder ); |
|
|
|
|
Glyph_Build_Finished: |
|
|
|
|
/* save new glyph tables, if no error */ |
|
|
|
|
if ( !error ) |
|
|
|
|
cff_builder_done( &decoder.builder ); |
|
|
|
|
/* XXX: anything to do for broken glyph entry? */ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifdef FT_CONFIG_OPTION_INCREMENTAL |
|
|
|
|