X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e1146627e2bf16a48554e1c224f427dbd6247c5d..0598e263cecc205aff9a6735cf41803205fabbcb:/src/os2/font.cpp diff --git a/src/os2/font.cpp b/src/os2/font.cpp index 8023ca58c8..49aaf4ccdc 100644 --- a/src/os2/font.cpp +++ b/src/os2/font.cpp @@ -108,8 +108,13 @@ public: // inline int GetPointSize(void) const { - return m_bNativeFontInfoOk ? m_vNativeFontInfo.GetPointSize() - : m_nPointSize; + // + // We don't use the actual native font point size since it is + // the chosen physical font, which is usually only and approximation + // of the desired outline font. The actual displayable point size + // is the one stored in the refData + // + return m_nPointSize; } inline int GetFamily(void) const @@ -366,6 +371,8 @@ bool wxFontRefData::Alloc( long lRc; short nIndex = 0; PFONTMETRICS pFM = NULL; + ERRORID vError; + wxString sError; if (!m_bNativeFontInfoOk) { @@ -391,6 +398,8 @@ bool wxFontRefData::Alloc( } if (!m_hFont) { + vError = ::WinGetLastError(vHabmain); + sError = wxPMErrorToStr(vError); wxLogLastError("CreateFont"); } @@ -402,7 +411,13 @@ bool wxFontRefData::Alloc( // memcpy(&m_vFattrs, &m_vNativeFontInfo.fa, sizeof(m_vFattrs)); memcpy(&m_vFname, &m_vNativeFontInfo.fn, sizeof(m_vFname)); - m_nPointSize = m_vNativeFontInfo.fm.lEmHeight; + // + // Going to leave the point size alone. Mostly we use outline fonts + // that can be set to any point size inside of Presentation Parameters, + // regardless of whether or not the actual font is registered in the system. + // The GpiCreateLogFont will do enough by selecting the right family, + // and face name. + // if (strcmp(m_vNativeFontInfo.fa.szFacename, "Times New Roman") == 0) m_nFamily = wxROMAN; else if (strcmp(m_vNativeFontInfo.fa.szFacename, "Tms Rmn") == 0) @@ -485,10 +500,6 @@ void wxFontRefData::Free() if ( m_hFont ) { - if (!::GpiSetCharSet(m_hPS, LCID_DEFAULT)) - { - wxLogLastError(wxT("DeleteObject(font)")); - } ::GpiDeleteSetId(m_hPS, 1L); /* delete the logical font */ m_nFontId = 0; m_hFont = 0; @@ -690,8 +701,7 @@ void wxNativeFontInfo::SetEncoding( ,&vInfo )) { -#if wxUSE_FONTMAP - if (wxTheFontMapper->GetAltForEncoding( eEncoding + if (wxFontMapper::Get()->GetAltForEncoding( eEncoding ,&vInfo )) { @@ -706,7 +716,6 @@ void wxNativeFontInfo::SetEncoding( } } else -#endif // wxUSE_FONTMAP { // unsupported encoding, replace with the default vInfo.charset = 850; @@ -1108,5 +1117,5 @@ void wxFont::SetPS( M_FONTDATA->SetPS(hPS); RealizeResource(); -} // end of wxFont::SetUnderlined +} // end of wxFont::SetPS