---
title: "textTab(forGlyphLocation:writingDirection:maxLocation:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsatstypesetter/texttab(forglyphlocation:writingdirection:maxlocation:)"
---

# textTab(forGlyphLocation:writingDirection:maxLocation:)

Returns the text tab closest to the specified glyph location and not beyond a maximum position.

## Declaration

```swift
func textTab(forGlyphLocation glyphLocation: CGFloat, writingDirection direction: NSWritingDirection, maxLocation: CGFloat) -> NSTextTab?
```

## Discussion

Discussion The typesetter calls this method whenever it finds a tab character. To determine the width to advance the next glyph, the typesetter examines the NSParagraphStyle tab array and the default tab interval.
