X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4ae1af0588794ab2b46e376ec20f1b1f6b1715d0..d1f024a8de8872ae314b30e0d1b8c8a1b8518c3d:/src/x11/dcclient.cpp?ds=inline diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 1f7200e9cc..8f16fa74e3 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -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" @@ -23,7 +19,7 @@ #include "wx/x11/private.h" -#include +#include "wx/math.h" #if wxUSE_UNICODE #include "glib.h" @@ -1670,13 +1666,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 +1700,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); @@ -1771,6 +1762,12 @@ void wxWindowDC::SetFont( const wxFont &font ) wxCHECK_RET( Ok(), wxT("invalid dc") ); m_font = font; + + return; + +#if wxUSE_UNICODE + m_fontdesc = font.GetNativeFontInfo()->description; +#endif } void wxWindowDC::SetPen( const wxPen &pen )