我无法理解这个变量offset
的作用。如果我设置随机任意值,我无法看到任何变化。那它是做什么的?
文档说
@function CTTypesetterSuggestLineBreakWithOffset
@abstract Suggests a contextual line break point based on the width
provided.
@discussion The line break can be triggered either by a hard break character
in the stream or by filling the specified width with characters.
...
@param offset
The line position offset.
@result The value returned is a count of the characters from startIndex
that would cause the line break. This value returned can be used
to construct a character range for CTTypesetterCreateLine.
CFIndex CTTypesetterSuggestLineBreakWithOffset(
CTTypesetterRef typesetter,
CFIndex startIndex,
double width,
double offset ) CT_AVAILABLE(10_6, 3_2);