projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
oops, we definitely DON'T want to reset m_renderer here
[wxWidgets.git]
/
src
/
gtk1
/
font.cpp
diff --git
a/src/gtk1/font.cpp
b/src/gtk1/font.cpp
index c58aca2e818c1a1ba41929c0ed121fe9fdc9b85d..c8a4c8da16b251022b6d1cb634d7683328fea849 100644
(file)
--- a/
src/gtk1/font.cpp
+++ b/
src/gtk1/font.cpp
@@
-152,13
+152,29
@@
wxFontRefData::~wxFontRefData()
bool wxNativeFontInfo::FromString(const wxString& s)
{
bool wxNativeFontInfo::FromString(const wxString& s)
{
- xFontName = s;
+ wxStringTokenizer tokenizer(s, _T(";"));
+
+ wxString token = tokenizer.GetNextToken();
+ //
+ // Ignore the version for now
+ //
+
+ xFontName = tokenizer.GetNextToken();
+ if(!xFontName)
+ return FALSE;
+
return TRUE;
}
wxString wxNativeFontInfo::ToString() const
{
return TRUE;
}
wxString wxNativeFontInfo::ToString() const
{
- return xFontName;
+ wxString s;
+
+ s.Printf(_T("%d;%s"),
+ 0, // version
+ xFontName.c_str());
+
+ return s;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
@@
-177,7
+193,7
@@
wxFont::wxFont(const wxNativeFontInfo& info)
{
Init();
{
Init();
- Create(info.
ToString()
);
+ Create(info.
xFontName
);
}
bool wxFont::Create(const wxNativeFontInfo& info)
}
bool wxFont::Create(const wxNativeFontInfo& info)
@@
-201,8
+217,6
@@
bool wxFont::Create( int pointSize,
bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
{
bool wxFont::Create(const wxString& fontname, wxFontEncoding enc)
{
- Init();
-
if( !fontname )
{
*this = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT);
if( !fontname )
{
*this = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT);
@@
-479,6
+493,12
@@
GdkFont *GtkGetDefaultGuiFont()
}
gtk_widget_destroy( widget );
}
}
gtk_widget_destroy( widget );
}
+ else
+ {
+ // already have it, but ref it once more before returning
+ gdk_font_ref(g_systemDefaultGuiFont);
+ }
+
return g_systemDefaultGuiFont;
}
return g_systemDefaultGuiFont;
}