Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default font family name can't be null or empty #749

Open
NyasakiAT opened this issue Jul 14, 2020 · 3 comments
Open

Default font family name can't be null or empty #749

NyasakiAT opened this issue Jul 14, 2020 · 3 comments

Comments

@NyasakiAT
Copy link

[mwalk@arch netcoreapp3.1]$ ./AvalonStudio
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 AvalonStudio.Shell.Controls.MetroWindow..ctor() in /home/mwalk/tmp/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Controls/MetroWindow.cs:line 63
at AvalonStudio.MainWindow..ctor() in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/MainWindow.xaml.cs:line 15
at AvalonStudio.App.OnFrameworkInitializationCompleted() in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/App.paml.cs:line 18
at Avalonia.Controls.AppBuilderBase1.Setup() at Avalonia.Controls.AppBuilderBase1.SetupWithLifetime(IApplicationLifetime lifetime)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
at AvalonStudio.Shell.Shell.StartShellApp[TAppBuilder](TAppBuilder builder, String appName, ShellAppMainDelegate main, String[] args, IFactory layoutFactory) in /home/mwalk/tmp/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Shell.cs:line 17
at AvalonStudio.Program.Main(String[] args) in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/Program.cs:line 32
Aborted (core dumped)
[mwalk@arch netcoreapp3.1]$ ./AvalonStudio
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 AvalonStudio.Shell.Controls.MetroWindow..ctor() in /home/mwalk/tmp/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Controls/MetroWindow.cs:line 63
at AvalonStudio.MainWindow..ctor() in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/MainWindow.xaml.cs:line 15
at AvalonStudio.App.OnFrameworkInitializationCompleted() in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/App.paml.cs:line 18
at Avalonia.Controls.AppBuilderBase1.Setup() at Avalonia.Controls.AppBuilderBase1.SetupWithLifetime(IApplicationLifetime lifetime)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
at AvalonStudio.Shell.Shell.StartShellApp[TAppBuilder](TAppBuilder builder, String appName, ShellAppMainDelegate main, String[] args, IFactory layoutFactory) in /home/mwalk/tmp/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Shell.cs:line 17
at AvalonStudio.Program.Main(String[] args) in /home/mwalk/tmp/AvalonStudio/AvalonStudio/AvalonStudio/Program.cs:line 32
Aborted (core dumped)

Project was build normally and I attempted to run it
Fresh Archlinux install with i3

@viko-stamoff
Copy link

I have the same problem here. Fonts are installed, but still gives a error

OS: Manjaro Linux (fully updated as of 11th Sep 2020)
Dotnet Version 3.1.107
Error Message:

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 AvalonStudio.Shell.Controls.MetroWindow..ctor() in /opt/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Controls/MetroWindow.cs:line 63
at AvalonStudio.MainWindow..ctor() in /opt/AvalonStudio/AvalonStudio/AvalonStudio/MainWindow.xaml.cs:line 15
at AvalonStudio.App.OnFrameworkInitializationCompleted() in /opt/AvalonStudio/AvalonStudio/AvalonStudio/App.paml.cs:line 18
at Avalonia.Controls.AppBuilderBase1.Setup() at Avalonia.Controls.AppBuilderBase1.SetupWithLifetime(IApplicationLifetime lifetime)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
at AvalonStudio.Shell.Shell.StartShellApp[TAppBuilder](TAppBuilder builder, String appName, ShellAppMainDelegate main, String[] args, IFactory layoutFactory) in /opt/AvalonStudio/AvalonStudio.Shell/src/AvalonStudio.Shell/Shell.cs:line 17
at AvalonStudio.Program.Main(String[] args) in /opt/AvalonStudio/AvalonStudio/AvalonStudio/Program.cs:line 32
zsh: abort (core dumped) ./AvalonStudio

@ErdajtSopjani
Copy link

Same issue here in Arch Linux:

❯ dotnet run
/home/erdajtt/P9/code/c#/projects/test/ViewLocator.cs(12,20): warning CS8602: Dereference of a possibly null reference. [/home/erdajtt/P9/code/c#/projects/test/test.csproj]
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.AppBuilder.<>c__DisplayClass62_0.<ConfigureFonts>b__0(AppBuilder appBuilder)
   at Avalonia.AppBuilder.SetupUnsafe()
   at Avalonia.AppBuilder.Setup()
   at Avalonia.AppBuilder.SetupWithLifetime(IApplicationLifetime lifetime)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode)
   at test.Program.Main(String[] args) in /home/erdajtt/P9/code/c#/projects/test/Program.cs:line 13

@ErdajtSopjani
Copy link

To resolve this issue install ttf-ms-fonts from the AUR. (in arch based distros)

yay -S ttf-ms-fonts

And for ubuntu based distros install ttf-mscorefonts-installer from the repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants