Re: CDC::TextOut (how to write the text vertically?)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




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

.



Relevant Pages

  • Re: IE button size wont change
    ... [[Specifies whether text descriptions of the toolbar buttons appear in the ... To show only icons on the toolbar, ... Ignore font styles specified on web pages ...
    (microsoft.public.windowsxp.general)
  • Re: Display problem
    ... [[Specifies whether you want Internet Explorer to always use the color ... Web page chooses different colors for text and background, the settings you ... Ignore font styles specified on Web pages ...
    (microsoft.public.windowsxp.general)
  • Re: IC v. Employee question
    ... >Actually, the client specifies the font, with my accounts, and the subs ... >type in that specified font. ... I don't think that is control. ...
    (sci.med.transcription)
  • Re: Domain Name Dispute / Query
    ... Only if the trade mark application specifies those characteristics. ... that are simply words, with no font, style or colour specified. ... > Wonder how they've managed to survive two multinationals who would ...
    (uk.legal)