WPF known issues: Application will FailFast when not find the Arial font from system
See original GitHub issue- .NET Core Version: All
- Windows version: All
- Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
Problem description:
When we indirectly or directly call the FirstFontFamily method of FontFamily.cs, if we call FindFirstFontFamilyAndFace and the font is not found, then we will look for the system’s Arial font.
The LookupFontFamily method return NULL when the user deletes the Arial font. And then we will enter the Invariant.Assert(family != null)
to make the Application to FailFast.
I don’t think this is a good design.
Actual behavior:
Application will FailFast and I can not do anything and do not know why
Expected behavior:
We can handle it or receive the event
Minimal repro:
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
WPF Can't Find some Fonts
1 Answer 1 ... Check in your system's Windows folder. Do u have "Arial Rounded MT Bold" font installed on your system?? You...
Read more >dotnet 读WPF 源代码笔记了解WPF 已知问题用户设备上不存在 ...
... 这个问题报告给官方,请看WPF known issues: Application will FailFast when not find the Arial font from system · Issue #4464 · dotnet/wpf ...
Read more >"TypeInitializationException" or "FileFormatException" error ...
Symptoms. Windows Presentation Foundation (WPF) applications that request a fallback font or a character that is not included in the currently ...
Read more >VS 2019 crash - Developer Community
Navigating to "C:\Windows\Fonts" confirmed that Arial was missing from the list of registered fonts. Going to the same folder in a command ...
Read more >NET Framework 4.5 - Wine Application Database - WineHQ
Known Bugs ; 20220, Missing windowscodecs.dll.WICCreateImagingFactory_Proxy causes failure for many .NET 3.x/4.x (WPF) based installers/apps, CLOSED ; 26757 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Some users like to activate the hidden Administrator account which is very dangerous. These users may delete the fonts easily by accident without being aware of the consequence. I know that this behavior is extremely not recommended but our product has to support most of the computers and users all over the world. That’s why we bring up the issue here.
While I agree there are other ways to handle this, how likely is this an issue in practice?
Windows does not let users delete the font:
Moreover, imagine you get an opportunity to handle this scenario. How do you handle it? With a fallback to different family? If so, you can already handle it be specifying your desired fallback when asking for a font family.