Thu 05 Feb 2009 09:41:37 AM UTC, original submission:
Mac_Read_sfnt_Resource doesn't recognizes mac truetype fonts anymore in freetype 2.3.8 because after calling open_face_PS_from_sfnt_stream we don't reset the stream before continuing.
This is a really big problem on mac prevent freetype from opening any truetype fonts in a resource fork.
proposed fix:
error = open_face_PS_from_sfnt_stream( library,
stream,
face_index,
0, NULL,
aface );
if ( !error )
goto Exit;
if ( FT_ALLOC( sfnt_data, (FT_Long)rlen ) )
return error;
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, rlen );
should be changed to:
error = open_face_PS_from_sfnt_stream( library,
stream,
face_index,
0, NULL,
aface );
if ( !error )
goto Exit;
// reset the stream's location again after possibly reading it
// in open_face_PS_from_sfnt_stream
error = FT_Stream_Seek( stream, flag_offset + 4 );
if ( error )
goto Exit;
if ( FT_ALLOC( sfnt_data, (FT_Long)rlen ) )
return error;
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, rlen );
|