# `GSFont localGlyph(for:)`

*Instance Method*

Returns a glyph from this font’s character cache associated with the first matching Unicode scalar, or `nil` when none match.

## Declaration

```swift
func localGlyph(for codePoints: [Unicode.Scalar]) -> GSGlyph?
```

## Discussion

The order of the Unicode scalars determines lookup precedence. The cache can include local and imported glyphs. Linked fonts are not searched separately.

## See Also

### Unicode & Characters

- [`GSFont glyph(for:)`](/Core/GlyphsCore/GSFont/glyph(for:)) — Returns the local or imported glyph associated with a Unicode scalar, or `nil` when no glyph matches.
- [`GSFont glyphFast(for:)`](/Core/GlyphsCore/GSFont/glyphFast(for:)) — Returns the local or imported glyph associated with a Unicode scalar, or `nil` when no glyph matches.
- [`GSFont glyph(for:)`](/Core/GlyphsCore/GSFont/glyph(for:)-9ao08) — Returns the local or imported glyph associated with the first matching Unicode scalar, or `nil` when none match.
- [`GSFont localGlyphFast(for:)`](/Core/GlyphsCore/GSFont/localGlyphFast(for:)) — Returns a glyph from this font’s character cache associated with a Unicode scalar, or `nil` when no glyph matches.
- [`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 characterForGlyph:`](/Core/GlyphsCore/GSFont/characterForGlyph:) — Returns the primary Unicode scalar of an encoded glyph or a temporary display character for an unencoded glyph.
- [`GSFont.charsCache`](/Core/GlyphsCore/GSFont/charsCache) — The lookup cache used to map Unicode strings and temporary display characters to glyphs.
- [`GSFont cachedGlyph(for:)`](/Core/GlyphsCore/GSFont/cachedGlyph(for:)) — Returns the cached local or imported glyph associated with a Unicode scalar, 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.

