]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/dcclient.cpp
Ran make -f build/autogen.mk
[wxWidgets.git] / src / x11 / dcclient.cpp
index 37b47a4dbfba56cfb27e246f879f004d4ac88e77..0278302b5f56ab272a256c53402bee029a751ecb 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "dcclient.h"
-#endif
-
 #include "wx/dcclient.h"
 #include "wx/dcmemory.h"
 #include "wx/window.h"
@@ -1569,7 +1565,9 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
 
     XSetFont( (Display*) m_display, (GC) m_textGC, xfont->fid );
 #if !wxUSE_NANOX
-    if ((xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
+    // This may be a test for whether the font is 16-bit, but it also
+    // seems to fail for valid 8-bit fonts too.
+    if (1) // (xfont->min_byte1 == 0) && (xfont->max_byte1 == 0))
 #endif
     {
         XDrawString( (Display*) m_display, (Window) m_window,
@@ -1670,13 +1668,11 @@ wxCoord wxWindowDC::GetCharWidth() const
 #if wxUSE_UNICODE
     PangoLayout *layout = pango_layout_new( m_context );
 
-    if (!m_fontdesc)
-    {
-        char *crash = NULL;
-        *crash = 0;
-    }
-
-    pango_layout_set_font_description(layout, m_fontdesc);
+    if (m_fontdesc)
+       pango_layout_set_font_description(layout, m_fontdesc);
+    else
+       pango_layout_set_font_description(layout, this->GetFont().GetNativeFontInfo()->description);
+       
     pango_layout_set_text(layout, "H", 1 );
     int w,h;
     pango_layout_get_pixel_size(layout, &w, &h);
@@ -1706,14 +1702,11 @@ wxCoord wxWindowDC::GetCharHeight() const
 #if wxUSE_UNICODE
     PangoLayout *layout = pango_layout_new( m_context );
 
-    if (!m_fontdesc)
-    {
-        char *crash = NULL;
-        *crash = 0;
-    }
-
-    pango_layout_set_font_description(layout, m_fontdesc);
-
+    if (m_fontdesc)
+       pango_layout_set_font_description(layout, m_fontdesc);
+    else
+       pango_layout_set_font_description(layout, this->GetFont().GetNativeFontInfo()->description);
+       
     pango_layout_set_text(layout, "H", 1 );
     int w,h;
     pango_layout_get_pixel_size(layout, &w, &h);
@@ -1772,14 +1765,10 @@ void wxWindowDC::SetFont( const wxFont &font )
 
     m_font = font;
     
+    return;
+    
 #if wxUSE_UNICODE
-    if (m_font.Ok())
-    {
-        if (m_fontdesc)
-            pango_font_description_free( m_fontdesc );
-
-        m_fontdesc = pango_font_description_copy( m_font.GetNativeFontInfo()->description );
-    }
+    m_fontdesc = font.GetNativeFontInfo()->description;
 #endif
 }