X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e6527f9dd4ed313b3d651e977f8c1219114e38d4..28be2e8a170979d476a5ea4f585505b8a2f5af27:/src/gtk1/font.cpp diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 5e9d1ce629..83010c18da 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -31,6 +31,7 @@ #include #include +#include #include // ---------------------------------------------------------------------------- @@ -70,7 +71,7 @@ private: wxString m_faceName; wxFontEncoding m_encoding; - friend wxFont; + friend class wxFont; }; // ============================================================================ @@ -166,6 +167,7 @@ wxFont::wxFont( const wxString& fontname, const wxFontData& fontdata ) wxStringTokenizer tn( fontname, wxT("-") ); + tn.GetNextToken(); // skip initial empty token tn.GetNextToken(); // foundry M_FONTDATA->m_faceName = tn.GetNextToken(); // family @@ -189,8 +191,11 @@ wxFont::wxFont( const wxString& fontname, const wxFontData& fontdata ) tn.GetNextToken(); // pixel size tmp = tn.GetNextToken(); // pointsize - long num = wxStrtol (tmp.c_str(), (wxChar **) NULL, 10); - M_FONTDATA->m_pointSize = (int)(num / 10); + if (tmp != wxT("*")) + { + long num = wxStrtol (tmp.c_str(), (wxChar **) NULL, 10); + M_FONTDATA->m_pointSize = (int)(num / 10); + } tn.GetNextToken(); // x-res tn.GetNextToken(); // y-res @@ -392,7 +397,7 @@ void wxFont::SetEncoding(wxFontEncoding encoding) static GdkFont *g_systemDefaultGuiFont = (GdkFont*) NULL; -static GdkFont *GtkGetDefaultGuiFont() +GdkFont *GtkGetDefaultGuiFont() { if (!g_systemDefaultGuiFont) {