textHeight()

Synopsis

Returns the height 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 Height attribute is the standard way to access this dimension. Note that TextHeight and charHeight are not always the same.

Syntax

textHeight ( text As String, _
             height As Number ) As Number 
Argument Type Description
Text string The string to be measured.
height number The nominal "charHeight" of the text (currently ignored).

Example 1

Intent >textHeight("aaa", 42) 
--> 1.004 

This was evaluated in a context where charHeight was 1.0. The slight error is typical of text functions, and is probably due to the thickness of the stroke, but note the result below.

Example 2

Intent >textHeight("AAA", 42) 
--> 1.004 

This was evaluated in the same context as above. Note that larger, upper-case characters do not seem to make a difference.