Dj Gilcrease wrote:
I played with Mac's anti-aliasing settings which made no visual
difference. Anyway, is there supposed to be a 1:1 correlation between
pixels and points (I didn't think so)?No 1pt is 1/72 of an inch, so if your screen resolution is 96dpi
(Fairly standard now) an 8pt font should be 11 px high (10.7
actually), a 12pt font would be 16 px high etc (pt/.75)
Thanks for the clarification and reminder of how this stuff relates!
The hardcoded value is only really a starting point, as we already allow
for font zooming (using Ctrl++ and Ctrl+-). I'm just looking for the
starting point to be similar platform to platform given identical screen
and font resolutions.I did some testing as I have run into issues with users complaining
about a font being too small on OSX before and found that the OSX pt
size appears to actually displays 2 lower then what you set it as.
Windows and GTK are the same, even in your image (The perceived
difference is an optical illusion due to the button size difference).
The reason I think OSX does this is because pre OSX Mac's used a 72dpi
resolution so there was a 1:1 correlation between pt and px and they
wished to maintain this with OSX (Thus they multiply the actual pt
size by .75 which negates the difference, but also reduces the font
size you actually see)
Ok, I went to Text Edit and verified that 8pt looks horribly small there, too. So, now I understand why Mac users always put things in 12 pt, which looks too big to me, especially when printed out.
My problem boils down to: if I set the font size to 12 to be nice on Mac, it will look too big when that code runs on Win or Lin. If I set it to 10 on Win/Lin, it'll be perceived as too small on Mac.
If you modify your test to include
dc = wx.ClientDC(frm)
print fontSize, dc.GetFullTextExtent(but.GetLabel(), font)
del dcin the for loop you will see the Height is the same for winXP and GTK,
> but lower on OSX. My guess (I dont have OSX) is you will get the
> following heights on OSX
> 10
> 12
> 14
> 17
On Windows, I get:
13
16
19
23
On Ubuntu:
13
17
19
23
On OS X:
9
12
15
17
So, your guess is correct. Any ideas on how to solve this cross-platform problem in a general way?