Search Locate Previous Next Contents

nlMeasure – measure any text

To find the actual size (in points) of a simple text vector or a text string:

     nlMeasure 'Fat cat'
32.328
     'TI,18' nlMeasure 'Hello' 'World'
39.996 45.99

The left argument defaults to the current font, as set by nlFont.

If you use this to determine the best size for table cells, be sure to allow for the ‘cellpadding’ which NewLeaf adds to space cell text away from the vertical gridlines. The algorithm used to compute cell padding is:

2×6˜2——0.4×fontsize © Cell padding

... so you should add this value to the computed width.

See also: nltMeasure


Continue to: nlMetafile – add metafile image
© Copyright Causeway Graphical Systems Ltd 2001