![]() |
ATSUSetSoftLineBreak |
||||
Header: | ATSUnicode.h | Carbon status: | Supported | |
Sets a soft line break.
OSStatus ATSUSetSoftLineBreak ( ATSUTextLayout iTextLayout, UniCharArrayOffset iLineBreak );
A reference to an initialized text layout object containing the range of text whose line break you wish to determine. You cannot pass NULL for this parameter.
The edge offset that corresponds to the line break you want to set. To specify the beginning of the text buffer, pass the constant kATSUFromTextBeginning, described in
A result code.
The ATSUSetSoftLineBreak function enables you to use your own line-breaking algorithm to set soft line break positions in a range of text. You should call ATSUSetSoftLineBreak to implement word break hyphenation. If you do not want to set line breaks, call the function ATSUBreakLine and pass true for the iUseAsSoftLineBreak parameter.
Before calculating soft line breaks, ATSUSetSoftLineBreak turns off any previously set line justification, rotation, width alignment, descent, and ascent values and treats the text as a single line. It then examines the text layout object to make sure that the style runs cover the entire range of text. If there are gaps between style runs, ATSUSetSoftLineBreak assigns the characters in the gap to the style run following the gap. If there is no style run at the beginning of the range of text, ATSUSetSoftLineBreak assigns these characters to the first style run it can find. If there no style run at the end of the range of text, ATSUSetSoftLineBreak assigns the remaining characters to the last style run it can find.
After calling ATSUSetSoftLineBreak, you should call the function ATSUMeasureText to measure the text.
ATSUSetSoftLineBreak may allocate memory in your application heap, unless you designate a different heap by calling the function ATSUCreateMemorySetting.
Available beginning with ATSUI 1.0.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.5 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)