}
}
-// ----------------------------------------------------------------------------
-// wxNativeFontInfo
-// ----------------------------------------------------------------------------
-
-bool wxNativeFontInfo::FromString(const wxString& s)
-{
- xFontName = s;
- return TRUE;
-}
-
-wxString wxNativeFontInfo::ToString() const
-{
- return xFontName;
-}
-
// ----------------------------------------------------------------------------
// wxFont
// ----------------------------------------------------------------------------
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)
bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
{
- Init();
-
if( !fontname )
{
*this = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT);
wxFont::~wxFont()
{
- if (wxTheFontList)
- wxTheFontList->DeleteObject( this );
}
// ----------------------------------------------------------------------------
}
gtk_widget_destroy( widget );
}
+ else
+ {
+ // already have it, but ref it once more before returning
+ gdk_font_ref(g_systemDefaultGuiFont);
+ }
+
return g_systemDefaultGuiFont;
}