Posted 16 years ago
by Paul Fuller
Hi,
I have a font editor dialog (not the built-in one) that allows users to change the font (family, size etc) on a variety of HighlightingStyle objects that are used by the editor. After this is invoked and a change is made I return to the editor but there is a glitch.
If for example the user changes from Consolas 10 point to Consolas 16 point, the editor now displays the text in the larger size but the character spacing still appears to be calculated from the original size. Each text range with a given style is rendered within the original rectangle but is obviously clipped.
Changing font size from larger to small has the opposite effect but now with lots of space around the smaller characters.
Have tried Refresh() and similar on the editor control with no effect.
The problem is resolved if I switch to a different document and then back.
Any suggestions for how to force the editor to update with the new font settings ?
Thanks,
Paul
I have a font editor dialog (not the built-in one) that allows users to change the font (family, size etc) on a variety of HighlightingStyle objects that are used by the editor. After this is invoked and a change is made I return to the editor but there is a glitch.
If for example the user changes from Consolas 10 point to Consolas 16 point, the editor now displays the text in the larger size but the character spacing still appears to be calculated from the original size. Each text range with a given style is rendered within the original rectangle but is obviously clipped.
Changing font size from larger to small has the opposite effect but now with lots of space around the smaller characters.
Have tried Refresh() and similar on the editor control with no effect.
The problem is resolved if I switch to a different document and then back.
Any suggestions for how to force the editor to update with the new font settings ?
Thanks,
Paul