Bug Report T1285605
Visible to All Users

Spreadsheet Document API - The System.OverflowException: 'Arithmetic operation resulted in an overflow.' error occurs in the GetCharWidth method when the Symbols Nerd Font is installed on a machine

created 8 days ago (modified 8 days ago)

Steps to reproduce:

  1. Install the Symbols Nerd Font.
  2. Run the attached project.

Expected results:

Spreadsheet Document API doesn't throw the System.OverflowException: 'Arithmetic operation resulted in an overflow.' error and saves the document.

Current results:

Spreadsheet Document API throws the System.OverflowException: 'Arithmetic operation resulted in an overflow.' error and can't save the document.

Additional information:

Call Stack
DevExpress.Office.v24.2.Core.dll!DevExpress.Office.PInvoke.Win32.GetCharWidth(System.IntPtr hdc, uint firstChar, uint lastChar) Line 103 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.WindowsPlatformFontInfo.PrepareWidthAndKerningArrays.AnonymousMethod__0(char first, char last) Line 494 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Utils.CharWidthArrayChunk.Update(System.Func<char, char, int[]> widthUpdater, System.Func<char, char, int[]> abcUpdater) Line 57 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Utils.CharWidthArrayPrimaryLevel.Update(System.Func<char, char, int[]> widthUpdater, System.Func<char, char, int[]> abcUpdater) Line 105 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Utils.CharWidthArray.Update(System.Func<char, char, int[]> widthUpdater, System.Func<char, char, int[]> abcUpdater) Line 132 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.WindowsPlatformFontInfo.PrepareWidthAndKerningArrays(System.IntPtr hdc, string text) Line 493 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.WindowsPlatformFontInfo.PrepareWidthAndKerningArrays.AnonymousMethod__0(System.IntPtr hdc) Line 469 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.GdiPlusFontInfoMeasurer.GetReleaseGraphicsHdc<object>(System.Func<System.IntPtr, object> function) Line 192 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.WindowsPlatformFontInfo.PrepareWidthAndKerningArrays(DevExpress.Office.Drawing.GdiFontInfoMeasurer measurer, string text) Line 468 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.WindowsPlatformFontInfo.GetCharactersWidth(DevExpress.Office.Drawing.GdiFontInfoMeasurer measurer, string text, DevExpress.Drawing.DXStringFormat stringFormat) Line 515 C# DevExpress.Spreadsheet.v24.2.Core.dll!DevExpress.XtraSpreadsheet.Drawing.PureGdiFontInfoMeasurer.MeasureMaxDigitWidthF(DevExpress.Office.Drawing.FontInfo fontInfo) Line 184 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.FontInfo.CalculateMaxDigitWidth(DevExpress.Office.Drawing.FontInfoMeasurer measurer) Line 204 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.FontInfo.CalculateFontParameters(DevExpress.Office.Drawing.FontInfoMeasurer measurer, bool allowCjkCorrection) Line 201 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.WindowsPlatformFontInfo.CalculateFontParameters(DevExpress.Office.Drawing.FontInfoMeasurer measurer, bool allowCjkCorrection) Line 433 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.FontInfo.Initialize(DevExpress.Office.Drawing.FontInfoMeasurer measurer, string fontName, int doubleFontSize, bool fontBold, bool fontItalic, bool fontStrikeout, bool fontUnderline, bool allowCjkCorrection, int textRotation, bool useSystemFontQuality, DevExpress.Office.Drawing.FontInfo baselineFontInfo, DevExpress.Office.Drawing.FontInfo smallCapsBaselineFontInfo) Line 185 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.FontInfo.FontInfo(DevExpress.Office.Drawing.FontInfoMeasurer measurer, string fontName, int doubleFontSize, bool fontBold, bool fontItalic, bool fontStrikeout, bool fontUnderline, bool allowCjkCorrection, int textRotation, bool useSystemFontQuality, DevExpress.Office.Drawing.FontInfo baselineFontInfo, DevExpress.Office.Drawing.FontInfo smallCapsBaselineFontInfo) Line 89 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.WindowsPlatformFontInfo.WindowsPlatformFontInfo(DevExpress.Office.Drawing.FontInfoMeasurer measurer, string fontName, int doubleFontSize, bool fontBold, bool fontItalic, bool fontStrikeout, bool fontUnderline, bool allowCjkCorrection, int textRotation, bool useSystemFontQuality, DevExpress.Office.Drawing.FontInfo baselineFontInfo, DevExpress.Office.Drawing.FontInfo smallCapsBaselineFontInfo) Line 126 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.WindowsPlatformFontCache.CreateFontInfoCore(string fontName, int doubleFontSize, bool fontBold, bool fontItalic, bool fontStrikeout, bool fontUnderline, int textRotation, DevExpress.Office.Drawing.FontInfo baselineFontInfo, DevExpress.Office.Drawing.FontInfo smallCapsBaselineFontInfo) Line 72 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.WindowsPlatformFontCache.CreateFontCharacterSet(DevExpress.Office.Drawing.FontDescription fontDescription) Line 94 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.FontCache.CreateFontFamilyCharacterSet(string fontName) Line 359 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.FontCache.GetFontCharacterSet(DevExpress.Office.Drawing.FontDescription fontDescription) Line 349 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.FontCache.PopulateNameToCharacterSetMap() Line 320 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Drawing.FontCache.FindSubstituteFont(DevExpress.Office.Drawing.FontDescription sourceFont, char ch) Line 297 C# DevExpress.Office.v24.2.Core.dll!DevExpress.Office.Utils.SubstituteFontBuilder.SubstituteFont(DevExpress.Office.Drawing.FontInfo fontInfo, string text) Line 59 C#

Workaround:

As a workaround, remove the Symbols Nerd Font from the problematic machine.

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.