Ejemplo n.º 1
0
        private FontManager(IFontManagerImpl platformImpl)
        {
            PlatformImpl = platformImpl;

            DefaultFontFamilyName = PlatformImpl.GetDefaultFontFamilyName();

            _defaultFontFamily = new FontFamily(DefaultFontFamilyName);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public TestServices With(
     IAssetLoader assetLoader                      = null,
     IFocusManager focusManager                    = null,
     IInputManager inputManager                    = null,
     Func <IKeyboardDevice> keyboardDevice         = null,
     IKeyboardNavigationHandler keyboardNavigation = null,
     ILayoutManager layoutManager                  = null,
     Func <IMouseDevice> mouseDevice               = null,
     IRuntimePlatform platform                     = null,
     IPlatformRenderInterface renderInterface      = null,
     IRenderLoop renderLoop = null,
     IScheduler scheduler   = null,
     ICursorFactory standardCursorFactory = null,
     IStyler styler      = null,
     Func <Styles> theme = null,
     IPlatformThreadingInterface threadingInterface = null,
     IWindowImpl windowImpl = null,
     IWindowingPlatform windowingPlatform = null,
     PlatformHotkeyConfiguration platformHotkeyConfiguration = null,
     IFontManagerImpl fontManagerImpl     = null,
     IFormattedTextImpl formattedTextImpl = null)
 {
     return(new TestServices(
                assetLoader: assetLoader ?? AssetLoader,
                focusManager: focusManager ?? FocusManager,
                inputManager: inputManager ?? InputManager,
                keyboardDevice: keyboardDevice ?? KeyboardDevice,
                keyboardNavigation: keyboardNavigation ?? KeyboardNavigation,
                layoutManager: layoutManager ?? LayoutManager,
                mouseDevice: mouseDevice ?? MouseDevice,
                platform: platform ?? Platform,
                renderInterface: renderInterface ?? RenderInterface,
                scheduler: scheduler ?? Scheduler,
                standardCursorFactory: standardCursorFactory ?? StandardCursorFactory,
                styler: styler ?? Styler,
                theme: theme ?? Theme,
                threadingInterface: threadingInterface ?? ThreadingInterface,
                windowingPlatform: windowingPlatform ?? WindowingPlatform,
                windowImpl: windowImpl ?? WindowImpl,
                platformHotkeyConfiguration: platformHotkeyConfiguration ?? PlatformHotkeyConfiguration,
                fontManagerImpl: fontManagerImpl ?? FontManagerImpl,
                formattedTextImpl: formattedTextImpl ?? FormattedTextImpl));
 }
Ejemplo n.º 5
0
 public TestServices(
     IAssetLoader assetLoader                      = null,
     IFocusManager focusManager                    = null,
     IInputManager inputManager                    = null,
     Func <IKeyboardDevice> keyboardDevice         = null,
     IKeyboardNavigationHandler keyboardNavigation = null,
     ILayoutManager layoutManager                  = null,
     Func <IMouseDevice> mouseDevice               = null,
     IRuntimePlatform platform                     = null,
     IPlatformRenderInterface renderInterface      = null,
     IRenderLoop renderLoop = null,
     IScheduler scheduler   = null,
     ICursorFactory standardCursorFactory = null,
     IStyler styler      = null,
     Func <Styles> theme = null,
     IPlatformThreadingInterface threadingInterface = null,
     IWindowImpl windowImpl = null,
     IWindowingPlatform windowingPlatform = null,
     PlatformHotkeyConfiguration platformHotkeyConfiguration = null,
     IFontManagerImpl fontManagerImpl     = null,
     IFormattedTextImpl formattedTextImpl = null)
 {
     AssetLoader           = assetLoader;
     FocusManager          = focusManager;
     InputManager          = inputManager;
     KeyboardDevice        = keyboardDevice;
     KeyboardNavigation    = keyboardNavigation;
     LayoutManager         = layoutManager;
     MouseDevice           = mouseDevice;
     Platform              = platform;
     RenderInterface       = renderInterface;
     Scheduler             = scheduler;
     StandardCursorFactory = standardCursorFactory;
     Styler                      = styler;
     Theme                       = theme;
     ThreadingInterface          = threadingInterface;
     WindowImpl                  = windowImpl;
     WindowingPlatform           = windowingPlatform;
     PlatformHotkeyConfiguration = platformHotkeyConfiguration;
     FontManagerImpl             = fontManagerImpl;
     FormattedTextImpl           = formattedTextImpl;
 }
Ejemplo n.º 6
0
 public TestServices With(
     IAssetLoader assetLoader                      = null,
     IFocusManager focusManager                    = null,
     IGlobalClock globalClock                      = null,
     IInputManager inputManager                    = null,
     Func <IKeyboardDevice> keyboardDevice         = null,
     IKeyboardNavigationHandler keyboardNavigation = null,
     Func <IMouseDevice> mouseDevice               = null,
     IRuntimePlatform platform                     = null,
     IPlatformRenderInterface renderInterface      = null,
     IRenderTimer renderLoop = null,
     IScheduler scheduler    = null,
     ICursorFactory standardCursorFactory = null,
     IStyler styler      = null,
     Func <Styles> theme = null,
     IPlatformThreadingInterface threadingInterface = null,
     IFontManagerImpl fontManagerImpl     = null,
     ITextShaperImpl textShaperImpl       = null,
     IWindowImpl windowImpl               = null,
     IWindowingPlatform windowingPlatform = null)
 {
     return(new TestServices(
                assetLoader: assetLoader ?? AssetLoader,
                focusManager: focusManager ?? FocusManager,
                globalClock: globalClock ?? GlobalClock,
                inputManager: inputManager ?? InputManager,
                keyboardDevice: keyboardDevice ?? KeyboardDevice,
                keyboardNavigation: keyboardNavigation ?? KeyboardNavigation,
                mouseDevice: mouseDevice ?? MouseDevice,
                platform: platform ?? Platform,
                renderInterface: renderInterface ?? RenderInterface,
                fontManagerImpl: fontManagerImpl ?? FontManagerImpl,
                textShaperImpl: textShaperImpl ?? TextShaperImpl,
                scheduler: scheduler ?? Scheduler,
                standardCursorFactory: standardCursorFactory ?? StandardCursorFactory,
                styler: styler ?? Styler,
                theme: theme ?? Theme,
                threadingInterface: threadingInterface ?? ThreadingInterface,
                windowingPlatform: windowingPlatform ?? WindowingPlatform,
                windowImpl: windowImpl ?? WindowImpl));
 }
Ejemplo n.º 7
0
 public TestServices(
     IAssetLoader assetLoader                      = null,
     IFocusManager focusManager                    = null,
     IGlobalClock globalClock                      = null,
     IInputManager inputManager                    = null,
     Func <IKeyboardDevice> keyboardDevice         = null,
     IKeyboardNavigationHandler keyboardNavigation = null,
     Func <IMouseDevice> mouseDevice               = null,
     IRuntimePlatform platform                     = null,
     IPlatformRenderInterface renderInterface      = null,
     IRenderTimer renderLoop = null,
     IScheduler scheduler    = null,
     ICursorFactory standardCursorFactory = null,
     IStyler styler      = null,
     Func <IStyle> theme = null,
     IPlatformThreadingInterface threadingInterface = null,
     IFontManagerImpl fontManagerImpl     = null,
     ITextShaperImpl textShaperImpl       = null,
     IWindowImpl windowImpl               = null,
     IWindowingPlatform windowingPlatform = null)
 {
     AssetLoader           = assetLoader;
     FocusManager          = focusManager;
     GlobalClock           = globalClock;
     InputManager          = inputManager;
     KeyboardDevice        = keyboardDevice;
     KeyboardNavigation    = keyboardNavigation;
     MouseDevice           = mouseDevice;
     Platform              = platform;
     RenderInterface       = renderInterface;
     FontManagerImpl       = fontManagerImpl;
     TextShaperImpl        = textShaperImpl;
     Scheduler             = scheduler;
     StandardCursorFactory = standardCursorFactory;
     Styler             = styler;
     Theme              = theme;
     ThreadingInterface = threadingInterface;
     WindowImpl         = windowImpl;
     WindowingPlatform  = windowingPlatform;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FontManager" /> class.
 /// </summary>
 /// <param name="underlyingFontManager">The underlying font manager.</param>
 public FontManager(IFontManagerImpl underlyingFontManager)
 {
     fontManager = underlyingFontManager;
 }
Ejemplo n.º 9
0
            public PlatformFontManager(IFontManagerImpl platformImpl)
            {
                _platformImpl = platformImpl;

                DefaultFontFamilyName = _platformImpl.DefaultFontFamilyName;
            }