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

# setLocation(_:withAdvancements:forStartOfGlyphRange:)

Sets the location where the specified glyphs are laid out.

```
func setLocation(_ location: NSPoint, withAdvancements advancements: UnsafePointer<CGFloat>!, forStartOfGlyphRange glyphRange: NSRange)
```

## Parameters

`location`

The location where the glyphs in `glyphRange` are laid out. The x-coordinate of `location` is expressed relative to the line fragment rectangle origin, and the y-coordinate is expressed relative to the baseline previously specified by [`setLineFragmentRect(_:forGlyphRange:usedRect:baselineOffset:)`](/documentation/AppKit/NSTypesetter/setLineFragmentRect(_:forGlyphRange:usedRect:baselineOffset:)).

`advancements`

The nominal glyph advance width specified in the font metric information.

`glyphRange`

The range of glyphs whose layout location is being set. This series of glyphs can be displayed with a single PostScript `show` operation (a nominal range).

## Discussion

Setting the location for a series of glyphs implies that the glyphs preceding it can’t be included in a single `show` operation.

Before setting the location for a glyph range, you must specify line fragment rectangle with [`setLineFragmentRect(_:forGlyphRange:usedRect:baselineOffset:)`](/documentation/AppKit/NSTypesetter/setLineFragmentRect(_:forGlyphRange:usedRect:baselineOffset:)).

A subclass can override this method to interact with custom glyph storage.

---

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)