System.InvalidOperationException: Default font family name can't be null or empty
See original GitHub issueVersion: 0.10-preview2
I upgraded project IPOCS.JMRI.CONTROL, located at https://github.com/GMJS/ipocs.jmri, to preview2 (not committed and pushed yet) and made a build for linux-arm
using dotnet publish IPOCS.JMRI.CONTROL -c Release -r linux-arm
. Upon trying to run this on a raspberry pi I’m getting the exception:
Unhandled exception. System.InvalidOperationException: Default font family name can't be null or empty.
at Avalonia.Media.FontManager..ctor(IFontManagerImpl platformImpl)
at Avalonia.Media.FontManager.get_Current()
at Avalonia.Rendering.RendererBase..ctor(Boolean useManualFpsCounting)
at Avalonia.Rendering.DeferredRenderer..ctor(IRenderRoot root, IRenderLoop renderLoop, ISceneBuilder sceneBuilder, IDispatcher dispatcher, IDeferredRendererLock rendererLock)
at Avalonia.X11.X11Window.CreateRenderer(IRenderRoot root)
at Avalonia.Controls.TopLevel..ctor(ITopLevelImpl impl, IAvaloniaDependencyResolver dependencyResolver)
at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl, IAvaloniaDependencyResolver dependencyResolver)
at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl)
at Avalonia.Controls.Window..ctor(IWindowImpl impl)
at Avalonia.Controls.Window..ctor()
at IPOCS.JMRI.CONTROL.Views.MainWindow..ctor() in <path>\ipocs.jmri\IPOCS.JMRI.CONTROL\Views\MainWindow.axaml.cs:line 9
at IPOCS.JMRI.CONTROL.App.OnFrameworkInitializationCompleted() in <path>t\ipocs.jmri\IPOCS.JMRI.CONTROL\App.axaml.cs:line 20
at Avalonia.Controls.AppBuilderBase`1.Setup()
at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
at IPOCS.JMRI.CONTROL.Program.Main(String[] args) in <path>\ipocs.jmri\IPOCS.JMRI.CONTROL\Program.cs:line 13
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:73 (27 by maintainers)
Top Results From Across the Web
It can not launch on Arch Linux
Unhandled exception. System.InvalidOperationException: Default font family name can't be null or empty. at Avalonia.Media.
Read more >No display appears on Ubuntu20.04LTS
System.InvalidOperationException: Default font family name can't be null or empty. at Avalonia.Media.FontManager..ctor(IFontManagerImpl platformImpl).
Read more >[BUG] Linux font family error #153 - honeys
System.InvalidOperationException: Default font family name can't be null or empty. at Avalonia.Media.FontManager..ctor(IFontManagerImpl ...
Read more >Git clone code from github and something wrong with font ...
Git clone code from github and something wrong with font family ?! ... fatal: helper error (255): Default font family name can't be...
Read more >IAvaloniaDependencyResolver Interface - Typedescriptor
System.InvalidOperationException: Default font family name can't be null or empty #4427. Open elestedt on Aug 5 2020 / AvaloniaUI/Avalonia.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This issue is also happening when the system language is set to Korean or Japanese and probably any other language with non-Latin characters as well. (tested on a fresh Ubuntu 20.10 VM x86_64)
I can fix this font loading issue by launching my app with a modified locale environment variable:
i use arch btwArchLinux here, same issue. Fixed by installing this package and runningfc-cache --force
.All that package contains are fonts and licenses, and the fonts installed are as follows:
After further testing it looks like something in the font management chain really likes Verdana font for whatever reason, and if Verdana (all of its variants) goes missing it tries to look for any available variants of the Arial font, furthermore - when Arial is removed the previously mentioned
InvalidOperationException
is thrown.