Muse Sounds Manager crashes on startup due to font-related exception on Chinese Ubuntu
Description:
The Muse Sounds Manager application crashes on startup with a font-related exception when running on a Chinese Ubuntu system. The application fails to initialize properly and displays an error message indicating that the default font family name cannot be null or empty.
Steps to Reproduce:
1. Install Muse Sounds Manager on a Chinese Ubuntu system.
2. Launch the Muse Sounds Manager application.
Expected Result:
The Muse Sounds Manager application should start up successfully without any font-related exceptions.
Actual Result:
The Muse Sounds Manager application crashes on startup and displays the following error message:
```
2024-09-25 09:53:24.3720|INFO|Muse.Common.Services.SettingsService|Reloading settings...
2024-09-25 09:53:24.6966|INFO|Muse.Client.Linux.App|Attempting to set the users language to en-US using file /opt/muse-sounds-manager/Assets/Strings/en-US/Localizable.strings
2024-09-25 09:53:24.7067|INFO|Muse.Client.Linux.App|Setting SSL_CERT_DIR to /usr/lib/ssl/certs
2024-09-25 09:53:24.7079|INFO|Muse.Client.Linux.App|Setting SSL_CERT_FILE to /usr/lib/ssl/cert.pem
2024-09-25 09:53:25.2047|FATAL|Muse.Client.Linux.App|Application has encountered a fatal 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.Media.Typeface.get_GlyphTypeface()
at Avalonia.Rendering.Composition.Compositor.get_DiagnosticTextRenderer()
at Avalonia.Rendering.Composition.Compositor.CreateCompositionTarget(Func`1 surfaces)
at Avalonia.Rendering.Composition.CompositingRenderer..ctor(IRenderRoot root, Compositor compositor, Func`1 surfaces)
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 Muse.Client.Linux.App.OnFrameworkInitializationCompleted() in /home/runner/work/Muse/Muse/Linux/src/Muse.Client.Linux/App.axaml.cs:line 112
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
at Avalonia.Threading.SendOrPostCallbackDispatcherOperation.InvokeCore()
at Avalonia.Threading.DispatcherOperation.Execute()
at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation job)
at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean fromExplicitBackgroundProcessingCallback)
at Avalonia.Threading.Dispatcher.Signaled()
at Avalonia.X11.X11PlatformThreading.CheckSignaled()
at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken cancellationToken)
at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl)
at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode)
at Muse.Client.Linux.Program.Main(String[] args) in /home/runner/work/Muse/Muse/Linux/src/Muse.Client.Linux/Program.cs:line 21
```
Environment:
- Operating System: Chinese Ubuntu 24.04
- Muse Sounds Manager Version: latest
- Avalonia UI Framework Version: whatever comes with muse sounds manager
Additional Information:
- The issue seems to be specific to the Chinese Ubuntu environment, as the application runs successfully on English Ubuntu systems.
- Setting the system locale to English (e.g., `LANG=en_US.UTF-8`) before running the application temporarily resolves the issue, suggesting a problem with the Chinese font configuration or compatibility.
- Installing additional Chinese fonts (e.g., WenQuanYi Micro Hei, WenQuanYi Zen Hei) or English fonts (e.g., Microsoft Core Fonts) does not resolve the issue.
- Attempting to set a custom font configuration using a `fonts.conf` file also does not solve the problem.
Possible Causes:
- The application may have a dependency on specific font families that are not available or properly configured on the Chinese Ubuntu system.
- There could be a compatibility issue between the Avalonia UI framework used by the application and the Chinese fonts on Ubuntu.
- The application's font configuration or initialization process may not handle the Chinese Ubuntu environment correctly.
Workaround:
As a temporary workaround until the bug is fixed, you can modify the application launcher to set the locale to English before launching the Muse Sounds Manager application. Follow these steps:
1. Open a terminal and run the following command to create or update the `muse-sounds-manager.desktop` file with the necessary modifications:
echo '[Desktop Entry]
Encoding=UTF-8
Name=Muse Sounds Manager
Exec=bash -c "LANG=en_US.UTF-8 muse-sounds-manager"
Icon=muse-sounds-manager
Terminal=false
Type=Application
Categories=GNOME;Application;Network
StartupNotify=true' | sudo tee /usr/share/applications/muse-sounds-manager.desktop > /dev/null
This command creates or overwrites the `.desktop` file with the provided contents, setting the `Exec` line to launch the application with the English locale.
2. Update the application launcher cache by running the following command:
sudo update-desktop-database
3. The modified Muse Sounds Manager launcher should now be available in the app tray or application launcher.
4. Launch the Muse Sounds Manager application from the app tray or application launcher, and it should start successfully with the English locale.
Please note that this is a temporary workaround, and it may have limitations. A proper fix for the font-related exception should be implemented in a future update of the application.
Please investigate this issue and provide guidance on resolving the font-related problem permanently. If you need any additional information or have any questions, please let me know.
-
This may have been fixed in an upcoming version of Muse Sounds Manager. I'll let you know once this has been released.
1
Please sign in to leave a comment.
Comments
1 comment