Author Topic: Unhandled Exception and crash.  (Read 3363 times)

Offline AceAlot

  • Newbie
  • *
  • Posts: 2
Unhandled Exception and crash.
« 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.

Offline Fiskbit

  • Arcen Games Contractor
  • Master Member Mark III
  • *****
  • Posts: 1,752
Re: Unhandled Exception and crash.
« Reply #1 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.

Let us know if you have any more trouble!
Have ideas or bug reports for one of our games?  Click here to get started with Mantis for Suggestions and Bug Reports.  Thanks for helping to make our games better!

Offline AceAlot

  • Newbie
  • *
  • Posts: 2
Re: Unhandled Exception and crash.
« Reply #2 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.

Offline RCIX

  • Core Member Mark II
  • *****
  • Posts: 2,808
  • Avatar credit goes to Spookypatrol on League forum
Re: Unhandled Exception and crash.
« Reply #3 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.

Let us know if you have any more trouble!
Does ZedGraph use it somewhere you didn't catch? :)
Avid League player and apparently back from the dead!

If we weren't going for your money, you wouldn't have gotten as much value for it!

Oh, wait... *causation loop detonates*

Offline x4000

  • Chris Park, Arcen Games Founder and Lead Designer
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,236
Re: Unhandled Exception and crash.
« Reply #4 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.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!