GetCharWidthFloat function

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

Syntax


BOOL GetCharWidthFloat(
  _In_  HDC    hdc,
  _In_  UINT   iFirstChar,
  _In_  UINT   iLastChar,
  _Out_ PFLOAT pxBuffer
);

Parameters

hdc [in]

A handle to the device context.

iFirstChar [in]

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

iLastChar [in]

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

pxBuffer [out]

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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Wingdi.h (include Windows.h)

Library

Gdi32.lib

DLL

Gdi32.dll

Unicode and ANSI names

GetCharWidthFloatW (Unicode) and GetCharWidthFloatA (ANSI)

See also

Fonts and Text Overview
Font and Text Functions
GetCharABCWidths
GetCharABCWidthsFloat
GetCharWidth32

 

 

Show: