Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>gettabbedtextextent()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
GetTabbedTextExtent()
Return the width and height of a string using the current font
------------------------------------------------------------------------------

Syntax
GetTabbedTextExtent( <hDC>, <cText>, [ <aTabs> ] )
           -->   nValue or nil

Arguments
<hDC> specifies the device context for a window.

<cText> is the string.

<aTabs> optionally specifies the position of tab stops.  The
default is to use tabs set at 8 times the width of the average
character (for the font currently selected into <hDC>).  If
<aTabs> contains only one element, it is used as the width of
all tabs.

Returns
A numeric value containing both the width and height of the
string relative to the font currently selected in the
specified device context.  NIL is returned if an error is
detected.

Description
This function returns a numeric value containing both the
width and height (in logical units) of the string relative to
the font currently selected in <hDC>.  The width can be
extracted by the C4W_LoWord() function, and the height can be
extracted by C4W_HiWord().

Example
aTabs = { 20, 40, 60, 100, 150 }
nWandH = GetTabbedTextExtent( hDC, cMyString, aTabs )
? C4W_LoWord( nWandH )        // the width

See Also: DrawText() GetDC() TabbedTextOut()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson