Instance Method


Returns whether the line being laid out should be broken by hyphenating at the specified character.


func shouldBreakLine(byHyphenatingBeforeCharacterAt charIndex: Int) -> Bool



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.


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

func hyphenCharacter(forGlyphAt: Int) -> UTF32Char

Returns the hyphen character to be inserted after the specified glyph.

func hyphenationFactor(forGlyphAt: Int) -> Float

Returns the hyphenation factor in effect at a specified location.

func shouldBreakLine(byWordBeforeCharacterAt: Int) -> Bool

Returns whether the line being laid out should be broken by a word break at the specified character.

func willSetLineFragmentRect(NSRectPointer, forGlyphRange: NSRange, usedRect: NSRectPointer, baselineOffset: UnsafeMutablePointer<CGFloat>)

Called by the typesetter just prior to storing the actual line fragment rectangle location in the layout manager.

func setHardInvalidation(Bool, forGlyphRange: NSRange)

Sets whether to force the layout manager to invalidate the specified portion of the glyph cache when invalidating layout.