---
title: "shouldBreakLine(byHyphenatingBeforeCharacterAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsatstypesetter/shouldbreakline(byhyphenatingbeforecharacterat:)"
---

# shouldBreakLine(byHyphenatingBeforeCharacterAt:)

Breaks a line by hyphenating before the character at the specified index.

## Declaration

```swift
func shouldBreakLine(byHyphenatingBeforeCharacterAt charIndex: Int) -> Bool
```

## Discussion

Discussion The typesetter calls this method, if implemented by a subclass, before breaking a line by hyphenating before the character at the given character index, 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

- [boundingBox(forControlGlyphAt:for:proposedLineFragment:glyphPosition:characterIndex:)](appkit/nsatstypesetter/boundingbox(forcontrolglyphat:for:proposedlinefragment:glyphposition:characterindex:).md)
- [getLineFragmentRect(_:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:)](appkit/nsatstypesetter/getlinefragmentrect(_:usedrect:forparagraphseparatorglyphrange:atproposedorigin:).md)
- [hyphenCharacter(forGlyphAt:)](appkit/nsatstypesetter/hyphencharacter(forglyphat:).md)
- [hyphenationFactor(forGlyphAt:)](appkit/nsatstypesetter/hyphenationfactor(forglyphat:).md)
- [shouldBreakLine(byWordBeforeCharacterAt:)](appkit/nsatstypesetter/shouldbreakline(bywordbeforecharacterat:).md)
- [willSetLineFragmentRect(_:forGlyphRange:usedRect:baselineOffset:)](appkit/nsatstypesetter/willsetlinefragmentrect(_:forglyphrange:usedrect:baselineoffset:).md)
- [setHardInvalidation(_:forGlyphRange:)](appkit/nsatstypesetter/sethardinvalidation(_:forglyphrange:).md)
