GraphicsAPI reference
Class SizedFont
Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Text.dll
Guide: Graphics
A ScalableFont at one size: an IFont for widgets, layout and drawing.
public sealed class SizedFont : IFontInheritance
Implements
Extension Methods
FontExtensions.DrawCentered(IFont, IRenderer, string, Vector2, Color), FontExtensions.DrawShadowed(IFont, IRenderer, string, Vector2, Color, Color, Vector2?), FontExtensions.MeasureWidth(IFont, string), FontExtensions.Wrap(IFont, string, float)
Properties
Family
The font this size belongs to.
public ScalableFont Family { get; }Property Value
LineHeight
Distance between the tops of two lines, in canvas pixels.
public float LineHeight { get; }Property Value
Size
The size in pixels per em.
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
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)
Rasterizes characters at this size now (see Prepare).
public void Prepare(string characters)Parameters
characters string