---
title: "paragraphSpacing(beforeGlyphAt:withProposedLineFragmentRect:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsatstypesetter/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.

## Declaration

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

## Discussion

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 property of NSParagraphStyle. You can set the value of this property in an NSMutableParagraphStyle object.

## See Also

### Getting Spacing Information

- [lineSpacing(afterGlyphAt:withProposedLineFragmentRect:)](appkit/nsatstypesetter/linespacing(afterglyphat:withproposedlinefragmentrect:).md)
- [paragraphSpacing(afterGlyphAt:withProposedLineFragmentRect:)](appkit/nsatstypesetter/paragraphspacing(afterglyphat:withproposedlinefragmentrect:).md)
