Adding spciial case for MacOS which has a base DPI of 72.

See issue #3547
This commit is contained in:
Hombre
2019-01-06 20:08:06 +01:00
parent 4d77e44880
commit 0407dc3487
3 changed files with 13 additions and 4 deletions

View File

@@ -188,14 +188,14 @@ RTWindow::RTWindow ()
if (isPix) {
// HOMBRE: guessing here...
// if resolution is lower than 192ppi, we're supposing that it's already expressed in a scale==1 scenario
if (resolution >= 192) {
if (resolution >= int(RTScalable::baseHiDPI)) {
// converting the resolution to a scale==1 scenario
resolution /= 2;
}
// 1pt = 1/72in @ 96 ppi
// HOMBRE: If the font unit is px, is it alredy scaled up to match the resolution ?
// px >inch >pt >"scaled pt"
pt = (int)(fontSize / 96. * 72 * (96. / resolution) + 0.49);
pt = (int)(double(fontSize) / RTScalable::baseDPI * 72. * (RTScalable::baseHiDPI / resolution) + 0.49);
} else {
pt = fontSize / Pango::SCALE;
}