* src/type1/t1load.c (parse_subrs, parse_dict): Handle synthetic
fonts properly.
This commit is contained in:
parent
52f911a12d
commit
34808199ce
|
@ -1,3 +1,8 @@
|
|||
2003-10-07 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
* src/type1/t1load.c (parse_subrs, parse_dict): Handle synthetic
|
||||
fonts properly.
|
||||
|
||||
2003-10-06 Werner Lemberg <wl@gnu.org>
|
||||
|
||||
Heavy modification of the PS parser to handle comments and strings
|
||||
|
|
|
@ -1030,15 +1030,11 @@
|
|||
PS_Table table = &loader->subrs;
|
||||
FT_Memory memory = parser->root.memory;
|
||||
FT_Error error;
|
||||
FT_Int n;
|
||||
FT_Int n, num_subrs;
|
||||
|
||||
PSAux_Service psaux = (PSAux_Service)face->psaux;
|
||||
|
||||
|
||||
if ( loader->num_subrs )
|
||||
/* with synthetic fonts it is possible we get here twice */
|
||||
return;
|
||||
|
||||
T1_Skip_Spaces( parser );
|
||||
|
||||
/* test for empty array */
|
||||
|
@ -1053,14 +1049,14 @@
|
|||
return;
|
||||
}
|
||||
|
||||
loader->num_subrs = (FT_Int)T1_ToInt( parser );
|
||||
num_subrs = (FT_Int)T1_ToInt( parser );
|
||||
|
||||
/* position the parser right before the `dup' of the first subr */
|
||||
T1_Skip_PS_Token( parser ); /* `array' */
|
||||
T1_Skip_Spaces ( parser );
|
||||
|
||||
/* initialize subrs array */
|
||||
error = psaux->ps_table_funcs->init( table, loader->num_subrs, memory );
|
||||
error = psaux->ps_table_funcs->init( table, num_subrs, memory );
|
||||
if ( error )
|
||||
goto Fail;
|
||||
|
||||
|
@ -1068,7 +1064,7 @@
|
|||
/* */
|
||||
/* `index' + binary data */
|
||||
/* */
|
||||
for ( n = 0; n < loader->num_subrs; n++ )
|
||||
for ( n = 0; n < num_subrs; n++ )
|
||||
{
|
||||
FT_Long idx, size;
|
||||
FT_Byte* base;
|
||||
|
@ -1099,6 +1095,10 @@
|
|||
T1_Skip_Spaces ( parser );
|
||||
}
|
||||
|
||||
/* with synthetic fonts it is possible we get here twice */
|
||||
if ( loader->num_subrs )
|
||||
continue;
|
||||
|
||||
/* some fonts use a value of -1 for lenIV to indicate that */
|
||||
/* the charstrings are unencoded */
|
||||
/* */
|
||||
|
@ -1124,6 +1124,9 @@
|
|||
if ( error )
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
loader->num_subrs = num_subrs;
|
||||
|
||||
return;
|
||||
|
||||
Fail:
|
||||
|
@ -1475,7 +1478,7 @@
|
|||
while ( cur < limit )
|
||||
{
|
||||
if ( *cur == 'k' && cur + 5 < limit &&
|
||||
ft_strncmp( (char*)cur, "known", 5 ) )
|
||||
ft_strncmp( (char*)cur, "known", 5 ) == 0 )
|
||||
break;
|
||||
|
||||
T1_Skip_PS_Token( parser );
|
||||
|
@ -1550,8 +1553,10 @@
|
|||
{
|
||||
/* We found it -- run the parsing callback! */
|
||||
/* We only record the first instance of any */
|
||||
/* field to deal adequately with synthetic fonts */
|
||||
if ( keyword_flag[0] == 0 )
|
||||
/* field to deal adequately with synthetic */
|
||||
/* fonts; /Subrs is handled specially. */
|
||||
if ( keyword_flag[0] == 0 ||
|
||||
ft_strcmp( (const char*)name, "Subrs" ) == 0 )
|
||||
{
|
||||
parser->root.error = t1_load_keyword( face,
|
||||
loader,
|
||||
|
|
Loading…
Reference in New Issue