Important: The information in this document is obsolete and should not be used for new development.
DrawChar
TheDrawCharprocedure 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
TheDrawCharprocedure 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
oneDrawStringorDrawTextcall rather than a series ofDrawCharcalls.![]()
SPECIAL CONSIDERATIONS
Because it takes a single-byte value as thechparameter,DrawCharworks only for 1-byte script systems. If you want to draw the glyph of a single character in a 2-byte script, call eitherDrawText,DrawString, orDrawJustified.However, a series of calls to
DrawCharin 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, useDrawText,DrawString, orDrawJustifiedinstead.However, for 1-byte complex scripts, you can use
DrawCharfor 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.