textWidth()

Synopsis

Returns the width of a box that completely encloses the given text. This function should only be called in a context which includes InkTextMixin. It makes many hidden references to values such as charHeight, which greatly influence the result. This function is used by the Text designs, and their width attribute is the standard way to access this dimension.

Syntax

textWidth ( text As String, _
            font As String ) As Number 
Argument Type Description
text string The text string to be measured.
font string The name of the font on the target system (currently ignored).

Example 1

Intent >textWidth("10.0R", "Ignored") 
--> 3.723 

The answer is a function of the current settings of the InkTextMixin attributes, which must be accessible to the context in which this function is evaluated.