My font height is really different between OSX and Windows :
I thought that a given font size would lead to the same result on win and osx, but if I just do setFont (15.f), then the height is much much smaller on windows.
To have the same size, I have to use withHeightInPoint (15.f).
Is that expected ? Or why is that? Is there's a workaround?
It's a bit annoying, as I have to call withHeightInPoint in all the lnf functions that draws text.
If it can give any clue : when I look at Font (15).getHeightInPoints(), I got 15 on osx, but only 10.9729 on Windows.
Any idea what's the origin of such a small value, or what I could look at ?
I don't think it changes anything (?), but just in case, I build my plugin with parallels under a retina mac.
I had exactly the same problem, and it drived me nuts. Everything seemed to be fine with some default fonts, but when I used fonts from embedded OTF files, I had to write different font heights for Windows and for Mac OS X so that the display is consistant. I wonder if it is something about the font itself and the font engine, or maybe something about OTF files reading ?
My guess is that it must be differences in the underlying engine, because at the level that the juce classes work, all fonts are presented in essentially the same way.
Jules says he was embedding a font and getting similar results. I find even if I do that Windows renders the font a bit thiner than MacOS and I need to do some tweaks - I’ve ended up with a couple of utility functions that get me the correctly adjusted font for the platform in the end…
Cheers jimc,
Do those two screenshots look similar to your discoveries or have I just picked two very unlucky fonts?
I have since discovered Font::withPointHeight() which seems to go much of the way there. I’m still getting more space between rows of text on windows, but I’m less worried now about having to use successive approximation.
If I end up with something reliable in a general sense I’ll submit it here.
I was working with much smaller fonts - but relatively those differences don’t look surprising. What fonts are they? I found that the vertical alignment was a pixel out once as well when it mattered…
I’m running in to this size issue the same as Dave above where he has already posted pictures of the large size differences between Windows and Mac OS.
I think some people are confusing this issue with the slight OS related rendering differences in apparent thickness where in fact this specific issue is much more evident see Dave’s pictures 5 posts up.
The fonts I’m using show this problem in both otf and ttf formats and only with juce. A quick debug through leads me to believe the edge tables are generated at the wrong size/position on Windows pre transform.
ProJucer component size is visible in the lower RH corner if you click on the picture.
what is happening here?
I’m expecting a font with a height of 100 to be 100px from top to bottom.