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:Am I doing soemthing wrong?
Thanks
Petra
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) ;
Thanks
Petra