]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/font.cpp
PyCrust updates
[wxWidgets.git] / src / gtk1 / font.cpp
index c58aca2e818c1a1ba41929c0ed121fe9fdc9b85d..15909254a4a109c07bd90fcf085286ae773d4e2e 100644 (file)
@@ -146,21 +146,6 @@ wxFontRefData::~wxFontRefData()
     }
 }
 
-// ----------------------------------------------------------------------------
-// wxNativeFontInfo
-// ----------------------------------------------------------------------------
-
-bool wxNativeFontInfo::FromString(const wxString& s)
-{
-    xFontName = s;
-    return TRUE;
-}
-
-wxString wxNativeFontInfo::ToString() const
-{
-    return xFontName;
-}
-
 // ----------------------------------------------------------------------------
 // wxFont
 // ----------------------------------------------------------------------------
@@ -169,15 +154,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
 
 void wxFont::Init()
 {
-    if (wxTheFontList)
-        wxTheFontList->Append( this );
 }
 
 wxFont::wxFont(const wxNativeFontInfo& info)
 {
     Init();
 
-    Create(info.ToString());
+    Create(info.xFontName);
 }
 
 bool wxFont::Create(const wxNativeFontInfo& info)
@@ -201,8 +184,6 @@ bool wxFont::Create( int pointSize,
 
 bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
 {
-    Init();
-
     if( !fontname )
     {
          *this = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT);
@@ -320,8 +301,6 @@ void wxFont::Unshare()
 
 wxFont::~wxFont()
 {
-    if (wxTheFontList)
-        wxTheFontList->DeleteObject( this );
 }
 
 // ----------------------------------------------------------------------------
@@ -479,6 +458,12 @@ GdkFont *GtkGetDefaultGuiFont()
         }
         gtk_widget_destroy( widget );
     }
+    else
+    {
+        // already have it, but ref it once more before returning
+        gdk_font_ref(g_systemDefaultGuiFont);
+    }
+
     return g_systemDefaultGuiFont;
 }