Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TryGetGlyphIndex(uint, out uint)

Tries to get the index of the glyph mapped to the given Unicode code point in the font asset's source font.
Read time 1 minuteLast updated 12 days ago

Definition

TryGetGlyphIndex(uint, uint)

public bool TryGetGlyphIndex(uint unicode, out uint glyphIndex)

Parameters

unicode

The Unicode code point to look up.

glyphIndex

The index of the glyph mapped to the code point, or 0 if the font has none.

Returns

Type

Description

boolReturns true if the font has a glyph for the code point. Otherwise, returns false.

Remarks

This is the nominal character-to-glyph mapping from the font's character map. Text shaping can substitute different glyphs at render time, for example for ligatures or complex scripts.