CharacterToGlyphMap Struct
Definition
Provides a read-only mapping from Unicode code points to glyph identifiers for a font's character map (cmap) table.
public struct CharacterToGlyphMap
Remarks
This struct enables efficient lookup of glyph IDs corresponding to Unicode code points, supporting both Format 4 (BMP) and Format 12 (Unicode full repertoire) cmap subtables.
Methods
| Name | Description |
|---|---|
| ContainsGlyph | Determines whether the character map contains a glyph for the specified Unicode code point. |
| GetGlyph | Retrieves the glyph index that corresponds to the specified Unicode code point. |
| GetGlyphs | No summary available. |
| GetMappedRanges | Returns an enumerator that iterates through all code point ranges mapped by this instance. |
| TryGetGlyph | No summary available. |
ContainsGlyph Method
Determines whether the character map contains a glyph for the specified Unicode code point.
public bool ContainsGlyph(int codePoint)
Parameters
codePoint int
The Unicode code point to check for the presence of a corresponding glyph.
Returns
bool
true if a glyph exists for the specified code point; otherwise, false.
GetGlyph Method
Retrieves the glyph index that corresponds to the specified Unicode code point.
public ushort GetGlyph(int codePoint)
Parameters
codePoint int
The Unicode code point for which to obtain the glyph index.
Returns
ushort
The glyph index associated with the specified code point. Returns 0 if the code point is not mapped to any glyph.
GetGlyphs Method
public void GetGlyphs(ReadOnlySpan<int> codePoints, Span<ushort> glyphIds)
Parameters
codePoints ReadOnlySpan<int>
glyphIds Span<ushort>
GetMappedRanges Method
Returns an enumerator that iterates through all code point ranges mapped by this instance.
public Avalonia.Media.Fonts.Tables.Cmap.CodepointRangeEnumerator GetMappedRanges()
Returns
Avalonia.Media.Fonts.Tables.Cmap.CodepointRangeEnumerator
A Avalonia.Media.Fonts.Tables.Cmap.CodepointRangeEnumerator that can be used to enumerate the mapped code point ranges.
TryGetGlyph Method
public bool TryGetGlyph(int codePoint, ushort& glyphId)
Parameters
codePoint int
glyphId ushort&
Returns
bool
Properties
| Name | Description |
|---|---|
| Item | No summary available. |
Item Property
public ushort Item { get; set; }