Font in HighlightingStyles

SyntaxEditor for Windows Forms Forum

Posted 17 years ago by Petra
Version: 4.0.0238
Avatar
Hi,

I'm trying to allow chosing fonts for syntax elements, and I want to use the font specified for the DefaultStyle as Editor Font, so that it will be used for all items for which no different font has been defined.

This works fine initially, when there are no stylesettings yet to import:
When I change fontfamily and/or fontsize info in the defaultstyle, the new style is used for all items that have not font defined - fine. It also shows up correctly in the exported style settings.

But, after starting the application anew and importing the styles, the newly set style is no longer used for syntax items with no font of their own. I don't know what style is being used there, it is neither the editor default nor the one I chose. The Default Style is now used only for those syntax items that are not recognised as a special kind of token (and are therefore shown with Default-Style anyway).

The editor font setting is correct, but apparently ignored.

Strange enough, changes to the fontsize are shown correctly.

The only way i can make it work again is to throw away the exported stylesettings.

Code for setting the font:
editor.Font = new Font(defaultHighlightingStyle.FontFamilyName,defaultHighlightingStyle.FontSize) ; 
Am I doing soemthing wrong?

Thanks
Petra

Comments (1)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Petra,

Could you possibly throw together a tiny sample project that shows this and e-mail it over? Then we can debug it and figure out a resolution for you. Thanks!


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.