// 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"
#include "wx/x11/private.h"
-#include <math.h>
+#include "wx/math.h"
#if wxUSE_UNICODE
#include "glib.h"
#include "pango/pangox.h"
-#include "pango/pangoxft.h"
+#ifdef HAVE_PANGO_XFT
+ #include "pango/pangoxft.h"
+#endif
#include "pango_x.cpp"
#endif
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,
#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);
#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);
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 )