---
title: "getGlyphs(_:range:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nslayoutmanager/getglyphs(_:range:)"
---

# getGlyphs(_:range:)

Fills the passed-in buffer with a sequence of glyphs.

## Declaration

```swift
func getGlyphs(_ glyphArray: UnsafeMutablePointer<NSGlyph>?, range glyphRange: NSRange) -> Int
```

## Parameters

- `glyphArray`: On output, the displayable glyphs from glyphRange, null-terminated. Does not include in the result any doc://com.apple.appkit/documentation/AppKit/NSNullGlyph or other glyphs that are not shown. The memory passed in should be large enough for at least glyphRange.length+1 elements.
- `glyphRange`: The range of glyphs from which to return the displayable glyphs.

## Return Value

Return Value The actual number of glyphs filled into the array is returned (not counting the null-termination).

## Discussion

Discussion Raises an NSRangeException if the range specified exceeds the bounds of the actual glyph range for the receiver. Performs glyph generation if needed.

## See Also

### Methods

- [showCGGlyphs(_:positions:count:font:matrix:attributes:in:)](appkit/nslayoutmanager/showcgglyphs(_:positions:count:font:matrix:attributes:in:).md)
- [invalidateGlyphs(onLayoutInvalidationForGlyphRange:)](appkit/nslayoutmanager/invalidateglyphs(onlayoutinvalidationforglyphrange:).md)
- [invalidateLayout(forCharacterRange:isSoft:actualCharacterRange:)](appkit/nslayoutmanager/invalidatelayout(forcharacterrange:issoft:actualcharacterrange:).md)
- [textStorage(_:edited:range:changeInLength:invalidatedRange:)](appkit/nslayoutmanager/textstorage(_:edited:range:changeinlength:invalidatedrange:).md)
- [insertGlyph(_:atGlyphIndex:characterIndex:)](appkit/nslayoutmanager/insertglyph(_:atglyphindex:characterindex:).md)
- [insertGlyphs(_:length:forStartingGlyphAt:characterIndex:)](appkit/nslayoutmanager/insertglyphs(_:length:forstartingglyphat:characterindex:).md)
- [glyph(at:)](appkit/nslayoutmanager/glyph(at:).md)
- [glyph(at:isValidIndex:)](appkit/nslayoutmanager/glyph(at:isvalidindex:).md)
- [replaceGlyph(at:withGlyph:)](appkit/nslayoutmanager/replaceglyph(at:withglyph:).md)
- [getGlyphs(in:glyphs:characterIndexes:glyphInscriptions:elasticBits:)](appkit/nslayoutmanager/getglyphs(in:glyphs:characterindexes:glyphinscriptions:elasticbits:).md)
- [getGlyphs(in:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:)](appkit/nslayoutmanager/getglyphs(in:glyphs:characterindexes:glyphinscriptions:elasticbits:bidilevels:).md)
- [deleteGlyphs(in:)](appkit/nslayoutmanager/deleteglyphs(in:).md)
- [setCharacterIndex(_:forGlyphAt:)](appkit/nslayoutmanager/setcharacterindex(_:forglyphat:).md)
- [intAttribute(_:forGlyphAt:)](appkit/nslayoutmanager/intattribute(_:forglyphat:).md)
- [setIntAttribute(_:value:forGlyphAt:)](appkit/nslayoutmanager/setintattribute(_:value:forglyphat:).md)
