Bug Report B147625
Visible to All Users

The "Font does not support style 'regular'" exception is thrown when using XtraWizard in Aero style with some system fonts

created 15 years ago

When using the XtraWizard control (in Aero style, not Wizard97 style), if the Windows Title bar text font has been set to a font that does not support the "Regular" style, an unhandled exception (crash) occurs.
The example font I found this issue with was "Monotype Corsiva," a font that is included with Microsoft Office.
The problem only occurs if you customize your Windows appearance and change the default font for either the "Active Title Bar" or "Inactive Title Bar" to something like the "Monotype Corsiva" font.
The problem does not occur if the XtraWizard is using Wizard97 style; it only occurs if using Aero style.
I have attached a screenshot of the settings you need to change to produce the error, along with a picture of the error itself.
I reproduced this error using Windows Vista, but I presume it would manifest itself on any version of Windows, as long as the same font setting was chosen.
Steps to Reproduce:

  1. Create a new blank Windows Application project and drag the XtraWizard control onto the default form (Form1).
  2. Set the XtraWizard's WizardStyle property to WizardAero.
  3. Change the default Windows system font for the "Active Title Bar" (or "Inactive Title Bar") to a font that does not support "Regular" style. (For example, choose the font "Monotype Corsiva".)
  4. Attempt to launch the application.
    Actual Results:
    An unhandled exception occurs with the following details:
    ************** Exception Text **************
    System.ArgumentException: Font 'Monotype Corsiva' 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…ctor(FontFamily family, Single emSize, FontStyle style)
       at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetAppearanceDefault()
       at DevExpress.XtraWizard.WizardViewInfo.UpdatePaintAppearance()
       at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetHeaderTitleBounds(BaseWizardPage page)
       at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetInteriorPageBounds(BaseWizardPage page)
       at DevExpress.XtraWizard.WizardViewInfo.GetPageBounds(BaseWizardPage page)
       at DevExpress.XtraWizard.WizardViewInfo.UpdatePagesBounds()
       at DevExpress.XtraWizard.WizardControl.LayoutChanged()
       at DevExpress.XtraWizard.WizardControl.OnResize(EventArgs e)
       at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
       at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
       at System.Windows.Forms.Control.UpdateBounds()
       at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
       at System.Windows.Forms.Control.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)
    Expected Results:
    The app launches with the Wizard using the system font.
Comments (2)

    I think this problem is still present, or possibly has regressed since it was fixed.
    Application built with v2011 vol 1.4 (latest release as of this date) still encounters this problem. Operating System is Windows XP.
    Again, this only applies to forms using the XtraWizard control.
    Here is the exception that was thrown, along with some extra debug info that my app happened to include:
    OS: Microsoft Windows XP Professional (Win32NT 5.1.2600.196608)
    Program Version: 2.8.1.37
    Exception Source: System.Drawing
    Exception Type: System.ArgumentException
    Exception Message: Font 'Monotype Corsiva' does not support style 'Regular'.
    Exception Target Site: CreateNativeFont
    Exception Stack Trace: 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 DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetAppearanceDefault()
       at DevExpress.XtraWizard.WizardViewInfo.UpdatePaintAppearance()
       at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetHeaderTitleBounds(BaseWizardPage page)
       at DevExpress.XtraWizard.WizardViewInfo.WizardAeroModel.GetInteriorPageBounds(BaseWizardPage page)
       at DevExpress.XtraWizard.WizardViewInfo.GetPageBounds(BaseWizardPage page)
       at DevExpress.XtraWizard.WizardViewInfo.UpdatePagesBounds()
       at DevExpress.XtraWizard.WizardControl.LayoutChanged()
       at DevExpress.XtraWizard.WizardControl.OnLoaded()
       at DevExpress.XtraWizard.WizardControl.OnBeforePaint()
       at DevExpress.XtraWizard.WizardControl.OnPaint(PaintEventArgs e)
       at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
       at System.Windows.Forms.Control.WmPaint(Message& m)
       at System.Windows.Forms.Control.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
    The steps to reproduce are the same as before - set the Active Title Bar font in Windows to any font that does not have a "normal" style (e.g., Monotype Corsiva) and then open an app that displays a form with an XtraWizard. The error will then occur.

    DevExpress Support Team 14 years ago

      Hi Keith ,
      I have reproduced the problem.
      Our developers will research this issue and try to fix the problem as soon as possible.
      Thanks
      Dimitros

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.