* src/cid/cidload.c: Signature fixes.

This commit is contained in:
Werner Lemberg 2023-05-07 15:23:46 +02:00
parent 4a28ff3db8
commit 3297a7a9e0
1 changed files with 30 additions and 21 deletions

View File

@ -155,23 +155,24 @@
FT_CALLBACK_DEF( void ) FT_CALLBACK_DEF( void )
cid_parse_font_matrix( CID_Face face, cid_parse_font_matrix( FT_Face face, /* CID_Face */
CID_Parser* parser ) void* parser_ )
{ {
CID_Face cidface = (CID_Face)face;
CID_Parser* parser = (CID_Parser*)parser_;
CID_FaceDict dict; CID_FaceDict dict;
FT_Face root = (FT_Face)&face->root;
FT_Fixed temp[6]; FT_Fixed temp[6];
FT_Fixed temp_scale; FT_Fixed temp_scale;
if ( parser->num_dict < face->cid.num_dicts ) if ( parser->num_dict < cidface->cid.num_dicts )
{ {
FT_Matrix* matrix; FT_Matrix* matrix;
FT_Vector* offset; FT_Vector* offset;
FT_Int result; FT_Int result;
dict = face->cid.font_dicts + parser->num_dict; dict = cidface->cid.font_dicts + parser->num_dict;
matrix = &dict->font_matrix; matrix = &dict->font_matrix;
offset = &dict->font_offset; offset = &dict->font_offset;
@ -204,7 +205,7 @@
if ( temp_scale != 0x10000L ) if ( temp_scale != 0x10000L )
{ {
/* set units per EM based on FontMatrix values */ /* set units per EM based on FontMatrix values */
root->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale ); face->units_per_EM = (FT_UShort)FT_DivFix( 1000, temp_scale );
temp[0] = FT_DivFix( temp[0], temp_scale ); temp[0] = FT_DivFix( temp[0], temp_scale );
temp[1] = FT_DivFix( temp[1], temp_scale ); temp[1] = FT_DivFix( temp[1], temp_scale );
@ -237,13 +238,15 @@
FT_CALLBACK_DEF( void ) FT_CALLBACK_DEF( void )
parse_fd_array( CID_Face face, parse_fd_array( FT_Face face, /* CID_Face */
CID_Parser* parser ) void* parser_ )
{ {
CID_FaceInfo cid = &face->cid; CID_Face cidface = (CID_Face)face;
FT_Memory memory = face->root.memory; CID_Parser* parser = (CID_Parser*)parser_;
FT_Stream stream = parser->stream; CID_FaceInfo cid = &cidface->cid;
FT_Error error = FT_Err_Ok; FT_Memory memory = FT_FACE_MEMORY( face );
FT_Stream stream = parser->stream;
FT_Error error = FT_Err_Ok;
FT_Long num_dicts, max_dicts; FT_Long num_dicts, max_dicts;
@ -313,18 +316,20 @@
/* By mistake, `expansion_factor' appears both in PS_PrivateRec */ /* By mistake, `expansion_factor' appears both in PS_PrivateRec */
/* and CID_FaceDictRec (both are public header files and can't */ /* and CID_FaceDictRec (both are public header files and can't */
/* changed). We simply copy the value. */ /* be thus changed). We simply copy the value. */
FT_CALLBACK_DEF( void ) FT_CALLBACK_DEF( void )
parse_expansion_factor( CID_Face face, parse_expansion_factor( FT_Face face, /* CID_Face */
CID_Parser* parser ) void* parser_ )
{ {
CID_Face cidface = (CID_Face)face;
CID_Parser* parser = (CID_Parser*)parser_;
CID_FaceDict dict; CID_FaceDict dict;
if ( parser->num_dict < face->cid.num_dicts ) if ( parser->num_dict < cidface->cid.num_dicts )
{ {
dict = face->cid.font_dicts + parser->num_dict; dict = cidface->cid.font_dicts + parser->num_dict;
dict->expansion_factor = cid_parser_to_fixed( parser, 0 ); dict->expansion_factor = cid_parser_to_fixed( parser, 0 );
dict->private_dict.expansion_factor = dict->expansion_factor; dict->private_dict.expansion_factor = dict->expansion_factor;
@ -341,11 +346,15 @@
/* to catch it for producing better trace output. */ /* to catch it for producing better trace output. */
FT_CALLBACK_DEF( void ) FT_CALLBACK_DEF( void )
parse_font_name( CID_Face face, parse_font_name( FT_Face face, /* CID_Face */
CID_Parser* parser ) void* parser_ )
{ {
#ifdef FT_DEBUG_LEVEL_TRACE #ifdef FT_DEBUG_LEVEL_TRACE
if ( parser->num_dict < face->cid.num_dicts ) CID_Face cidface = (CID_Face)face;
CID_Parser* parser = (CID_Parser*)parser_;
if ( parser->num_dict < cidface->cid.num_dicts )
{ {
T1_TokenRec token; T1_TokenRec token;
FT_UInt len; FT_UInt len;
@ -361,7 +370,7 @@
} }
#else #else
FT_UNUSED( face ); FT_UNUSED( face );
FT_UNUSED( parser ); FT_UNUSED( parser_ );
#endif #endif
return; return;