Ticket #12541 (closed defect: fixed)
Allow using -1 font size to mean default
| Reported by: | wbruhin | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | wxMSW | Version: | 2.9.1 |
| Keywords: | Cc: | ||
| Blocked By: | Patch: | no | |
| Blocking: |
Description
It looks like the problem is simply that the -1 is not causing wxFont on Windows to use the default font's size. It looks like a bunch of stuff was changed in 2.9, but I'm not sure I understand all the changes. In 2.8 we had code like this:
m_pointSize = pointSize == -1 ? wxNORMAL_FONT->GetPointSize() : pointSize;
But in 2.9 it looks like it is converting the point size to a pixel size and it is not checking for -1 at all:
const int ppInch = ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY);
lf.lfHeight = -(int)((pointsize*((double)ppInch)/72.0) + 0.5);
See also email thread on wxPython-dev "wxPy2911preview - default font size - wxWidgets" in Oct 2010.
