GetCharABCWidthsFloat

  BOOL GetCharABCWidthsFloat(hdc, iFirstChar, iLastChar, lpABCF)    
  HDC hdc; /* device-context handle */
  UINT iFirstChar; /* first character in range to query */
  UINT iLastChar; /* last character in range to query */
  LPABCFLOAT lpABCF; /* pointer to ABC structure for widths */

The GetCharABCWidthsFloat function retrieves the widths of consecutive characters in a specified range from the current font. The widths are returned in logical units. The function comes in two flavors, ANSI and Unicode. Unlike GetCharABCWidths, which also returns the “ABC” widths in logical units and only works with true type fonts and does the rounding of the “ABC” widths to a nearest integer, GetCharABCWidthsFloat is more general and returns the correct “ABC” widths regardless of the type of font that is selected in DC. Returned values are in an IEEE floating point format. Notice that the returned “ABC” values may be non integer even if the corresponding values in the device space are integer, if the current world to device transform is not identity.

Parameters

hdc

Identifies the device context.

iFirstChar

In the Ansi or Unicode version of the call iFirstChar represents the Ansi or Unicode code point of the first character respectively in the contiguous range of characters for which “ABC” widths are sought.

iLastChar

In the Ansi or Unicode version of the call iLastChar represents the Ansi or Unicode code point of the last character in the contiguous range respetcively. This range is inclusive. An error is returned if iLastChar precedes iFirstChar.

lpABCF

Points to an application supplied buffer with an array of ABCFLOAT structures that receive the character widths when the function returns. The ABCFLOAT structure has the following format:

typedef struct _ABCFLOAT { /* abcf */

FLOAT abcfA;

FLOAT abcfB;

FLOAT abcfC;

} ABCFLOAT, *PABCFLOAT, NEAR *NPABCFLOAT, FAR *LPABCFLOAT;

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.

Comments

“A” spacing is the distance that is added to the current position before placing the glyph. “B” spacing is the width of the black part of the glyph. “C” spacing is added to the current position to account for the white space to the right of the glyph. The total advanced width is given by A+B+C.

The “ABC” spaces are measured along character baseline of the selected font.

The ABC widths of the default character are used for characters that are outside the range of the currently selected font.

See Also

GetCharWidth, GetCharWidthFloat, GetCharABCWidths,