<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTypesetter/baselineOffset(in:glyphIndex:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTypesetter(im)baselineOffsetInLayoutManager:glyphIndex:"
  },
  "title" : "baselineOffset(in:glyphIndex:)"
}
-->

# baselineOffset(in:glyphIndex:)

Returns the distance from the bottom of the line fragment rectangle in which the glyph resides to the glyph baseline.

```
func baselineOffset(in layoutMgr: NSLayoutManager, glyphIndex: Int) -> CGFloat
```

## Parameters

`layoutMgr`

The layout manager used for the drawing.

`glyphIndex`

The index of the glyph in question.

## Return Value

The distance from the bottom of the line fragment rectangle in which the glyph resides to the glyph baseline.

## Discussion

The text system uses this value to calculate the vertical position of underlines.

---

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)