I'm not sure what the correct technique is for preserving existing styles after making a change to the font of the default style. My text is styled via one of the built-in lexers. I also have a custom line number margin, which is set to margin type RTEXT. I fill those numbers by listening to the "add/delete" notification. I also tag some of the line numbers with a custom style(showing them in red foreground for example). This all works fine.
My issue is what I should be doing following a change of font in the default style(ie calling SCI_STYLESETFONT STYLE_DEFAULT) so my custom style(s) don't lose their non-font attributes(ie foreground, background, etc). I'm calling SCI_STYLECLEARALL after the font change, which unfortunately resets the attributes of the styles I already have assigned. I can cause the lexer styles to be refreshed by calling SCI_COLOURISE, but this doesn't help with the other non-lexer styles. It seems like I'm forced to manually reassign(ie make the SCI_STYLESET* calls) all over again.
Do I have this sequence correct? Is there a better way of doing this?
Thanks,
-John