Windows Dev Center

EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

GetCharWidthI function

The GetCharWidthI function retrieves the widths, in logical coordinates, of consecutive glyph indices in a specified range from the current font.

Syntax


BOOL GetCharWidthI(
  _In_   HDC    hdc,
  _In_   UINT   giFirst,
  _In_   UINT   cgi,
  _In_   LPWORD pgi,
  _Out_  LPINT  lpBuffer
);

Parameters

hdc [in]

A handle to the device context.

giFirst [in]

The first glyph index in the group of consecutive glyph indices.

cgi [in]

The number of glyph indices.

pgi [in]

A pointer to an array of glyph indices. If this parameter is not NULL, it is used instead of the giFirst parameter.

lpBuffer [out]

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

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Remarks

The GetCharWidthI function processes a consecutive glyph indices if the pgi parameter is NULL with the giFirst parameter indicating the first glyph index to process and the cgi parameter indicating how many glyph indices to process. Otherwise the GetCharWidthI function processes the array of glyph indices pointed to by the pgi parameter with the cgi parameter indicating how many glyph indices to process.

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

See also

Fonts and Text Overview
Font and Text Functions
GetCharABCWidths
GetCharABCWidthsFloat
GetCharWidth32
GetCharWidthFloat

 

 

Ajouts de la communauté

Afficher:
© 2015 Microsoft