]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/font.cpp
DoGetBestSize fix, the lbWidth was not getting updated because of a
[wxWidgets.git] / src / x11 / font.cpp
index 675acc54bdd61665732c7cca70612e844bede49f..32ebc2ac8531de13dd480e0945118f67b259a675 100644 (file)
@@ -35,9 +35,9 @@
     #include "wx/string.h"
     #include "wx/utils.h"       // for wxGetDisplay()
     #include "wx/settings.h"
     #include "wx/string.h"
     #include "wx/utils.h"       // for wxGetDisplay()
     #include "wx/settings.h"
+    #include "wx/gdicmn.h"
 #endif
 
 #endif
 
-#include "wx/gdicmn.h"
 #include "wx/fontutil.h"    // for wxNativeFontInfo
 #include "wx/tokenzr.h"
 
 #include "wx/fontutil.h"    // for wxNativeFontInfo
 #include "wx/tokenzr.h"
 
@@ -65,7 +65,7 @@ class wxXFont : public wxObject
 {
 public:
     wxXFont();
 {
 public:
     wxXFont();
-    ~wxXFont();
+    virtual ~wxXFont();
 
     WXFontStructPtr     m_fontStruct;   // XFontStruct
     WXDisplay*          m_display;      // XDisplay
 
     WXFontStructPtr     m_fontStruct;   // XFontStruct
     WXDisplay*          m_display;      // XDisplay
@@ -164,6 +164,8 @@ protected:
 #endif
 };
 
 #endif
 };
 
+#define M_FONTDATA ((wxFontRefData*)m_refData)
+
 // ----------------------------------------------------------------------------
 // wxFontRefData
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // wxFontRefData
 // ----------------------------------------------------------------------------
@@ -243,23 +245,27 @@ void wxFontRefData::InitFromNative()
             break;
     }
 
             break;
     }
 
+// Not defined in some Pango versions
+#define wxPANGO_WEIGHT_SEMIBOLD 600
+
     switch (pango_font_description_get_weight( desc ))
     {
         case PANGO_WEIGHT_ULTRALIGHT:
     switch (pango_font_description_get_weight( desc ))
     {
         case PANGO_WEIGHT_ULTRALIGHT:
-            m_weight = wxFONTWEIGHT_LIGHT;
-            break;
         case PANGO_WEIGHT_LIGHT:
             m_weight = wxFONTWEIGHT_LIGHT;
             break;
         case PANGO_WEIGHT_LIGHT:
             m_weight = wxFONTWEIGHT_LIGHT;
             break;
+
+        default:
+            wxFAIL_MSG(_T("unknown Pango font weight"));
+            // fall through
+
         case PANGO_WEIGHT_NORMAL:
             m_weight = wxFONTWEIGHT_NORMAL;
             break;
         case PANGO_WEIGHT_NORMAL:
             m_weight = wxFONTWEIGHT_NORMAL;
             break;
+
+        case wxPANGO_WEIGHT_SEMIBOLD:
         case PANGO_WEIGHT_BOLD:
         case PANGO_WEIGHT_BOLD:
-            m_weight = wxFONTWEIGHT_BOLD;
-            break;
         case PANGO_WEIGHT_ULTRABOLD:
         case PANGO_WEIGHT_ULTRABOLD:
-            m_weight = wxFONTWEIGHT_BOLD;
-            break;
         case PANGO_WEIGHT_HEAVY:
             m_weight = wxFONTWEIGHT_BOLD;
             break;
         case PANGO_WEIGHT_HEAVY:
             m_weight = wxFONTWEIGHT_BOLD;
             break;