Creating a Logical Font with a Nonzero lfOrientation

Last reviewed: November 2, 1995
Article ID: Q104010
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT versions 3.1, 3.5, and 3.51
    

SUMMARY

To create a font that writes in a direction other than left to right, an application should specify a nonzero lfEscapement in the LOGFONT structure that is passed to CreateFontIndirect(). This method works under Windows NT regardless of the graphics mode of the device context.

To create a font where the characters themselves are rotated, the application should specify a nonzero lfOrientation in the LOGFONT structure that is passed to CreateFontIndirect(). However, this setting is ignored in Windows NT unless the graphics mode is set to GM_ADVANCED.

Therefore, to successfully create a logical font with a nonzero lfOrientation, use

   SetGraphicsMode( hDC, GM_ADVANCED )

to set the graphics mode of the device context to GM_ADVANCED.

MORE INFORMATION

The TTFONTS sample program is a good way to quickly and easily see the effects of the lfEscapement and lfOrientation fields. However, TTFONTS does not set the graphics mode of its test window HDC to GM_ADVANCED. As a result, the lfOrientation field apparently is ignored. It is easy to modify the DISPLAY.C module of TTFONTS in order to set the graphics mode of the window HDC to GM_ADVANCED.


Additional reference words: 3.10 3.50
KBCategory: kbgraphic
KBSubcategory: GdiFnt


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.