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

# paragraphSpacing(beforeGlyphAt:withProposedLineFragmentRect:)

Returns the number of points of space added before a paragraph, which is in effect before the specified glyph.

```
func paragraphSpacing(beforeGlyphAt glyphIndex: Int, withProposedLineFragmentRect rect: NSRect) -> CGFloat
```

## Discussion

The `rect` argument specifies the line fragment rectangle of the first line in the paragraph.

The typesetter adds the number of points specified in the return value to the top of the line fragment rectangle specified by `rect` (but not to the used line fragment rectangle for that line). Paragraph spacing added before a paragraph correlates to the value in the [`paragraphSpacingBefore`](/documentation/AppKit/NSParagraphStyle/paragraphSpacingBefore) property of [`NSParagraphStyle`](/documentation/AppKit/NSParagraphStyle). You can set the value of this property in an [`NSMutableParagraphStyle`](/documentation/AppKit/NSMutableParagraphStyle) object.

---

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)