Carbon


TXNDrawUnicodeTextBox

Header: MacTextEditor.h Carbon status: Under Evaluation

Draws a Unicode string in the specified rectangle. You do not need to initialize MLTE to use this function.

OSStatus TXNDrawUnicodeTextBox (
    UniChar iText[], 
    UInt32 iLen, 
    Rect *ioBox, 
    ATSUStyle iStyle, 
    TXNTextBoxOptionsData *ioOptions
);
Parameter descriptions
iText

A pointer to the Unicode string you want drawn in the text box. The string should be in UTF-16 format.

iLen

The number of Unicode characters contained in the Unicode string. (Note: this is not the size of the pointer to the Unicode string.)

ioBox

A pointer to the rectangle in which the text is to be displayed. On return, iobox.bottom is updated to reflect the total height of the text. If you use kTXNUseVerticalTextMask, iobox.left is also updated.

iStyle

An ATSUI style to use to display the text. This parameter is optional. If you pass NULL, MLTE takes the style associated with the current graphics port and uses that information to create an ATSUI style.

ioOptions

A pointer to a TXNTextBoxOptionsData structure associated with this text object. This is optional. You can use ioOptions to specify a number of options, such as to display text vertically, justify text, display text flush, and do automatic font fallbacks for text that cannot be rendered using the specified font. You can also specify an Apple Type Services for Unicode Imaging (ATSUI) style to improve performance. If you do not specify an ATSUI style, MLTE takes the style associated with the current graphics port and uses that information to create an ATSUI style.

function result

A result code.

DISCUSSION

You can use the TNXDrawUnicodeTextBox function to display mono-style Unicode text. You do not need to initialize MLTE to use this function because it uses Apple Type Services for Unicode Imaging (ATSUI) directly.

If you need to, you should first call EraseRect. The drawing is clipped to the rectangle unless you specify a rotation.

If you display text justified, it is justified in the direction of the display. Horizontal text is justified horizontally, but not vertically. Vertical text is justified vertically, but not horizontally.

AVAILABILITY

Under evaluation for Carbon. Available in Carbon 1.1 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)