We have some xp systems that will throw this exception. But we install these fonts into this operation, then will fix it. please help us how to fix it by code.thanks.
Font Code:
calibri.ttf, calibrib.ttf, calibrii.ttf, calibril.ttf, calibrili.ttf, calibriz.ttf
Error Log:
Message: 字体“Calibri”不支持样式“Regular”。
Type: ArgumentException
Source: System.Drawing
Occured By: CreateNativeFont
MemberType: Method
Occur At:
在 System.Drawing.Font.CreateNativeFont()
在 System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
在 System.Drawing.Font.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
在 System.Drawing.Font…ctor(String familyName, Single emSize)
在 DevExpress.XtraSpreadsheet.FormulaBarCellInplaceEditor.SetEditorOptions()
在 DevExpress.XtraSpreadsheet.FormulaBarCellInplaceEditor…ctor()
在 DevExpress.XtraSpreadsheet.SpreadsheetFormulaBarControl.InitializeComponent()
在 DevExpress.XtraSpreadsheet.SpreadsheetFormulaBarControl…ctor()
Source Codes:
//
// spreadsheetFormulaBarControl1
//
this.spreadsheetFormulaBarControl1.Appearance.Font = new System.Drawing.Font("Arial Narrow", 8F);
this.spreadsheetFormulaBarControl1.Appearance.Options.UseFont = true;
this.spreadsheetFormulaBarControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.spreadsheetFormulaBarControl1.Expanded = true;
this.spreadsheetFormulaBarControl1.Location = new System.Drawing.Point(145, 0);
this.spreadsheetFormulaBarControl1.MinimumSize = new System.Drawing.Size(0, 20);
this.spreadsheetFormulaBarControl1.Name = "spreadsheetFormulaBarControl1";
this.spreadsheetFormulaBarControl1.Size = new System.Drawing.Size(625, 25);
this.spreadsheetFormulaBarControl1.SpreadsheetControl = this.curSpreadsheetControl;
this.spreadsheetFormulaBarControl1.TabIndex = 3;
Hi Guocai,
Thank you for pointing out this issue. I am forwarding it to our developers for further processing. You will receive an automatic message once the status of this ticket is changed.
In the meantime, I cannot suggest any workaround except for installing missing fonts to the problematic machine.