private FontManager(IFontManagerImpl platformImpl) { PlatformImpl = platformImpl; DefaultFontFamilyName = PlatformImpl.GetDefaultFontFamilyName(); _defaultFontFamily = new FontFamily(DefaultFontFamilyName); }
public FontManager(IFontManagerImpl platformImpl) { PlatformImpl = platformImpl; DefaultFontFamilyName = PlatformImpl.GetDefaultFontFamilyName(); if (string.IsNullOrEmpty(DefaultFontFamilyName)) { throw new InvalidOperationException("Default font family name can't be null or empty."); } _defaultFontFamily = new FontFamily(DefaultFontFamilyName); }
public FontManager(IFontManagerImpl platformImpl) { PlatformImpl = platformImpl; var options = AvaloniaLocator.Current.GetService <FontManagerOptions>(); _fontFallbacks = options?.FontFallbacks; DefaultFontFamilyName = options?.DefaultFamilyName ?? PlatformImpl.GetDefaultFontFamilyName(); if (string.IsNullOrEmpty(DefaultFontFamilyName)) { throw new InvalidOperationException("Default font family name can't be null or empty."); } _defaultFontFamily = new FontFamily(DefaultFontFamilyName); }