【发布时间】:2009-10-09 17:50:06
【问题描述】:
我们的自动崩溃报告系统已开始发送越来越多的此类崩溃报告:
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 **
我的印象是 Arial 应该在 Windows 上随处可用,并且当找不到字体时,Windows 会恢复为另一种确实存在的字体+样式。
处理这个问题的正确方法是什么?我的应用需要为不同的显示元素定义多种标准字体。到目前为止,我已经对 Arial、Courier New、Comic Sans Serif 和 Times New Roman 进行了硬编码,并且我已经收到了所有这些的崩溃报告。
一旦用户安装了丢失的字体,一切就又好了。
【问题讨论】: