-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix issue 4427 - System.InvalidOperationException: Default font family name can't be null or empty #12817
Conversation
…y name can't be null or empty
@dotnet-policy-service agree |
You can test this PR using the following package version. |
Pinging @Gillibald |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
Can we avoid using Linq to select the first font and instead just use the indexer with a bounds check? |
You can test this PR using the following package version. |
Thank you for the feedback, @Gillibald! The PR has been updated accordingly. |
You can test this PR using the following package version. |
Congrats @mihnea-radulescu, you've earned the 0.03 BTC bounty I created some years ago for resolving #4427 🚀 Please send me a Bitcoin address to [email protected]. If you don't yet have a Bitcoin wallet, then a natural choice would be Wasabi Wallet, which is also written with Avalonia. |
…y name can't be null or empty (#12817) * Fix issue 4427 - System.InvalidOperationException: Default font family name can't be null or empty * Updated FontManager * Removed Linq usage from FontManager --------- Co-authored-by: Mihnea Rădulescu <> Co-authored-by: Benedikt Stebner <[email protected]> #Conflicts: # src/Avalonia.Base/Media/FontManager.cs
Fix issue 4427 - System.InvalidOperationException: Default font family name can't be null or empty
Link to issue 4427
What does the pull request do?
Fixes the exception System.InvalidOperationException: Default font family name can't be null or empty occurring on some GNU / Linux operating systems, in particular Arch Linux and variants, through falling back to the first registered system font family, in the absence of a default font family name.
What is the current behavior?
On some GNU / Linux operating systems, in particular Arch Linux and variants, the FontManager constructor throws a System.InvalidOperationException when a defaultFontFamilyName is neither provided through the FontManagerOptions instance, nor can it be resolved using PlatformImpl.GetDefaultFontFamilyName().
What is the updated/expected behavior with this PR?
The PR fixes the issue by falling back to the first registered system font family, in the absence of a provided or resolved default font family name.
Checklist
Fixed issues
Fixes #4427