fixes for rotated text drawing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -364,6 +364,11 @@ for filling the shape.
|
|||||||
|
|
||||||
Draws the text rotated by {\it angle} degrees.
|
Draws the text rotated by {\it angle} degrees.
|
||||||
|
|
||||||
|
{\bf NB:} Under Win9x only TrueType fonts can be drawn by this function. In
|
||||||
|
particular, a font different from {\tt wxNORMAL\_FONT} should be used as the
|
||||||
|
latter is not a TrueType font. {\tt wxSWISS\_FONT} is an example of a font
|
||||||
|
which is.
|
||||||
|
|
||||||
\wxheading{See also}
|
\wxheading{See also}
|
||||||
|
|
||||||
\helpref{DrawText}{wxdcdrawtext}
|
\helpref{DrawText}{wxdcdrawtext}
|
||||||
|
@@ -824,7 +824,9 @@ void MyCanvas::DrawText(wxDC& dc)
|
|||||||
dc.DrawText( "This is text", 110, 10 );
|
dc.DrawText( "This is text", 110, 10 );
|
||||||
dc.DrawRotatedText( "That is text", 20, 10, -45 );
|
dc.DrawRotatedText( "That is text", 20, 10, -45 );
|
||||||
|
|
||||||
dc.SetFont( *wxNORMAL_FONT );
|
// use wxSWISS_FONT and not wxNORMAL_FONT as the latter can't be rotated
|
||||||
|
// under Win9x (it is not TrueType)
|
||||||
|
dc.SetFont( *wxSWISS_FONT );
|
||||||
|
|
||||||
wxString text;
|
wxString text;
|
||||||
dc.SetBackgroundMode(wxTRANSPARENT);
|
dc.SetBackgroundMode(wxTRANSPARENT);
|
||||||
|
@@ -1009,9 +1009,10 @@ void wxDC::DoDrawRotatedText(const wxString& text,
|
|||||||
#ifndef __WXMICROWIN__
|
#ifndef __WXMICROWIN__
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// NB: don't take DEFAULT_GUI_FONT because it's not TrueType and so
|
// NB: don't take DEFAULT_GUI_FONT (a.k.a. wxSYS_DEFAULT_GUI_FONT)
|
||||||
// can't have non zero orientation/escapement
|
// because it's not TrueType and so can't have non zero
|
||||||
wxFont font = m_font.Ok() ? m_font : *wxNORMAL_FONT;
|
// orientation/escapement under Win9x
|
||||||
|
wxFont font = m_font.Ok() ? m_font : *wxSWISS_FONT;
|
||||||
HFONT hfont = (HFONT)font.GetResourceHandle();
|
HFONT hfont = (HFONT)font.GetResourceHandle();
|
||||||
LOGFONT lf;
|
LOGFONT lf;
|
||||||
if ( ::GetObject(hfont, sizeof(lf), &lf) == 0 )
|
if ( ::GetObject(hfont, sizeof(lf), &lf) == 0 )
|
||||||
|
Reference in New Issue
Block a user