GetCharWidthFloatA function (wingdi.h)

The GetCharWidthFloat function retrieves the fractional widths of consecutive characters in a specified range from the current font.

Syntax

BOOL GetCharWidthFloatA(
  [in]  HDC    hdc,
  [in]  UINT   iFirst,
  [in]  UINT   iLast,
  [out] PFLOAT lpBuffer
);

Parameters

[in] hdc

A handle to the device context.

[in] iFirst

The code point of the first character in the group of consecutive characters.

[in] iLast

The code point of the last character in the group of consecutive characters.

[out] lpBuffer

A pointer to a buffer that receives the character widths, in logical units.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

The returned widths are in the 32-bit IEEE floating-point format. (The widths are measured along the base line of the characters.)

If the iFirstChar parameter specifies the letter a and the iLastChar parameter specifies the letter z, GetCharWidthFloat retrieves the widths of all lowercase characters.

If a character does not exist in the current font, it is assigned the width of the default character.

Note

The wingdi.h header defines GetCharWidthFloat as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h (include Windows.h)
Library Gdi32.lib
DLL Gdi32.dll

See also

Font and Text Functions

Fonts and Text Overview

GetCharABCWidths

GetCharABCWidthsFloat

GetCharWidth32