Incorporated changes for faces other than the first
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index 005ae4f..6657617 100644
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -218,14 +218,20 @@
/* Look inside the FOND data, answer whether there should be an SFNT
- resource, and answer the name of a possible LWFN Type 1 file. */
+ resource, and answer the name of a possible LWFN Type 1 file.
+
+ Thanks to Paul Miller (paulm@profoundeffects.com) for the fix
+ to load a face OTHER than the first one in the FOND!
+ */
static void
parse_fond( char* fond_data,
short* have_sfnt,
short* sfnt_id,
- Str255 lwfn_file_name )
+ Str255 lwfn_file_name,
+ short face_index )
{
AsscEntry* assoc;
+ AsscEntry* base_assoc;
FamRec* fond;
@@ -235,12 +241,20 @@
fond = (FamRec*)fond_data;
assoc = (AsscEntry*)( fond_data + sizeof ( FamRec ) + 2 );
+ base_assoc = assoc;
+ assoc += face_index; /* add on the face_index! */
+ /* if the face at this index is not scalable, fall back to the first one (old behavior) */
if ( assoc->fontSize == 0 )
{
*have_sfnt = 1;
*sfnt_id = assoc->fontID;
}
+ else if (base_assoc->fontSize == 0)
+ {
+ *have_sfnt = 1;
+ *sfnt_id = base_assoc->fontID;
+ }
if ( fond->ffStylOff )
{
@@ -638,7 +652,7 @@
return FT_Err_Invalid_File_Format;
HLock( fond );
- parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name );
+ parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name, face_index );
HUnlock( fond );
if ( lwfn_file_name[0] )