-
-
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
Improve logging to troubleshoot font loading #15230
Improve logging to troubleshoot font loading #15230
Conversation
@dotnet-policy-service agree |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
We should also add the source string of specified font family. Ideally these errors are covered by the compiler. So we try to resolve these font assets at compile time / design time. We might as well just produce a log message and fallback to the default. |
Where can I get the source string of the specified font family from? The Typeface constructor has only fontFamilyName and I get it to the exception message via FontFamily?.Name. |
You can test this PR using the following package version. |
…m/ArtjomP/Avalonia into users/ArtP/glyph-typeface-logging
Thank you! I've added the key. Its good that the FontFamilyKey has ToString() overridden. |
You can test this PR using the following package version. |
* Improve logging * Update Typeface.cs * add the key * update
What does the pull request do?
Improves logging in case of font loading errors.
What is the current behavior?
On font loading error you get a crash with the message: Could not create glyphTypeface.
What is the updated/expected behavior with this PR?
On font loading error you get a crash with the message with additional info to help fix the issue: Could not create glyphTypeface. Font family: (font family name). Style: style. Weight: weight. Stretch: stretch.
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues
Fixes #13040