BOOL GetCharWidth(hdc, iFirstChar, iLastChar, lpBuffer) | |||||
HDC hdc; | /* device-context handle | */ | |||
UINT iFirstChar; | /* first character in range to query | */ | |||
UINT iLastChar; | /* last character in range to query | */ | |||
LPINT lpBuffer; | /* address of buffer for widths | */ |
The GetCharWidth function retrieves the widths of individual characters, in logical coordinates, for a consecutive group of characters in the current font. For example, if iFirstChar identifies the letter a and iLastChar identifies the letter z, GetCharWidth retrieves the widths of all lowercase characters. The function stores the values in the buffer pointed to by lpBuffer.
hdc
Identifies the device context.
iFirstChar
Specifies the first character.
iLastChar
Specifies the last character, which must not precede iFirstChar. This range is inclusive.
lpBuffer
Points to a buffer that will receive the widths.
The return value is TRUE if the function is successful. Otherwise, it is FALSE.
If a character does not exist in the current font, it will be assigned the width of the default character.