Hi all,
I'd like to ask about a possible change of the fontsize handling in
wxPython 2.9; after running an older code with this updated version it
seems that the pointSize of wx.Font(...) can no longer be -1.
I used this until 2.8 for simple "differential" styling in the
TextCtrls; I'd like to set only the specific formatting parameters
(like font-colour, face ...), while the other parameters should remain
unchanged.
In wx 2.9 the pointSize of -1 actually produces 1pt letters;
the quick fix was to replace all wx.Font(-1...) with the fontsize 8
(which seems to be default on my system);
however, how would I use this in a more robust way (i.e. not having to
hardcode such parameters)?
Get the current font and call its GetPointSize() to get the value to use for the new font.
···
On 11/5/10 5:27 PM, Vlastimil Brom wrote:
Hi all,
I'd like to ask about a possible change of the fontsize handling in
wxPython 2.9; after running an older code with this updated version it
seems that the pointSize of wx.Font(...) can no longer be -1.
I used this until 2.8 for simple "differential" styling in the
TextCtrls; I'd like to set only the specific formatting parameters
(like font-colour, face ...), while the other parameters should remain
unchanged.
In wx 2.9 the pointSize of -1 actually produces 1pt letters;
the quick fix was to replace all wx.Font(-1...) with the fontsize 8
(which seems to be default on my system);
however, how would I use this in a more robust way (i.e. not having to
hardcode such parameters)?
Thanks Robin,
it is indeed easy enough; the code will probably need some refactoring
instead of the lazily passing -1, but it was needed in some other
aspects anyway.
Thanks,
Vlastimil Brom
···
2010/11/6 Robin Dunn <robin@alldunn.com>:
On 11/5/10 5:27 PM, Vlastimil Brom wrote:
...
In wx 2.9 the pointSize of -1 actually produces 1pt letters;
the quick fix was to replace all wx.Font(-1...) with the fontsize 8
(which seems to be default on my system);
however, how would I use this in a more robust way (i.e. not having to
hardcode such parameters)?
Get the current font and call its GetPointSize() to get the value to use for
the new font.