Crash when setting font family to invalid font when line numbers are shown

SyntaxEditor for WPF Forum

Posted 3 years ago by Xinen Lee
Version: 16.1.0632
Platform: .NET 4.5
Environment: Windows 10 (64-bit)
Avatar

Hi Actipro

When I set the IHighlightingStyle.FontFamilyName to an invalid value (e.g. "Cooper Black"), I get an unhandled exception in TextLineNumberMarginBase.CheckForAssetCacheUpdates:

 

An unhandled exception of type 'System.ArgumentException' occurred in WindowsBase.dll

Additional information: '' is not a valid value for property 'FontFamily'.

 

This crash only happens when Line Numbers are visible. If Line Numbers are not visible and we set this invalid FontFamily value, the editor is able to display a backup/default font.

Comments (4)

Answer - Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Xinen,

Thanks for reporting this.  We've fixed it for the next maintenance release.


Actipro Software Support

Posted 3 years ago by Xinen Lee
Avatar

Thanks!

Posted 3 years ago by Xinen Lee
Avatar

Hi, thanks for your fix. It does not crash now but there is an unexpected behavior -

Steps to reproduce

1. Set PlainText and LineNumbers font to Comic Sans - both PlainText and LineNumbers font is changed to Comic Sans

2. Set PlainText and LineNumbers font to Fixedsys - PlainText gets set to a default font (e.g. Consolas) but LineNumbers's font remains as Comic Sans.

I would expect LineNumbers to also get updated to the default font Consolas.

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Xinen,

Thanks, we've updated that scenario to revert back to using the SyntaxEditor.LineNumberMarginFontFamily value.  This will be in the next build.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.