X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/789034a083852d82f499cd280c41501fb2f82317..d9f9aa2d8fcb956444588b2c19ffe8d4a3f5d2bb:/src/msw/font.cpp diff --git a/src/msw/font.cpp b/src/msw/font.cpp index c4392218bd..cd97c822e5 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -218,16 +218,10 @@ void wxFontRefData::Init(const wxNativeFontInfo& info) m_faceName = info.lf.lfFaceName; - // remember that 1pt = 1/72inch int height = abs(info.lf.lfHeight); -#if wxUSE_SCREEN_DPI - HDC dc = ::GetDC(NULL); - static const int ppInch = GetDeviceCaps(dc, LOGPIXELSY); - ::ReleaseDC(NULL, dc); -#else - static const int ppInch = 96; -#endif + // remember that 1pt = 1/72inch + const int ppInch = ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY); m_pointSize = (int) (((72.0*((double)height))/(double) ppInch) + 0.5); m_encoding = wxGetFontEncFromCharSet(info.lf.lfCharSet); @@ -296,42 +290,42 @@ bool wxNativeFontInfo::FromString(const wxString& s) token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfItalic = l; + lf.lfItalic = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfUnderline = l; + lf.lfUnderline = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfStrikeOut = l; + lf.lfStrikeOut = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfCharSet = l; + lf.lfCharSet = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfOutPrecision = l; + lf.lfOutPrecision = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfClipPrecision = l; + lf.lfClipPrecision = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfQuality = l; + lf.lfQuality = (BYTE)l; token = tokenizer.GetNextToken(); if ( !token.ToLong(&l) ) return FALSE; - lf.lfPitchAndFamily = l; + lf.lfPitchAndFamily = (BYTE)l; token = tokenizer.GetNextToken(); if(!token) @@ -456,7 +450,7 @@ bool wxFont::RealizeResource() return TRUE; } -bool wxFont::FreeResource(bool force) +bool wxFont::FreeResource(bool WXUNUSED(force)) { if ( GetResourceHandle() ) {