Our automatic crash-report system has started sending in more and more reports of this kind of crash:
System::Windows::Forms::Application::ThreadException event occured
SENDER: System.Threading.Thread
EXCEPTION: System.ArgumentException
MESSAGE: Font 'Arial' does not support style 'Regular'.
SOURCE: System.Drawing
CALL STACK
at System.Drawing.Font.CreateNativeFont()
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font..ctor(FontFamily family, Single emSize)
at Kernel.EH_FontServer.CreateFont(String family, Single size, FontStyle style) in **
at Kernel.EH_FontServer..cctor() in **
I was under the impression that Arial is supposed to be available everywhere on Windows, and, when a Font cannot be found windows would revert to another font+style that does exist.
What is the correct way to handle this? My app needs to define a number of standard fonts for different display elements. So far I've hardcoded Arial, Courier New, Comic Sans Serif and Times New Roman and I've been getting crash report for all of them.
Once the user installs the missing Font, all is well again.