1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-16 02:54:33 +02:00

Try to guess a sane base font size on Mac

This commit is contained in:
Teo Mrnjavac
2013-07-30 22:00:17 +02:00
parent 00cb5fafe2
commit fc4d0a7933

View File

@@ -126,7 +126,14 @@ DpiScaler::ratioFromFontHeight()
int fH = QFontMetrics( f ).ascent() + 1; //a font's em-height should be ascent + 1px (baseline)
qreal basePpp = s_baseDpi / 72.; //72*(1.333)=96 dpi
qreal baseFontHeight = 7 * basePpp; //we assume a minimum font size of 7pt
#ifdef Q_OS_MAC
const int baseFontSize = 13;
#else
const int baseFontSize = 7;
#endif
qreal baseFontHeight = baseFontSize * basePpp; //we assume a minimum font size of 7pt
qreal ratioFromFontHeights = qMax( fH / baseFontHeight, 1. );
return ratioFromFontHeights;