GetCharWidth


WORD GetCharWidth(LPPDEVICE lpDestDev, LPWORD lpBuffer, 
    WORD wFirstChar, WORD wLastChar, LPFONTINFO lpFontInfo, 
    LPDRAWMODE lpDrawMode, LPTEXTXFORM lpFontTrans);

Computes the widths of each character within the given range, and copies the widths to the buffer pointed to by the lpBuffer parameter.

lpDestDev

Address of a PDEVICE or PBITMAP structure that specifies the destination device or bitmap.

lpBuffer

Address of the buffer that receives the character widths. The buffer must be an array of 16-bit elements. There must be one element for each character in the range.

wFirstChar and wLastChar

First and last characters of the range.

lpFontInfo

Address of a FONTINFO structure that specifies the physical font from which to compute the character widths.

lpDrawMode

Address of a DRAWMODE structure that specifies the current text color, background mode, background color, text justification, and character spacing that may need to be applied to the font to compute a character width.

lpFontTrans

Address of a TEXTXFORM structure that specifies the any font transformations, such as scaling and italicizing, that may need to be applied to the font to compute a character width.

The export ordinal for this function is 15.

GDI calls this function when an application calls the GetCharWidth function (GDI.350).

A graphics driver must export the GetCharWidth function if the RC_GDI20_OUTPUT value is set in the dpRaster member of the driver's GDIINFO structure.

The function assigns the default character to characters outside of the font's range.

GetCharWidth is an optional function for printers, but highly recommended.

See also PDEVICE, PBITMAP, FONTINFO, DRAWMODE, TEXTXFORM