shouldBreakLine(byHyphenatingBeforeCharacterAt:)
Returns whether the line being laid out should be broken by hyphenating at the specified character.
Declaration
func shouldBreakLine(byHyphenatingBeforeCharacterAt charIndex: Int) -> BoolParameters
- charIndex:
The index of the character just after the proposed hyphenation would occur.
Return Value
true if the line should be broken by hyphenating, false otherwise.
Discussion
The typesetter calls this method, if implemented by a subclass, before breaking a line by hyphenating before the character at charIndex, enabling the subclass to control line breaking.
A subclass can override this method to customize the text layout process. If the method returns false, the typesetter continues looking for a break point.
See Also
Laying out glyphs
layoutGlyphs(in:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:)boundingBox(forControlGlyphAt:for:proposedLineFragment:glyphPosition:characterIndex:)getLineFragmentRect(_:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:)getLineFragmentRect(_:usedRect:remaining:forStartingGlyphAt:proposedRect:lineSpacing:paragraphSpacingBefore:paragraphSpacingAfter:)hyphenCharacter(forGlyphAt:)hyphenationFactor(forGlyphAt:)shouldBreakLine(byWordBeforeCharacterAt:)willSetLineFragmentRect(_:forGlyphRange:usedRect:baselineOffset:)setHardInvalidation(_:forGlyphRange:)