-convertFont:toFace: should return the original font if the conversion fails

This commit is contained in:
Robert Grant 2014-12-08 13:20:15 -05:00
parent 3a8a2286c5
commit e8e64e6908

View File

@ -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 {