public WinGdiFontFace(RequestFont f) { _style = f.Style; //resolve InstalledTypeface foundInstalledFont = s_installedTypefaceProvider.GetInstalledTypeface(f.Name, _style.ConvToInstalledFontStyle()); //TODO: review if (foundInstalledFont == null) { //not found } _nopenTypeFontFace = OpenFontLoader.LoadFont(foundInstalledFont.FontPath); }
internal static SkiaSharp.SKTypeface GetInstalledFont(string typefaceName) { InstalledTypeface installedFont = s_installedTypefaceProvider.GetInstalledTypeface(typefaceName, Typography.FontManagement.TypefaceStyle.Regular); if (installedFont == null) { return(null); } else { SkiaSharp.SKTypeface loadedTypeFace; if (!skTypeFaces.TryGetValue(installedFont, out loadedTypeFace)) { loadedTypeFace = SkiaSharp.SKTypeface.FromFile(installedFont.FontPath); skTypeFaces.Add(installedFont, loadedTypeFace); } return(loadedTypeFace); } }