When using a RichTextCtrl in which I set the font size, and also
include an image, I find that everything works as expected except for
when the cursor is just to the right of the image. When in this
position, text that is entered does not honor the document font size.
Here's a short example, and note that if you move the cursor directly
to the right of the image and enter some text, the font size will not
be correct (though everywhere else works fine). At least on my system
(Mac OS X, Snow Leopard, Python 2.5, wxPython 2.8.10.1) the characters
appear at about half the size. (And thanks in advance for any help...
this has me quite confused.)
I observe the same behavior, although I don't know why.
This will fix the problem tho:
font = wx\.Font\(20, wx\.SWISS, wx\.NORMAL, wx\.NORMAL, False\)
self\.SetFont\(font\)
\#self\.BeginFontSize\(20\)
Thanks for your reply and it works in this toy example, but using
SetFont won't work a my actual app because SetFont changes the font
for the entire document. For example, if the doc starts in italics,
and then I change to normal, the italics is also changed. Is there a
way to make this not happen with SetFont, and if not, are there any
ideas about how to make local changes?
One observation from the demo might give a clue to this: when the
smiley is copied and pasted into sections of modified fonts (e.g. the
blue region), everything works fine and text entered after the pasted
smiley is OK, but if the smiley is added programatically using
WriteImage, entered text shows the same problem as in my demo. So
maybe there's a cheat here, where I can programatically create the
same consequence as the manual copy and paste?
Please ask about this on the wx-users maillist. The author of wxRichTextCtrl will see it there.
···
On 1/20/10 10:14 AM, Tom wrote:
When using a RichTextCtrl in which I set the font size, and also
include an image, I find that everything works as expected except for
when the cursor is just to the right of the image. When in this
position, text that is entered does not honor the document font size.
Here's a short example, and note that if you move the cursor directly
to the right of the image and enter some text, the font size will not
be correct (though everywhere else works fine). At least on my system
(Mac OS X, Snow Leopard, Python 2.5, wxPython 2.8.10.1) the characters
appear at about half the size. (And thanks in advance for any help...
this has me quite confused.)