---
title: "getGlyphs(in:glyphs:properties:characterIndexes:bidiLevels:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nslayoutmanager/getglyphs(in:glyphs:properties:characterindexes:bidilevels:)"
---

# getGlyphs(in:glyphs:properties:characterIndexes:bidiLevels:)

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

## Declaration

```swift
func getGlyphs(in glyphRange: NSRange, glyphs glyphBuffer: UnsafeMutablePointer<CGGlyph>?, properties props: UnsafeMutablePointer<NSLayoutManager.GlyphProperty>?, characterIndexes charIndexBuffer: UnsafeMutablePointer<Int>?, bidiLevels bidiLevelBuffer: UnsafeMutablePointer<UInt8>?) -> Int
```

## Parameters

- `glyphRange`: The range of glyphs to fill in.
- `glyphBuffer`: On output, the sequence of glyphs in the given glyph range.
- `props`: If not NULL, on output, the glyph properties corresponding to the filled-in glyphs.
- `charIndexBuffer`: If not NULL, on output, the indexes of the original characters corresponding to the given glyph range. Note that a glyph at index 1 is not necessarily mapped to the character at index 1, since a glyph may be for a ligature or accent.
- `bidiLevelBuffer`: If not NULL, on output, the direction of each glyph for bidirectional text. The values range from 0 to 61 as defined by Unicode Standard Annex #9. An even value means the glyph goes left-to-right, and an odd value means the glyph goes right-to-left.

## Return Value

Return Value The number of glyphs returned in glyphBuffer.

## Discussion

Discussion Each pointer passed in should either be NULL or else point to sufficient memory to hold glyphRange.length elements.

## See Also

### Accessing glyphs

- [cgGlyph(at:)](appkit/nslayoutmanager/cgglyph(at:).md)
- [cgGlyph(at:isValidIndex:)](appkit/nslayoutmanager/cgglyph(at:isvalidindex:).md)
- [setGlyphs(_:properties:characterIndexes:font:forGlyphRange:)](appkit/nslayoutmanager/setglyphs(_:properties:characterindexes:font:forglyphrange:).md)
- [characterIndexForGlyph(at:)](appkit/nslayoutmanager/characterindexforglyph(at:).md)
- [glyphIndexForCharacter(at:)](appkit/nslayoutmanager/glyphindexforcharacter(at:).md)
- [isValidGlyphIndex(_:)](appkit/nslayoutmanager/isvalidglyphindex(_:).md)
- [numberOfGlyphs](appkit/nslayoutmanager/numberofglyphs.md)
- [propertyForGlyph(at:)](appkit/nslayoutmanager/propertyforglyph(at:).md)
- [NSLayoutManager.GlyphProperty](appkit/nslayoutmanager/glyphproperty.md)
