Important: The information in this document is obsolete and should not be used for new development.
StringWidth
TheStringWidthfunction 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 callStringWidthto measure scaled text. AlthoughStringWidthtakes 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
spExtraorchExtrafields to change the width of space or nonspace characters,StringWidthtakes these values into account.The
StringWidthfunction works with all script systems.