Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 3 - QuickDraw Text / QuickDraw Text Reference
Routines / Measuring Text


StringWidth

The StringWidth 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 call StringWidth to measure scaled text. Although StringWidth 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 or chExtra fields to change the width of space or nonspace characters, StringWidth takes these values into account.

The StringWidth function works with all script systems.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996