Arcen Forums

General Category => AI War Classic => AI War Classic - Technical Support => Topic started by: AceAlot on March 07, 2010, 12:00:17 PM

Title: Unhandled Exception and crash.
Post by: AceAlot on March 07, 2010, 12:00:17 PM
Hi. I was going through the games in ModDB untill I saw this game. So I thought I would grab the demo and try it out. It installed and it downloaded SlimDX ( I think that's what it's called ) and everything was fine, up untill I tried to play the game. When I start the game I get Unhandled Exception:System.TypeInitializationException. Something like that. Tried to get more details from the UnhandledErrors.txt and from the line System.TypeInitializationException: The type initializer for 'AIWar.Windows.GraphsDisplay' threw an exception. ---> System.ArgumentException: Font 'Arial' does not support style 'Regular', it seems that the windows font Arial does not support style Regular, which probably is the font you used in the game, although I have no idea and I also have no idea how to fix it. I'll just copy the rest of the .txt file here.

7.03.2010 18:50:04 (3.0.6.0Trial)
-----------------------------------Application_ThreadException-----------------------------------System.TypeInitializationException: The type initializer for 'AIWar.Windows.GraphsDisplay' threw an exception. ---> System.ArgumentException: Font 'Arial' does not support style 'Regular'.
   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.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
   at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style, GraphicsUnit unit)
   at ZedGraph.FontSpec.Remake(Single scaleFactor, Single size, Single& scaledSize, Font& font)
   at ZedGraph.FontSpec.Init(String family, Single size, Color color, Boolean isBold, Boolean isItalic, Boolean isUnderline, Color fillColor, Brush fillBrush, FillType fillType)
   at ZedGraph.Legend..ctor()
   at ZedGraph.PaneBase..ctor(String title, RectangleF paneRect)
   at ZedGraph.MasterPane..ctor(String title, RectangleF paneRect)
   at ZedGraph.ZedGraphControl..ctor()
   at AIWar.Windows.GraphsDisplay..ctor() in C:\vcprojs\AIWar\Windows\GraphsDisplay.cs:line 23
   at AIWar.Windows.GraphsDisplay..cctor() in C:\vcprojs\AIWar\Windows\GraphsDisplay.cs:line 15
   --- End of inner exception stack trace ---
   at AIWar.GameForm.HideAllWindows() in C:\vcprojs\AIWar\GameFormParts\GameLoop.cs:line 152
   at AIWar.GameForm.GameForm_Load(Object sender, EventArgs e) in C:\vcprojs\AIWar\GameFormParts\Startup.cs:line 110
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
7.03.2010 18:50:08 (3.0.6.0Trial)
-----------------------------------CurrentDomain_UnhandledException-----------------------------------System.TypeInitializationException: The type initializer for 'AIWar.Windows.GraphsDisplay' threw an exception. ---> System.ArgumentException: Font 'Arial' does not support style 'Regular'.
   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.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
   at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style, GraphicsUnit unit)
   at ZedGraph.FontSpec.Remake(Single scaleFactor, Single size, Single& scaledSize, Font& font)
   at ZedGraph.FontSpec.Init(String family, Single size, Color color, Boolean isBold, Boolean isItalic, Boolean isUnderline, Color fillColor, Brush fillBrush, FillType fillType)
   at ZedGraph.Legend..ctor()
   at ZedGraph.PaneBase..ctor(String title, RectangleF paneRect)
   at ZedGraph.MasterPane..ctor(String title, RectangleF paneRect)
   at ZedGraph.ZedGraphControl..ctor()
   at AIWar.Windows.GraphsDisplay..ctor()
   at AIWar.Windows.GraphsDisplay..cctor()
   --- End of inner exception stack trace ---
   at AIWar.Windows.GraphsDisplay.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Finalize()

With best regards,
Ace A lot.
Title: Re: Unhandled Exception and crash.
Post by: Fiskbit on March 07, 2010, 06:26:02 PM
This error is pretty perplexing to me, since (to my knowledge) AI War no longer uses the Arial font. However, I suspect if you download and install this font, you'll be good to go. It's available for free at http://web.nickshanks.com/fonts/microsoft-core-web-fonts (http://web.nickshanks.com/fonts/microsoft-core-web-fonts).

Let us know if you have any more trouble!
Title: Re: Unhandled Exception and crash.
Post by: AceAlot on March 08, 2010, 08:41:26 AM
Thank you very much.  :D
The game started perfectly, now I can finally enjoy it. If I'll encounter more problems, I'll be sure to let you know.
Title: Re: Unhandled Exception and crash.
Post by: RCIX on March 08, 2010, 11:27:19 PM
This error is pretty perplexing to me, since (to my knowledge) AI War no longer uses the Arial font. However, I suspect if you download and install this font, you'll be good to go. It's available for free at http://web.nickshanks.com/fonts/microsoft-core-web-fonts (http://web.nickshanks.com/fonts/microsoft-core-web-fonts).

Let us know if you have any more trouble!
Does ZedGraph use it somewhere you didn't catch? :)
Title: Re: Unhandled Exception and crash.
Post by: x4000 on March 09, 2010, 12:54:04 PM
I think it does.  At some point, we're going to need to completely replace ZedGraph in general.  Not the least of which because my eventual goal is to make AI War 100% DirectX-native, rather than being a mix of DirectX and GDI+.  Tidalis is already 100% DirectX-native, but it doesn't use graphs, tabs, or text areas, which are the main things that would need to be implemented in order to get AI War able to go the 100% directX route.  That's coming, but I don't know when -- just depends on how things go, timing-wise.