X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c2ff68d3fd238a3b943fa0638c88c30b9f2818af..bd996abe63a8ed6aa07b26856a0d7935002e3e81:/src/unix/fontutil.cpp?ds=sidebyside diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 6ac7550395..9501ea5ee7 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -425,7 +425,7 @@ wxNativeFont wxLoadQueryNearestFont(int pointSize, !wxTestFontEncoding(info) ) { #if wxUSE_FONTMAP - if ( !wxTheFontMapper->GetAltForEncoding(encoding, &info) ) + if ( !wxFontMapper::Get()->GetAltForEncoding(encoding, &info) ) #endif // wxUSE_FONTMAP { // unspported encoding - replace it with the default @@ -644,20 +644,17 @@ static wxNativeFont wxLoadQueryFont(int pointSize, int yPixelsPerCM = screenInfo.ydpcm; - // A point is 1/20 of an inch. + // A point is 1/72 of an inch. // An inch is 2.541 cm. - // So pixelHeight = (pointSize / 20) (inches) * 2.541 (for cm) * yPixelsPerCM (for pixels) + // So pixelHeight = (pointSize / 72) (inches) * 2.541 (for cm) * yPixelsPerCM (for pixels) // In fact pointSize is 10 * the normal point size so // divide by 10. - // I don't know why this is necessary, but otherwise fonts - // are just too big. - float fudgeFactor = 0.6 ; - int pixelHeight = (int) ( (((float)pointSize) / 200.0) * 2.541 * (float) yPixelsPerCM * fudgeFactor) ; + int pixelHeight = (int) ( (((float)pointSize) / 720.0) * 2.541 * (float) yPixelsPerCM) ; // An alternative: assume that the screen is 72 dpi. - // This gets a similar result to above (pre-fudge factor) - //int pixelHeight = (int) (((float)pointSize / 200.0) * 72.0) ; + //int pixelHeight = (int) (((float)pointSize / 720.0) * 72.0) ; + //int pixelHeight = (int) ((float)pointSize / 10.0) ; GR_LOGFONT logFont; logFont.lfHeight = pixelHeight; @@ -844,7 +841,7 @@ static wxNativeFont wxLoadQueryFont(int pointSize, // if pointSize is -1, don't specify any wxString sizeSpec; - if ( fontSpec == -1 ) + if ( pointSize == -1 ) { sizeSpec = _T('*'); }