Skip to content

GraphicsAPI reference

Class ShapedFontSize

Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Text.Shaping.dll
Guide: Graphics

A ShapedFont at one size: an IFont for widgets, layout and drawing.

C#
public sealed class ShapedFontSize : IFont

Inheritance

object ← ShapedFontSize

Implements

IFont

Properties

Baseline

Distance from the top of a line to its baseline, in canvas pixels.

C#
public float Baseline { get; }

Property Value

float

Family

The font this size belongs to.

C#
public ShapedFont Family { get; }

Property Value

ShapedFont

LineHeight

Distance between the tops of two lines, in canvas pixels.

C#
public float LineHeight { get; }

Property Value

float

Size

The size, as for At.

C#
public float Size { get; }

Property Value

float

Methods

Draw(IRenderer, string, Vector2, Color)

Draws text with its top-left at position, in color.

C#
public void Draw(IRenderer renderer, string text, Vector2 position, Color color)

Parameters

renderer IRenderer

text string

position Vector2

color Color

IsRightToLeft(string)

Whether line reads right to left: its first letter with a direction is Hebrew, Arabic or another right-to-left script. Align such lines to the right.

C#
public bool IsRightToLeft(string line)

Parameters

line string

Returns

bool

Measure(string)

Size of text in canvas pixels: the widest line by the height of its lines. ‘\n’ starts a new line.

C#
public Vector2 Measure(string text)

Parameters

text string

Returns

Vector2

Prepare(string)

Shapes and rasterizes text now, so drawing it later costs no font work.

C#
public void Prepare(string text)

Parameters

text string

Shape(string)

The glyphs of one line of line (no ‘\n’) in the order they are drawn, left to right, with where each sits: for effects of a game’s own (a wave, a reveal that follows the reading order through Cluster).

C#
public IReadOnlyList<ShapedGlyph> Shape(string line)

Parameters

line string

Returns

IReadOnlyList<ShapedGlyph>