Ciampo
March 29th, 1999, 07:39 AM
Hi,
I want to display some text in a view with circle an lines.
But my text has to be diplayed inclined or tiltled (I don't know the real word) that is to say on a line with an angle of 45° or 62° or any ° from the horizontal.
The CDC class doesn't seem to give me the solution even using its DrawState Methods.
does anyone have the solution ?
Thanks
Ciampo
Daren Chandisingh
March 29th, 1999, 08:01 AM
When you create a font (CreateFont or CFont::CreateFont) one of the paramters you can specify is the "escapement" of the font. The on-line help says:
---
nEscapement
Specifies the angle (in 0.1-degree units) between the escapement vector and the x-axis of the display surface. The escapement vector is the line through the origins of the first and last characters on a line. The angle is measured counterclockwise from the x-axis.
---
So you can have text at 45 degrees by setting escapement to 450.
April 6th, 1999, 11:32 AM
Thank you, daren
I ve tried this in my view
void CTestrView::OnDraw(CDC* pDC)
{
CTestrDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CFont myFont;
if (!myFont.CreateFont( 32, 10, 450, 450, 1000,
0, 0, 0, 0, OUT_DEVICE_PRECIS, CLIP_TT_ALWAYS,
PROOF_QUALITY, DEFAULT_PITCH, NULL ))
MessageBox ("Erreur de creation de Fonte", "", MB_OK);
SetFont( &myFont, TRUE);
pDC->TextOut (120, 120, (LPCTSTR) "toto", 4);
}
Toto is written but not inclined (tiled).
Is there any special option to use at the font cration or does the matter comes from the SetFont call
thanks
Ciampo
April 6th, 1999, 01:43 PM
Hi.
You probably need to select the font into the DC, via pDC->SelectObject().
Yours,
Wes
Shahzad
April 6th, 1999, 02:09 PM
Can we display tilted text on a dialog probably by using label control or any other way through code.