コード例 #1
0
ファイル: FontManager.cs プロジェクト: weinre/Avalonia
        private FontManager(IFontManagerImpl platformImpl)
        {
            PlatformImpl = platformImpl;

            DefaultFontFamilyName = PlatformImpl.GetDefaultFontFamilyName();

            _defaultFontFamily = new FontFamily(DefaultFontFamilyName);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: FontManager.cs プロジェクト: Sorien/Avalonia
        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);
        }