]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/font.cpp
Set default encoding
[wxWidgets.git] / src / os2 / font.cpp
index c1839db1ca66c6da98c592b64c6cf92373e28954..49aaf4ccdc26f617a452184d56ccc8a718652cce 100644 (file)
@@ -371,6 +371,8 @@ bool wxFontRefData::Alloc(
     long                            lRc;
     short                           nIndex = 0;
     PFONTMETRICS                    pFM = NULL;
+    ERRORID                         vError;
+    wxString                        sError;
 
     if (!m_bNativeFontInfoOk)
     {
@@ -396,6 +398,8 @@ bool wxFontRefData::Alloc(
     }
     if (!m_hFont)
     {
+        vError = ::WinGetLastError(vHabmain);
+        sError = wxPMErrorToStr(vError);
         wxLogLastError("CreateFont");
     }
 
@@ -496,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;
@@ -701,8 +701,7 @@ void wxNativeFontInfo::SetEncoding(
                                   ,&vInfo
                                  ))
     {
-#if wxUSE_FONTMAP
-        if (wxTheFontMapper->GetAltForEncoding( eEncoding
+        if (wxFontMapper::Get()->GetAltForEncoding( eEncoding
                                                ,&vInfo
                                               ))
         {
@@ -717,7 +716,6 @@ void wxNativeFontInfo::SetEncoding(
             }
         }
         else
-#endif // wxUSE_FONTMAP
         {
             // unsupported encoding, replace with the default
             vInfo.charset = 850;
@@ -1119,5 +1117,5 @@ void wxFont::SetPS(
     M_FONTDATA->SetPS(hPS);
 
     RealizeResource();
-} // end of wxFont::SetUnderlined
+} // end of wxFont::SetPS