HOWTO: Realize a TrueType Font as a Glyph Index Font

Last reviewed: February 6, 1998
Article ID: Q180584
The information in this article applies to:
  • Windows 95 Device Driver Kit (DDK), version 4.0

SUMMARY

To indicate support for glyph indices for a TrueType font the printer driver has to call EngineRealizeFontExt function to realize the font.

MORE INFORMATION

To support glyph indices, the printer driver has to perform the following steps:

  1. Build the driver with a resource compiler that supports the -40 option.

  2. Set the dpVersion field of the GDIINFO 0x400. This will tell GDI that the driver is a Windows 95 driver.

  3. Set the C1_GLYPH_INDEX ( 0x100 ) flag in the dpCaps1, which is in the GDIINFO structure, to indicate that the driver supports glyph index fonts.

  4. At RealizeObject time, the driver must realize the font using the EngineRealizeFontExt (...) function. This sets the appropriate fields in the FONTINFO structure. The prototype for the EngineRealizeFontExt is:

        WORD FAR PASCAL EngineRealizeFontExt ( HDC,
    
                                               LPLOGFONT,
                                               LPTEXTXFORM,
                                               LPFONTINFO,
                                               WORD   /* flags */  );
    
       Bit 0 of the flags parameter indicates whether to realize the font as a
       glyph index font or old style font (all other bits should be zero).
    
    

  5. Return a value of 0x400 in DeviceCapabilities for DC_VERSION.

To confirm support for the glyph indices, you can check the FONTINFO structure that is passed to the ExtTextOut function. It should have the PF_GLYPH_INDEX ( 0x20) bit set in the dfType field, and the lpString will have the glyph indices for the string to printed.
Keywords          : NTDDKPrnt
Version           : WINDOWS:4.0
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbhowto


================================================================================


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: February 6, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.