question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.InvalidOperationException: Default font family name can't be null or empty

See original GitHub issue

Version: 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:open
  • Created 3 years ago
  • Reactions:8
  • Comments:73 (27 by maintainers)

github_iconTop GitHub Comments

19reactions
ThePBonecommented, Jan 15, 2021

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:

LC_ALL=C ./YourAvaloniaExecutable
13reactions
vddCorecommented, Aug 5, 2020

i use arch btw ArchLinux here, same issue. Fixed by installing this package and running fc-cache --force.

All that package contains are fonts and licenses, and the fonts installed are as follows:

AndaleMo.TTF  Arialbd.TTF   Comic.TTF     Georgiab.TTF
Impact.TTF    Timesbi.TTF   Verdana.TTF   Verdanaz.TTF
courbd.ttf    trebuc.ttf    AriBlk.TTF    Arialbi.TTF  
Comicbd.TTF   Georgiai.TTF  Times.TTF     Timesi.TTF    
Verdanab.TTF  Webdings.TTF  courbi.ttf    trebucbi.ttf
Arial.TTF     Ariali.TTF    Georgia.TTF   Georgiaz.TTF  
Timesbd.TTF   Trebucbd.ttf  Verdanai.TTF  cour.ttf  
couri.ttf     trebucit.ttf

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found