文档

Unity Engine

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.
阅读时间1 分钟最后更新于 1 个月前

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.