X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a5001e9361fe01a134b45fa5caf55477e8368d26..6eef5763a81cf58ba9ca4f6adcaa996d263258a0:/src/dfb/fontmgr.cpp diff --git a/src/dfb/fontmgr.cpp b/src/dfb/fontmgr.cpp index 3913b995f8..817b4f5572 100644 --- a/src/dfb/fontmgr.cpp +++ b/src/dfb/fontmgr.cpp @@ -17,6 +17,7 @@ #endif #ifndef WX_PRECOMP + #include "wx/gdicmn.h" #include "wx/utils.h" #include "wx/log.h" #endif @@ -46,14 +47,10 @@ wxFontInstance::wxFontInstance(float ptSize, bool aa, const wxString& filename) : wxFontInstanceBase(ptSize, aa) { - int scrSizePx, scrSizeMM; - wxDisplaySize(NULL, &scrSizePx); - wxDisplaySizeMM(NULL, &scrSizeMM); - double dpi = (scrSizePx / (scrSizeMM * mm2inches)); // NB: DFB's fract_height value is 32bit integer with the last 6 bit // representing fractional value, hence the multiplication by 64; // 1pt=1/72inch, hence "/ 72" - int pixSize = int(ptSize * dpi * 64 / 72); + int pixSize = int(ptSize * wxGetDisplayPPI().y * 64 / 72); DFBFontDescription desc; desc.flags = (DFBFontDescriptionFlags)( @@ -146,7 +143,7 @@ void wxFontsManager::AddAllFonts() { wxString path; if ( !wxGetEnv("WXDFB_FONTPATH", &path) ) - path = _T(wxINSTALL_PREFIX "/share/wx/fonts"); + path = wxT(wxINSTALL_PREFIX "/share/wx/fonts"); wxStringTokenizer tkn(path, wxPATH_SEP); while ( tkn.HasMoreTokens() )