Re: CDC::TextOut (how to write the text vertically?)
- From: "xrxst32" <martin.dangelmeyr@xxxxxxx>
- Date: 9 Aug 2006 00:38:45 -0700
xrxst32 wrote:
hamishd wrote:
SetFont sets the font in the current window, but that has nothing to do with the pMemDC;
you would have to do a SelectObject of the font into the DC. Note also that, having done
the SetFont, you will lose that font when you leave scope, so the SetFont is now erroneous
because it has set the handle of a soon-to-be-nonexistent font.
I'm actually just printing (as in a printer), so not sure that losing
the font matters at all. Anyway, the below is "working", in the sense I
can change fonts, size etc, but that damn orientation, which is what i
wanted all along is not doing anything! Text is always 0degrees.
LOGFONT lfNew;
ZeroMemory (&lfNew, sizeof(LOGFONT));
lfNew.lfHeight = 150;
lfNew.lfWeight = FW_NORMAL;
lfNew.lfOrientation = 450;
strcpy(lfNew.lfFaceName, "MS Sans Serif");
CFont Font;
Font.CreateFontIndirect(&lfNew);
pMEMDC->SelectObject(&Font);
pMEMDC->TextOut(XLOC, YLOC, "testing");
another thing from MSDN:
....
nEscapement
Specifies the angle, in tenths of degrees, between the escapement
vector and the x-axis of the device. The escapement vector is parallel
to the base line of a row of text.
Windows NT: When the graphics mode is set to GM_ADVANCED, you can
specify the escapement angle of the string independently of the
orientation angle of the string's characters.
When the graphics mode is set to GM_COMPATIBLE, nEscapement specifies
both the escapement and orientation. You should set nEscapement and
nOrientation to the same value.
Windows 95: The nEscapement parameter specifies both the escapement and
orientation. You should set nEscapement and nOrientation to the same
value.
nOrientation
Specifies the angle, in tenths of degrees, between each character's
base line and the x-axis of the device.
....
so better specify the same value (450) for nEscapement and
nOrientation.
regards,
martin
.
- References:
- CDC::TextOut (how to write the text vertically?)
- From: hamishd
- Re: CDC::TextOut (how to write the text vertically?)
- From: David Ching
- Re: CDC::TextOut (how to write the text vertically?)
- From: hamishd
- Re: CDC::TextOut (how to write the text vertically?)
- From: Joseph M . Newcomer
- Re: CDC::TextOut (how to write the text vertically?)
- From: hamishd
- Re: CDC::TextOut (how to write the text vertically?)
- From: xrxst32
- CDC::TextOut (how to write the text vertically?)
- Prev by Date: Re: CDC::TextOut (how to write the text vertically?)
- Next by Date: Re: unicode apps?
- Previous by thread: Re: CDC::TextOut (how to write the text vertically?)
- Next by thread: Re: CDC::TextOut (how to write the text vertically?)
- Index(es):
Relevant Pages
|