Name

strlen -- determine the width of a string

Synopsis

float strlen ( string string[, array params[, int tabwidth]] )

Description

This function returns the width (in PDF units) that the specified string will be when painted to the page.

The only parameters that affect the calculation are height and font. Other parameters will be ignored, so the same parameter array used to calculate the width can be used to place the string. If unspecified, default values are used.

The optional parameter tabwidth is used to determine how to calculate the width of tab characters (ascii 0x09). It specifies the number of spaces wide that a tab should be. The default is 4.

Examples

See Also

History

The strlen function was added in version 1.13.

Bugs

The processing of fixed-width (Courier) fonts is approximately twice as fast as variable-width fonts (Helvetica, Times).