Class Glyph
A Glyph is the visual representation of a text element or character.
Inherited Members
Namespace: UnityEngine.TextCore
Assembly: UnityEngine.dll
Syntax
[Serializable]
public class Glyph
Constructors
| Improve this Doc View SourceGlyph()
Constructor for a new glyph.
Declaration
public Glyph()
Glyph(UInt32, GlyphMetrics, GlyphRect)
Constructor for new glyph. The scale will be set to a value of 1.0 and atlas index to 0.
Declaration
public Glyph(uint index, GlyphMetrics metrics, GlyphRect glyphRect)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | index | The index of the glyph in the font file. |
GlyphMetrics | metrics | The metrics of the glyph. |
GlyphRect | glyphRect | The GlyphRect defining the position of the glyph in the atlas texture. |
Glyph(UInt32, GlyphMetrics, GlyphRect, Single, Int32)
Constructor for new glyph.
Declaration
public Glyph(uint index, GlyphMetrics metrics, GlyphRect glyphRect, float scale, int atlasIndex)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | index | The index of the glyph in the font file. |
GlyphMetrics | metrics | The metrics of the glyph. |
GlyphRect | glyphRect | The GlyphRect defining the position of the glyph in the atlas texture. |
Single | scale | The relative scale of the glyph. |
Int32 | atlasIndex | The index of the atlas texture that contains the glyph. |
Glyph(Glyph)
Constructor for a new glyph
Declaration
public Glyph(Glyph glyph)
Parameters
Type | Name | Description |
---|---|---|
Glyph | glyph | Glyph whose values are copied to the new glyph. |
Properties
| Improve this Doc View SourceatlasIndex
The index of the atlas texture that contains this glyph.
Declaration
public int atlasIndex { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
glyphRect
A rectangle that defines the position of a glyph within an atlas texture.
Declaration
public GlyphRect glyphRect { get; set; }
Property Value
Type | Description |
---|---|
GlyphRect |
index
The index of the glyph in the source font file.
Declaration
public uint index { get; set; }
Property Value
Type | Description |
---|---|
UInt32 |
metrics
The metrics that define the size, position and spacing of a glyph when performing text layout.
Declaration
public GlyphMetrics metrics { get; set; }
Property Value
Type | Description |
---|---|
GlyphMetrics |
scale
The relative scale of the glyph. The default value is 1.0.
Declaration
public float scale { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
| Improve this Doc View SourceCompare(Glyph)
Compares two glyphs to determine if they have the same values.
Declaration
public bool Compare(Glyph other)
Parameters
Type | Name | Description |
---|---|---|
Glyph | other | The glyph to compare with. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the glyphs have the same values. False if not. |