<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSATSTypesetter/lineSpacing(afterGlyphAt:withProposedLineFragmentRect:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSATSTypesetter(im)lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:"
  },
  "title" : "lineSpacing(afterGlyphAt:withProposedLineFragmentRect:)"
}
-->

# lineSpacing(afterGlyphAt:withProposedLineFragmentRect:)

Returns the line spacing in effect following the specified glyph.

```
func lineSpacing(afterGlyphAt glyphIndex: Int, withProposedLineFragmentRect rect: NSRect) -> CGFloat
```

## Discussion

The [`NSATSTypesetter`](/documentation/AppKit/NSATSTypesetter) calls this method to determine the number of points of space to include below the descenders in the used rectangle for the proposed line fragment rectangle `rect`.

Line spacing, also called leading, is an attribute of [`NSParagraphStyle`](/documentation/AppKit/NSParagraphStyle), which you can set on an [`NSMutableParagraphStyle`](/documentation/AppKit/NSMutableParagraphStyle) object. A font typically includes a default minimum line spacing metric used if none is set in the paragraph style.

If the typesetter behavior specified in the [`NSLayoutManager`](/documentation/AppKit/NSLayoutManager)
is [`NSLayoutManager.TypesetterBehavior.originalBehavior`](/documentation/AppKit/NSLayoutManager/TypesetterBehavior-swift.enum/originalBehavior), the text system uses the original, private typesetter `NSSimpleHorizontalTypesetter`, which adds the line spacing above the ascender. Similarly, [`NSATSTypesetter`](/documentation/AppKit/NSATSTypesetter) adds the line spacing above the ascender if the value is negative.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)