---
title: "CTFontGetGlyphsForCharacters(_:_:_:_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctfontgetglyphsforcharacters(_:_:_:_:)"
---

# CTFontGetGlyphsForCharacters(_:_:_:_:)

Performs basic character-to-glyph mapping.

## Declaration

```swift
func CTFontGetGlyphsForCharacters(_ font: CTFont, _ characters: UnsafePointer<UniChar>, _ glyphs: UnsafeMutablePointer<CGGlyph>, _ count: CFIndex) -> Bool
```

## Parameters

- `font`: The font reference.
- `characters`: An array of Unicode characters.
- `glyphs`: On output, points to an array of glyph values.
- `count`: The capacity of the character and glyph arrays.

## Return Value

Return Value True if the font could encode all Unicode characters; otherwise False.

## Discussion

Discussion Provides basic Unicode encoding for the given font, returning by reference an array of CGGlyph values corresponding to a given array of Unicode characters for the given font. If a glyph could not be encoded, a value of 0 is passed back at the corresponding index in the glyphs array and the function returns False. It is the responsibility of the caller to handle the Unicode properties of the input characters.

## See Also

### Working with Glyphs

- [CTFontDrawGlyphs(_:_:_:_:_:)](coretext/ctfontdrawglyphs(_:_:_:_:_:).md)
- [CTFontGetLigatureCaretPositions(_:_:_:_:)](coretext/ctfontgetligaturecaretpositions(_:_:_:_:).md)
