Skip to content

Commit 9b7f93a

Browse files
committed
FTFontEnumerator: Try "Family-Typeface" pattern instead of "Typeface Pattern" if the latter is not found. Fixes issue #480.
1 parent f6f33ec commit 9b7f93a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Libraries/gnustep/back-art/Source/art/FTFontEnumerator.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,11 @@ + (FTFaceInfo *)fontWithName:(NSString *)name
401401
FTFaceInfo *face;
402402

403403
face = [fcfg_all_fonts objectForKey:name];
404+
if (!face) {
405+
// Try "Family-Typeface" pattern instead of "Typeface Pattern"
406+
name = [name stringByReplacingOccurrencesOfString:@" " withString:@"-"];
407+
face = [fcfg_all_fonts objectForKey:name];
408+
}
404409
if (!face) {
405410
NSLog(@"Font not found %@", name);
406411
}

0 commit comments

Comments
 (0)