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


CharExtra

For a color graphics port (CGrafPort), the CharExtra procedure specifies the
number of pixels by which to widen (or narrow) the glyphs of each nonspace character in a style run.

PROCEDURE CharExtra (extra: Fixed);
extra
The amount (in pixels or decimal fractions of a pixel) to widen (or narrow) each glyph other than the space character in a range of text.
DESCRIPTION
The CharExtra procedure sets the value of the chExtra field of the color graphics
port record. This field contains a number that is in 4.12 fractional notation: four bits of signed integer followed by 12 bits of fraction. The CharExtra procedure uses the value of the txSize field, so you must call TextSize to set the font size of the text before you
call CharExtra.

The initial setting is 0. You can pass a negative value for the extra parameter, but be careful not to narrow glyphs so much that the text is unreadable. The measuring and drawing routines use the value in this field when an application calls them to measure or draw text. The CharExtra procedure is available only for color graphic ports.

SPECIAL CONSIDERATIONS
Do not use CharExtra for script systems that include zero-width characters, such as diacritical marks, because intercharacter space is added to all glyphs, separating the diacritical mark from the glyph of the character. Do not use it for script systems that include contextual forms, such as ligatures or conjunct characters, which would not be represented properly were intercharacter space added to these glyphs. For example, you should not use CharExtra for the Devanagari or Arabic languages, whose text is drawn as connected glyphs, or with the Sonata font because it includes zero-width characters.

The 2-byte script systems use the chExtra field value properly.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996