# `GSFont characterForGlyph:`

*Instance Method*

Returns the primary Unicode scalar of an encoded glyph or a temporary display character for an unencoded glyph.

## Declaration

```swift
func character(for glyph: GSGlyph) -> UTF32Char
```

```objc
- (UTF32Char) characterForGlyph:(GSGlyph *) glyph;
```

```python
characterForGlyph_(glyph: GSGlyph) -> UTF32Char
```

## Discussion

Temporary characters are assigned from the supplementary private-use area and remain stable for the lifetime of the character cache. The glyph may be local or imported and must belong to a font.

## See Also

### Unicode & Characters

- [`GSFont glyphForUnicode:`](/Core/GlyphsCore/GSFont/glyphForUnicode:) — Returns the local or imported glyph associated with a Unicode code point, or `nil` when no glyph matches.
- [`GSFont glyphForUnicodeFast:`](/Core/GlyphsCore/GSFont/glyphForUnicodeFast:) — Returns the local or imported glyph associated with a Unicode code point, or `nil` when no glyph matches.
- [`GSFont glyphForUnicodes:`](/Core/GlyphsCore/GSFont/glyphForUnicodes:) — Returns the local or imported glyph associated with the first matching Unicode code point, or `nil` when none match.
- [`GSFont localGlyphForUnicodeFast:`](/Core/GlyphsCore/GSFont/localGlyphForUnicodeFast:) — Returns a glyph from this font’s character cache associated with a Unicode code point, or `nil` when no glyph matches.
- [`GSFont localGlyphForUnicodes:`](/Core/GlyphsCore/GSFont/localGlyphForUnicodes:) — Returns a glyph from this font’s character cache associated with the first matching Unicode code point, or `nil` when none match.
- [`GSFont glyphForCharacter:`](/Core/GlyphsCore/GSFont/glyphForCharacter:) — Returns the local or imported glyph represented by a Unicode scalar or temporary display character, or `nil` when no glyph matches.
- [`GSFont.charsCache`](/Core/GlyphsCore/GSFont/charsCache) — The lookup cache used to map Unicode strings and temporary display characters to glyphs.
- [`GSFont glyphFromCharsCacheForUnicode:`](/Core/GlyphsCore/GSFont/glyphFromCharsCacheForUnicode:) — Returns the cached local or imported glyph associated with a Unicode code point, or `nil` when no glyph matches.
- [`GSFont glyphFromCharsCacheForChar:`](/Core/GlyphsCore/GSFont/glyphFromCharsCacheForChar:) — Returns the cached local or imported glyph represented by a Unicode scalar or temporary display character, or `nil` when no glyph matches.
- [`GSFont glyphFromCharsCacheForCharFast:`](/Core/GlyphsCore/GSFont/glyphFromCharsCacheForCharFast:) — Returns the cached local or imported glyph represented by a Unicode scalar or temporary display character, or `nil` when no glyph matches.
- [`GSFont preloadCharCache`](/Core/GlyphsCore/GSFont/preloadCharCache) — Prepares the character cache from the local and imported glyphs.
- [`GSFont charStringFromDisplayString:`](/Core/GlyphsCore/GSFont/charStringFromDisplayString:) — Converts display text containing slash-prefixed glyph names to a string of display characters.

