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 / Setting Text Characteristics


SpaceExtra

The SpaceExtra procedure specifies the number of pixels by which to widen
(or narrow) each space in a style run to be drawn in the current graphics port.

PROCEDURE SpaceExtra (extra: Fixed);
extra
The amount (in pixels or binary fractions of a pixel) to widen (or narrow) each space in a style run on a line.
DESCRIPTION
The SpaceExtra procedure sets the value of the extra space (spExtra) field in the current graphics port record. The initial setting is 0. You can pass a negative value for the extra parameter, but be careful not to narrow spaces so much that the text is unreadable. The value you specify is added to the width of each space character in the style run. For those script systems that do not use spaces, any value set in the extra space field is ignored. For those script systems that use spaces as delimiters, if you do not want to justify a line of text using DrawJustified, you can use the SpaceExtra procedure to set a fixed number of pixels to be added to each space character, then call DrawText or DrawString.

When you use the justification routines (MeasureJustified, DrawJustified) to measure or draw justified text, they temporarily reset the extra space value. They add to the current value of the field, if any, the amount of extra space to be added to space characters in the specified text in order to justify the text, based on calculations that take into account the slop value for the range of text and all of the text characteristics. On exit, these routines restore the original value.

For more information about SpaceExtra, see "Changing the Width of Characters" on page 3-22.

SPECIAL CONSIDERATIONS
For a color graphics port (CGrafPort), you can use SpaceExtra by itself or in conjunction with the CharExtra procedure to format a line of text in the 1-byte
simple or 2-byte script systems. You should not use CharExtra for 1-byte complex script systems.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996