Windows 3.1 Device Drivers (ddag31qh.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GetCharWidth
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
WORD GetCharWidth(lpDestDev, lpBuffer, wFirstChar, wLastChar, lpFontInfo,
                  lpDrawMode, lpFontTrans)
LPPDEVICE lpDestDev;
LPWORD lpBuffer;
WORD wFirstChar;
WORD wLastChar;
LPFONTINFO lpFontInfo;
LPDRAWMODE lpDrawMode;
LPTEXTXFORM lpFontTrans;
 
The GetCharWidth function computes the widths of each character within the
given range, and copies the widths to the buffer pointed to by the lpBuffer
parameter. 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.
 
Parameter    Description
────────────────────────────────────────────────────────────────────────────
 
 
lpDestDev    Points to a PDEVICE or PBITMAP structure specifying the
             destination device or bitmap.
 
lpBuffer     Points to the buffer to receive 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   Specifies the first character of the range.
 
wLastChar    Specifies the last character of the range.
 
lpFontInfo   Points to a FONTINFO structure that specifies the physical font
             from which to compute the character widths.
 
lpDrawMode   Points to 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  Points to 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.
 
Return Value
 
The return value is 1 if the function is successful. Otherwise, it is zero
if there is an error.
 
Comments
 
The export ordinal for this function is 15.
 
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
 
ExtTextOut, GDIINFO