CDC::GetTabbedTextExtent

Syntax

CSize GetTabbedTextExtent( const char FAR* lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions ) const;

Parameters

lpString

Points to a character string. You can also pass a CString object for this parameter.

nCount

Specifies the number of characters in the string.

nTabPositions

Specifies the number of tab-stop positions in the array pointed to by lpnTabStopPositions.

lpnTabStopPositions

Points to an array of integers containing the tab-stop positions in pixels. The tab stops must be sorted in increasing order; back tabs are not allowed.

Remarks

Computes the width and height of a character string. If the string contains one or more tab characters, the width of the string is based upon the tab stops specified by lpnTabStopPositions. The function uses the currently selected font to compute the dimensions of the string.

Since some devices do not place characters in regular cell arrays (that is, they kern the characters), the sum of the extents of the characters in a string may not be equal to the extent of the string.

If nTabPositions is 0 and lpnTabStopPositions is NULL, tabs are expanded to eight average character widths.

If nTabPositions is 1, the tab stops will be separated by the distance specified by the first value in the array to which lpnTabStopPositions points.

If lpnTabStopPositions points to more than a single value, a tab stop is set for each value in the array, up to the number specified by nTabPositions.

Return Value

The dimensions of the string (in logical units).

See Also

CDC::GetTextExtent, CDC::TabbedTextOut, ::GetTabbedTextExtent