Skip to content

Font

interludesoftware.tick

Interlude.Tick

Font Class

public class Font

Inheritance System.Object → Font

Constructors

Font(Texture2D, FontAsset) Constructor

Creates a Font backed by the given atlas texture and parsed metrics.

public Font(Texture2D texture, Interlude.Tick.FontAsset metrics);

Parameters

texture UnityEngine.Texture2D

metrics FontAsset

Methods

Font.CreateMesh(string, Rect, TextAlign, Wrap, Rect, Rect, List\<Rect>, int, float) Method

Builds a UnityEngine.Mesh with glyph geometry for text laid out inside rect. Fills boundsExact with the tight vertex bounds, boundsLines with the line-height-aligned bounds, characterRects with per-character rects (if non-null), and lineCount with the number of wrapped lines.

public Mesh CreateMesh(string text, Rect rect, Interlude.Tick.TextAlign align, Interlude.Tick.Wrap wrap, ref Rect boundsExact, ref Rect boundsLines, System.Collections.Generic.List<Rect> characterRects, ref int lineCount, float scale=1f);

Parameters

text System.String

rect UnityEngine.Rect

align Interlude.Tick.TextAlign

wrap Interlude.Tick.Wrap

boundsExact UnityEngine.Rect

boundsLines UnityEngine.Rect

characterRects System.Collections.Generic.List<UnityEngine.Rect>

lineCount System.Int32

scale System.Single

Returns

UnityEngine.Mesh

Font.GetTexture() Method

Returns the atlas texture used by this font.

public Texture2D GetTexture();

Returns

UnityEngine.Texture2D

Font.MeasureTextExact(string, Rect, TextAlign, Wrap, List\<Rect>, float) Method

Returns the tight vertex bounds and line-height-aligned bounds for text laid out in rect, optionally filling characterRects with per-character rects. Builds and discards a mesh internally.

public (Rect,Rect) MeasureTextExact(string text, Rect rect, Interlude.Tick.TextAlign align, Interlude.Tick.Wrap wrap, System.Collections.Generic.List<Rect> characterRects, float scale=1f);

Parameters

text System.String

rect UnityEngine.Rect

align Interlude.Tick.TextAlign

wrap Interlude.Tick.Wrap

characterRects System.Collections.Generic.List<UnityEngine.Rect>

scale System.Single

Returns

<UnityEngine.Rect,UnityEngine.Rect>