Why does Qt on OSX appear to default to overly large fonts? Even when you select the same font size manually the fonts appear slightly bigger. Does Qt on OSX use a different font rendering to OSX? Does this improve if you use Qt for Cocoa?
In addition, is there a qtconfig tool or equivalent to globally set the font settings for all Qt applications?
Thanks!
Max Howell is correct. In native OS X applications, you have got the option to set small and tiny sizes to your windows and widgets. These will then choose smaller fonts and also will resize some of the graphical elements.
Many OS X designers make use of this, and therefore an application which does not follow this conventions is very likely to look oversized on OS X.
As has been noted, Qt does provide widget attributes which can change this: Qt::WA_MacNormalSize, Qt::WA_MacSmallSize, Qt::WA_MacMiniSize, Qt::WA_MacVariableSize – but unfortunately, it seems that many people don’t know about them and if they do, implementing them is a bit of a hack, as it will require the code to have quite a few #ifdefs (unless they’re using a helper function for this to reduce the effort).
Particularly bad is that Qt does not use these attributes in their own Qt Creator or Qt Designer either, especially in widgets such as the property tables where the large row height makes it almost useless on smaller monitors, because you’ll need to scroll forever to find the property you’ve been looking for.
Why does Qt on OSX appear to default to overly large fonts?
It defaults to the same fonts in InterfaceBuilder and Qt Designer.
Even when you select the same font size manually the fonts appear slightly bigger.
Turns out this was just my imagination, they are exactly the same.
Does Qt on OSX use a different font rendering to OSX?
No, it uses the native rendering.
Does this improve if you use Qt for Cocoa?
Font's don't but other things do change. The font rendering between Carbon and Cocoa is seemingly identical.
In addition, is there a qtconfig tool or equivalent to globally set the font settings for all Qt applications?
There's no qtconfig tool for OSX or any way of globally setting font settings.
It seems the root of the above problems is that OSX applications tend to use slightly lower point fonts for many things compared to Windows or Linux. As a result the font sizes used in an Qt OSX application should be hand-tweaked to better match those use elsewhere on the platform.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With