public NSFont CreateFont(float size) { // we have a postcript name, use that to create the font if (!string.IsNullOrEmpty(PostScriptName)) { // if we try to get a system font by name we get errors now.. if (PostScriptName == SystemFontName) { return(NSFont.SystemFontOfSize(size)); } if (PostScriptName == BoldSystemFontName) { return(NSFont.BoldSystemFontOfSize(size)); } // always return something... var font = NSFont.FromFontName(PostScriptName, size) ?? NSFont.UserFontOfSize(size); return(font); } var family = (FontFamilyHandler)Widget.Family.Handler; return(FontHandler.CreateFont(family.MacName, size, Traits, Weight)); }
public NSFont CreateFont(float size) { var family = (FontFamilyHandler)Widget.Family.Handler; return(FontHandler.CreateFont(family, size, Traits, Weight)); }