Hi, I want to use a system font in a control, except I need to draw it at an angle. I'm using the following code:
    invoke GetStockObject,DEFAULT_GUI_FONT

invoke GetObject,eax,SIZEOF LOGFONT,ADDR lf
mov lf.lfOrientation,200
invoke CreateFontIndirect,ADDR lf
invoke SelectObject,[ebx].BackDC,eax

Where lf is a LOGFONT structure.
However, I end up just drawing the normal system font with 0 orientation. Any suggestions? :?
Thank you
Posted on 2004-09-02 07:51:13 by adamjjackson
Hi..

I think that normally


DEFAULT_GUI_FONT
Windows 95 only: Default font for user interface objects such as menus and dialog boxes.




ANSI_FIXED_FONT
Windows fixed-pitch (monospace) system font.
ANSI_VAR_FONT
Windows variable-pitch (proportional space) system font.
DEVICE_DEFAULT_FONT
Windows NT only: Device-dependent font.
DEFAULT_GUI_FONT
Windows 95 only: Default font for user interface objects such as menus and dialog boxes.
OEM_FIXED_FONT
Original equipment manufacturer (OEM) dependent fixed-pitch (monospace) font.
SYSTEM_FONT
System font. By default, Windows uses the system font to draw menus, dialog box controls, and text. In Windows versions 3.0 and later, the system font is a proportionally spaced font; earlier versions of Windows used a monospace system font.
SYSTEM_FIXED_FONT
Fixed-pitch (monospace) system font used in Windows versions earlier than 3.0. This stock object is provided for compatibility with earlier versions of Windows.


It is for that it doesn't work...

Gerard--
----------
Posted on 2004-09-02 08:20:15 by gerard
Hmmm, thanks, but it doesn't say that in my copy of the SDK.
Also, if it was win95 only, then surely it would fail? However I do get the DEFAULT_GUI_FONT, I do get the LOGFONT structure to fill, and CreateFontIndirect returns with no error - but the font has not been rotated. If for instance I change the weight, it works. Just not the orientation, any other suggestions?

The DrawText function supports only fonts whose escapement and orientation are both zero.
However, it still doesn't work with TextOut...]
Posted on 2004-09-02 15:26:22 by adamjjackson
I think you have to play around with LOGFONT.lfEscapement:

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/2000/XP: 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, lfEscapement specifies both the escapement and orientation. You should set lfEscapement and lfOrientation to the same value.

Windows 95/98/Me: The lfEscapement member specifies both the escapement and orientation. You should set lfEscapement and lfOrientation to the same value.


Plus here is a link to a MFC(yuk) tutorial dealing with this but you should be able to get the just of it
http://pomelo.ivia.es/mecanizacion/www/vcpp/section13/section13.html

PS: Why does quotes have sooo much space between them?

Black iCE
Posted on 2004-09-03 02:07:01 by Black iCE
It works, thanks :) It's on the line above in the SDK, how did I miss that?! :stupid:

Not sure why they do, the quotes always have had a lot of space haven't they? Ask Hiroshimator!

Thanks again :oops:
Posted on 2004-09-03 03:39:05 by adamjjackson
No Problem - just glad it works :-D Anyway it is because all of this GM_COMPATIBLE crap that there are two entries for text rotation.

Suppose GM_ADVANCED is for my friend that works with areal maps of the subburbs... giving text a depth feeling to.(not to shure about the last murmur). :wink:
Posted on 2004-09-03 03:58:13 by Black iCE