summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Rosenthol <leonardr@pdfsages.com>2001-10-26 13:24:39 +0000
committerLeonard Rosenthol <leonardr@pdfsages.com>2001-10-26 13:24:39 +0000
commite53664dbd8c484ca649cb9bcf74110cd9c1b7bfe (patch)
treeebdad148bbac66563133986c5a3b4eb26d51e7bd
parentf2226097e7b6ce93331a9d9f80ad9c7f72b335f1 (diff)
downloadfreetype2-e53664dbd8c484ca649cb9bcf74110cd9c1b7bfe.tar.gz
Incorporated changes for faces other than the first
-rw-r--r--src/base/ftmac.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index 005ae4f97..6657617d3 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] )