mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-10-07 01:23:26 +00:00
-convertFont:toFace: should return the original font if the conversion fails
This commit is contained in:
parent
3a8a2286c5
commit
e8e64e6908
@ -460,7 +460,13 @@ static Class _fontPanelFactory;
|
||||
return nil;
|
||||
}
|
||||
|
||||
return [NSFont fontWithName: typeface size: [font pointSize]];
|
||||
NSFont *convertedFont = [NSFont fontWithName: typeface size: [font pointSize]];
|
||||
if (convertedFont) {
|
||||
return convertedFont;
|
||||
}
|
||||
|
||||
// Return the original font if the conversion fails - same as Apple
|
||||
return font;
|
||||
}
|
||||
|
||||
-(NSFont *)convertFont:(NSFont *)font toFamily:(NSString *)family {
|
||||
|
Loading…
Reference in New Issue
Block a user