Skip to content
This repository has been archived by the owner on Oct 29, 2022. It is now read-only.

Commit

Permalink
some fixes in order to be able to use freetype when compiled with ems…
Browse files Browse the repository at this point in the history
…cripten
  • Loading branch information
anlambert committed Aug 11, 2015
1 parent e186230 commit 40a760c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/autofit/afdummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@

static FT_Error
af_dummy_hints_apply( AF_GlyphHints hints,
FT_Outline* outline )
FT_Outline* outline,
AF_StyleMetrics metrics )
{
FT_Error error;

FT_UNUSED(metrics);

error = af_glyph_hints_reload( hints, outline );
if ( !error )
Expand Down
2 changes: 1 addition & 1 deletion src/autofit/aftypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ extern void* _af_debug_hints;
(*AF_WritingSystem_InitHintsFunc)( AF_GlyphHints hints,
AF_StyleMetrics metrics );

typedef void
typedef FT_Error
(*AF_WritingSystem_ApplyHintsFunc)( AF_GlyphHints hints,
FT_Outline* outline,
AF_StyleMetrics metrics );
Expand Down
18 changes: 9 additions & 9 deletions src/cid/cidload.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
}


FT_CALLBACK_DEF( FT_Error )
FT_CALLBACK_DEF( void )
cid_parse_font_matrix( CID_Face face,
CID_Parser* parser )
{
Expand All @@ -169,15 +169,17 @@

result = cid_parser_to_fixed_array( parser, 6, temp, 3 );

if ( result < 6 )
return FT_THROW( Invalid_File_Format );
if ( result < 6 ) {
FT_THROW( Invalid_File_Format );
return;
}

temp_scale = FT_ABS( temp[3] );

if ( temp_scale == 0 )
{
FT_ERROR(( "cid_parse_font_matrix: invalid font matrix\n" ));
return FT_THROW( Invalid_File_Format );
return;
}

/* Set Units per EM based on FontMatrix values. We set the value to */
Expand Down Expand Up @@ -207,11 +209,10 @@
offset->y = temp[5] >> 16;
}

return FT_Err_Ok;
}


FT_CALLBACK_DEF( FT_Error )
FT_CALLBACK_DEF( void )
parse_fd_array( CID_Face face,
CID_Parser* parser )
{
Expand Down Expand Up @@ -251,15 +252,15 @@
}

Exit:
return error;
FT_UNUSED(error);
}


/* by mistake, `expansion_factor' appears both in PS_PrivateRec */
/* and CID_FaceDictRec (both are public header files and can't */
/* changed); we simply copy the value */

FT_CALLBACK_DEF( FT_Error )
FT_CALLBACK_DEF( void )
parse_expansion_factor( CID_Face face,
CID_Parser* parser )
{
Expand All @@ -274,7 +275,6 @@
dict->private_dict.expansion_factor = dict->expansion_factor;
}

return FT_Err_Ok;
}


Expand Down

0 comments on commit 40a760c

Please sign in to comment.