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:
Vadim Zeitlin 2001-08-23 22:08:58 +00:00
parent 56c4a88b3b
commit 4770df95a0
3 changed files with 12 additions and 4 deletions

View File

@ -364,6 +364,11 @@ for filling the shape.
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}
\helpref{DrawText}{wxdcdrawtext}

View File

@ -824,7 +824,9 @@ void MyCanvas::DrawText(wxDC& dc)
dc.DrawText( "This is text", 110, 10 );
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;
dc.SetBackgroundMode(wxTRANSPARENT);

View File

@ -1009,9 +1009,10 @@ void wxDC::DoDrawRotatedText(const wxString& text,
#ifndef __WXMICROWIN__
else
{
// NB: don't take DEFAULT_GUI_FONT because it's not TrueType and so
// can't have non zero orientation/escapement
wxFont font = m_font.Ok() ? m_font : *wxNORMAL_FONT;
// NB: don't take DEFAULT_GUI_FONT (a.k.a. wxSYS_DEFAULT_GUI_FONT)
// because it's not TrueType and so can't have non zero
// orientation/escapement under Win9x
wxFont font = m_font.Ok() ? m_font : *wxSWISS_FONT;
HFONT hfont = (HFONT)font.GetResourceHandle();
LOGFONT lf;
if ( ::GetObject(hfont, sizeof(lf), &lf) == 0 )