Important: The information in this document is obsolete and should not be used for new development.
CharExtra
For a color graphics port (CGrafPort
), theCharExtra
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
TheCharExtra
procedure sets the value of thechExtra
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. TheCharExtra
procedure uses the value of thetxSize
field, so you must callTextSize
to set the font size of the text before you
callCharExtra
.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. TheCharExtra
procedure is available only for color graphic ports.SPECIAL CONSIDERATIONS
Do not useCharExtra
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 useCharExtra
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.