]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/font.cpp
Split wxCanvas into two (wxVectorCanvas).
[wxWidgets.git] / src / gtk1 / font.cpp
index 5e9d1ce629aec4527207a93e0d9f0d1444302985..83010c18da9d477b7255e7ff55a91e9294f9c9f9 100644 (file)
@@ -31,6 +31,7 @@
 #include <strings.h>
 
 #include <gdk/gdk.h>
 #include <strings.h>
 
 #include <gdk/gdk.h>
+#include <gdk/gdkprivate.h>
 #include <gtk/gtk.h>
 
 // ----------------------------------------------------------------------------
 #include <gtk/gtk.h>
 
 // ----------------------------------------------------------------------------
@@ -70,7 +71,7 @@ private:
     wxString        m_faceName;
     wxFontEncoding  m_encoding;
 
     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("-") );
 
 
     wxStringTokenizer tn( fontname, wxT("-") );
 
+    tn.GetNextToken();                           // skip initial empty token
     tn.GetNextToken();                           // foundry
 
     M_FONTDATA->m_faceName = tn.GetNextToken();  // family
     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
     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
 
     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 *g_systemDefaultGuiFont = (GdkFont*) NULL;
 
-static GdkFont *GtkGetDefaultGuiFont()
+GdkFont *GtkGetDefaultGuiFont()
 {
     if (!g_systemDefaultGuiFont)
     {
 {
     if (!g_systemDefaultGuiFont)
     {