From: Robert Roebling Date: Wed, 17 Nov 2004 21:57:16 +0000 (+0000) Subject: Start for Pango 1.6 based text rotation. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c87471501330257c6809c6493bc9f6e1d53bdf88 Start for Pango 1.6 based text rotation. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30595 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 537499b4dd..e295215def 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1614,6 +1614,22 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, if (!m_window) return; +#if GTK_CHECK_VERSION(2,4,0) + + // This code only rotates each individual glyph. Someone + // will have to look up the right way to do this... RR + + PangoMatrix matrix = PANGO_MATRIX_INIT; + pango_matrix_rotate( &matrix, angle ); + + pango_context_set_matrix( m_context, &matrix ); + + DoDrawText( text, x, y ); + + pango_context_set_matrix( m_context, NULL ); + +#else + wxCoord w; wxCoord h; @@ -1720,6 +1736,7 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, // update the bounding box CalcBoundingBox(x + minX, y + minY); CalcBoundingBox(x + maxX, y + maxY); +#endif // GTK24 } void wxWindowDC::DoGetTextExtent(const wxString &string, diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 537499b4dd..e295215def 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1614,6 +1614,22 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, if (!m_window) return; +#if GTK_CHECK_VERSION(2,4,0) + + // This code only rotates each individual glyph. Someone + // will have to look up the right way to do this... RR + + PangoMatrix matrix = PANGO_MATRIX_INIT; + pango_matrix_rotate( &matrix, angle ); + + pango_context_set_matrix( m_context, &matrix ); + + DoDrawText( text, x, y ); + + pango_context_set_matrix( m_context, NULL ); + +#else + wxCoord w; wxCoord h; @@ -1720,6 +1736,7 @@ void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, // update the bounding box CalcBoundingBox(x + minX, y + minY); CalcBoundingBox(x + maxX, y + maxY); +#endif // GTK24 } void wxWindowDC::DoGetTextExtent(const wxString &string,