]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/font.cpp
Make use of new array functions.
[wxWidgets.git] / src / gtk1 / font.cpp
index 315cb82736272d36fd8f1daec94eb9a0840cfe23..a27989e1056d09f3cce2d17cb9d8514f4146d089 100644 (file)
@@ -178,6 +178,29 @@ void wxFontRefData::Init(int pointSize,
 
     m_underlined = underlined;
     m_encoding = encoding;
+    
+#ifdef __WXGTK20__    
+    // Create native font info
+    m_nativeFontInfo.description = pango_font_description_new();
+
+    // And set its values    
+    switch (m_family)
+    {
+        case wxFONTFAMILY_MODERN:
+        case wxFONTFAMILY_TELETYPE:
+           pango_font_description_set_family( m_nativeFontInfo.description, "monospace" );
+           break;
+        case wxFONTFAMILY_SWISS:
+           pango_font_description_set_family( m_nativeFontInfo.description, "serif" );
+           break;
+        default:
+           pango_font_description_set_family( m_nativeFontInfo.description, "sans" );
+           break;
+    }
+    SetStyle( m_style );
+    SetPointSize( m_pointSize );
+    SetWeight( m_weight );
+#endif
 }
 
 wxFontRefData::wxFontRefData( const wxFontRefData& data )
@@ -252,7 +275,7 @@ wxFontRefData::wxFontRefData(const wxString& fontname)
             break;
     }
     
-    if (m_faceName == wxT("monospaced"))
+    if (m_faceName == wxT("monospace"))
     {
         m_family = wxFONTFAMILY_TELETYPE;
     }