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 / Drawing Text


DrawChar

The DrawChar procedure draws the glyph for the specified character at the current pen location in the current graphics port.

PROCEDURE DrawChar (ch: CHAR);
ch
The character code whose glyph is to be drawn.
DESCRIPTION
The DrawChar procedure draws a single character's glyph and then advances the pen by the width of the glyph. If the glyph isn't in the font, the font's missing symbol is drawn. For more information, see "Individual Glyphs" on page 3-28.

Note
If you're drawing more than one character, it's faster to make
one DrawString or DrawText call rather than a series of
DrawChar calls.
SPECIAL CONSIDERATIONS
Because it takes a single-byte value as the ch parameter, DrawChar works only for 1-byte script systems. If you want to draw the glyph of a single character in a 2-byte script, call either DrawText, DrawString, or DrawJustified.

However, a series of calls to DrawChar in a 1-byte complex script system can give incorrect results because a text string is not always a simple concatenation of a series
of characters. In a contextual script, two different glyphs may be used to represent a single character in its contextual form and alone. To draw a sequence of text in a 1-byte complex script system, use DrawText, DrawString, or DrawJustified instead.

However, for 1-byte complex scripts, you can use DrawChar for special purposes, such as to include the isolated glyph of a character in a book's index, for example, to show a single glyph as it exists apart from contextual transformations.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996