]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/font.cpp
regenerated after version.bkl changes fixing -compatibility_version for Darwin
[wxWidgets.git] / src / gtk1 / font.cpp
index fd221b789fa208e9484eb1e29eceb5374b71a121..e174e7c2d039e416f4a936abb755c54306a62dbf 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "font.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -239,37 +235,11 @@ void wxFontRefData::InitFromNative()
     // Pango sometimes needs to have a size
     int pango_size = pango_font_description_get_size( desc );
     if (pango_size == 0)
-        pango_font_description_set_size( desc, 12 * PANGO_SCALE);
-
-    m_pointSize = pango_font_description_get_size( desc ) / PANGO_SCALE;
-
-    switch (pango_font_description_get_style( desc ))
-    {
-        case PANGO_STYLE_NORMAL:
-            m_style = wxFONTSTYLE_NORMAL;
-            break;
-        case PANGO_STYLE_ITALIC:
-            m_style = wxFONTSTYLE_ITALIC;
-            break;
-        case PANGO_STYLE_OBLIQUE:
-            m_style = wxFONTSTYLE_SLANT;
-            break;
-    }
-
-    PangoWeight pango_weight = pango_font_description_get_weight( desc );
+        m_nativeFontInfo.SetPointSize(12);
 
-    if (pango_weight >= 600)
-    {
-        m_weight = wxFONTWEIGHT_BOLD;
-    }
-    else if (pango_weight < 350)
-    {
-        m_weight = wxFONTWEIGHT_LIGHT;
-    }
-    else
-    {
-        m_weight = wxFONTWEIGHT_NORMAL;
-    }
+    m_pointSize = m_nativeFontInfo.GetPointSize();
+    m_style = m_nativeFontInfo.GetStyle();
+    m_weight = m_nativeFontInfo.GetWeight();
 
     if (m_faceName == wxT("monospace"))
     {
@@ -464,10 +434,7 @@ void wxFontRefData::SetPointSize(int pointSize)
     m_pointSize = pointSize;
 
 #ifdef __WXGTK20__
-    // Get native info
-    PangoFontDescription *desc = m_nativeFontInfo.description;
-
-    pango_font_description_set_size( desc, m_pointSize * PANGO_SCALE );
+    m_nativeFontInfo.SetPointSize(pointSize);
 #else
     if ( HasNativeFont() )
     {
@@ -567,7 +534,9 @@ void wxFontRefData::SetFaceName(const wxString& facename)
 {
     m_faceName = facename;
 
-#ifndef __WXGTK20__
+#ifdef __WXGTK20__
+    m_nativeFontInfo.SetFaceName(facename);
+#else
     if ( HasNativeFont() )
     {
         m_nativeFontInfo.SetXFontComponent(wxXLFD_FAMILY, facename);