Important: The information in this document is obsolete and should not be used for new development.
StringWidth
TheStringWidth
function returns the length in pixels of the specified Pascal string.
FUNCTION StringWidth (s: Str255): Integer;
s
- A pascal string containing the text to be measured.
DESCRIPTION
You should not callStringWidth
to measure scaled text. AlthoughStringWidth
takes into account the graphics port record settings, it does not accept scaling parameters, and therefore cannot determine the correct text width result for text to be drawn using scaling factor parameters. For more information, see "Pascal Strings" on page 3-28.If you specify values in the graphics port
spExtra
orchExtra
fields to change the width of space or nonspace characters,StringWidth
takes these values into account.The
StringWidth
function works with all script systems.