Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CDC::GetCharWidth

Retrieves the widths of individual characters in a consecutive group of characters from the current font, using m_hAttribDC, the input device context.

BOOL GetCharWidth( 
   UINT nFirstChar, 
   UINT nLastChar, 
   LPINT lpBuffer  
) const; 
BOOL GetCharWidth( 
   UINT nFirstChar, 
   UINT nLastChar, 
   float* lpFloatBuffer  
) const;
nFirstChar

Specifies the first character in a consecutive group of characters in the current font.

nLastChar

Specifies the last character in a consecutive group of characters in the current font.

lpBuffer

Points to a buffer that will receive the width values for a consecutive group of characters in the current font.

lpFloatBuffer

Points to a buffer to receive the character widths. The returned widths are in the 32-bit IEEE floating-point format. (The widths are measured along the base line of the characters.)

Nonzero if the function is successful; otherwise 0.

For example, if nFirstChar identifies the letter 'a' and nLastChar identifies the letter 'z', the function retrieves the widths of all lowercase characters.

The function stores the values in the buffer pointed to by lpBuffer. This buffer must be large enough to hold all of the widths. That is, there must be at least 26 entries in the example given.

If a character in the consecutive group of characters does not exist in a particular font, it will be assigned the width value of the default character.

Header: afxwin.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.