ExtTextOut

The ExtTextOut function has been simplified in Windows 95 so that display drivers contains less code. The meaning of some of the parameters and how the driver should draw the text has changed slightly from previous versions of Windows.

If either the ETO_BYTE_PACKED or ETO_BIT_PACKED wOptions flag is set, the font pointed to by the lpFontInfo parameter is in the new format defined by the NewFontSeg structure. These flags specify the format of the glyph header and the glyphs as either byte-packed or bit-packed. If neither of these flags is set, lpFontInfo points to the old font format defined by the FONTINFO structure.

Both the old and new font formats have been adapted for large (two bytes) character set fonts. If the font used in ExtTextOut is a large font, for old style fonts, the PF_GLYPH_INDEX bit is set in the dfType field of the FONTINFO structure pointed to by the lpFontInfo parameter. For large fonts in both old and new formats, the ETO_GLYPH_INDEX bit in the wOptions parameter of ExtTextOut is set.

When ExtTextOut is passed a font in the old format and the flag ETO_GLYPH_INDEX is set, the lpString parameter points to a word array of glyph indexes specifying which glyphs to draw. Invalid characters will point to the default character so no range checking is required in the driver. Each index can be used directly and does not require subtraction of the first character index.

When ExtTextOut is passed a font in the new format, the lpString parameter points to an array of glyph indexes, not character codes. Glyph indexes are simple indexes in the nfGlyphOffset and nfAWTable arrays and are not language specific. Using glyph indexes allows the same driver to be used for all languages. The ETO_GLYPH_INDEX flag for the ExtTextOut wOptions parameter indicates whether the glyph index array is a BYTE array or WORD array. If this flag is set, the glyph index array is a WORD array; otherwise it is a BYTE array.

A display driver declares itself as Glyph Index capable by setting the C1_GLYPH_INDEX bit in the dpCaps1 field of GDIINFO. If the driver sets just the C1_GLYPH_INDEX flag and not C1_BIT_PACKED or C1_BYTE_PACKED, bitmap fonts are passed to the driver with the ETO_GLYPH_INDEX flag clear and TrueType fonts are passed to the driver with the ETO_GLYPH_INDEX flag set. If the driver does not set C1_GLYPH_INDEX, C1_BIT_PACKED, or C1_BYTE_PACKED, the fonts are always in the old font format and lpString always points to a byte array where the index into the character offset table must be computed by subtracting the index of the first character from lpString[ i ].

The ExtTextOut parameter lpOpaqueRect points to a NULL terminated list of rectangles. The driver should opaque all of the rectangles given in this list if lpOpaqueRect is non-NULL. The lpTextXform parameter points to a rectangle structure defining the text bounding box of the string. In opaque mode, the lpTextXform rectangle is included in the list of rectangles pointed to by lpOpaqueRect.

Display drivers should draw the rectangles specified in lpOpaqueRect using the background color specified in the lpDrawMode parameter. Next, the driver should draw the text transparently on top using the text color specified in lpDrawMode. The driver should clip all output to the rectangle specified by the lpClipRect parameter. The driver does not have to check for the flags ETO_OPAQUE and ETO_CLIPPED.

In Windows 95, the wDestXOrg and wDestYOrg parameters point to the origin of the first glyph, not the upper left corner of the text bounding box as it did in previous versions of Windows.

The driver no longer needs to process any of the fields in the DRAWMODE structure to determine character placement. All special spacing information is computed in GDI and passed to the driver in the ExtTextOut lpDx parameter. The lpDx parameter points to an array of words that defines the number of pixels to advance after drawing each character. The first character advances by the first value in the lpDx array, the second character advances by the second value in the lpDx array and so on.

If no special spacing is necessary, the lpDx parameter will be NULL, indicating to the driver that it should use the nfAWTable array in the NewFontSeg structure to move to the next glyph origin. This table defines the number of pixels to advance by for each glyph. This table is indexed by the glyph index.

See also NewFontSeg, SMALLROWGLYPH, LARGEROWGLYPH, SMALLBITGLYPH, LARGEBITGLYPH