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.
public sealed class ShapedFontSize : IFontInheritance
Implements
Properties
Baseline
Distance from the top of a line to its baseline, in canvas pixels.
public float Baseline { get; }Property Value
Family
The font this size belongs to.
public ShapedFont Family { get; }Property Value
LineHeight
Distance between the tops of two lines, in canvas pixels.
public float LineHeight { get; }Property Value
Size
The size, as for At.
public float Size { get; }Property Value
Methods
Draw(IRenderer, string, Vector2, Color)
Draws text with its top-left at position, in color.
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.
public bool IsRightToLeft(string line)Parameters
line string
Returns
Measure(string)
Size of text in canvas pixels: the widest line by the height of its lines. ‘\n’ starts a new line.
public Vector2 Measure(string text)Parameters
text string
Returns
Prepare(string)
Shapes and rasterizes text now, so drawing it later costs no font work.
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).
public IReadOnlyList<ShapedGlyph> Shape(string line)Parameters
line string