]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/font.cpp
gtk 1.2.8 compilation fix
[wxWidgets.git] / src / msw / font.cpp
index 33c95ced7f38b1eb5d59a0c3aaec4576158f51de..071d8b0bd9371febb0c8ddb710a0278ab90b7b54 100644 (file)
 
 #include "wx/msw/private.h"
 
-#if !USE_SHARED_LIBRARIES
-    IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
-
-    #if wxUSE_PORTABLE_FONTS_IN_MSW
-        IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory, wxObject)
-    #endif
-#endif
+IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
 
 // ----------------------------------------------------------------------------
 // wxFontRefData - the internal description of the font
@@ -149,7 +143,7 @@ wxFontRefData::~wxFontRefData()
     {
         if ( !::DeleteObject((HFONT) m_hFont) )
         {
-            wxLogLastError("DeleteObject(font)");
+            wxLogLastError(wxT("DeleteObject(font)"));
         }
     }
 }
@@ -200,17 +194,16 @@ bool wxFont::RealizeResource()
     {
         // VZ: the old code returned FALSE in this case, but it doesn't seem
         //     to make sense because the font _was_ created
-        wxLogDebug(wxT("Calling wxFont::RealizeResource() twice"));
-
         return TRUE;
     }
 
     LOGFONT lf;
     wxFillLogFont(&lf, this);
     M_FONTDATA->m_hFont = (WXHFONT)::CreateFontIndirect(&lf);
+    M_FONTDATA->m_faceName = lf.lfFaceName;
     if ( !M_FONTDATA->m_hFont )
     {
-        wxLogLastError("CreateFont");
+        wxLogLastError(wxT("CreateFont"));
 
         return FALSE;
     }
@@ -224,7 +217,7 @@ bool wxFont::FreeResource(bool force)
     {
         if ( !::DeleteObject((HFONT) M_FONTDATA->m_hFont) )
         {
-            wxLogLastError("DeleteObject(font)");
+            wxLogLastError(wxT("DeleteObject(font)"));
         }
 
         M_FONTDATA->m_hFont = 0;
@@ -235,6 +228,11 @@ bool wxFont::FreeResource(bool force)
 }
 
 WXHANDLE wxFont::GetResourceHandle()
+{
+    return GetHFONT();
+}
+
+WXHFONT wxFont::GetHFONT() const
 {
     if ( !M_FONTDATA )
         return 0;