Interface IGlyphRenderer
A surface that can have a glyph rendered to it as a series of actions.
public interface IGlyphRenderer
- Extension Methods
Methods
ArcTo(float, float, float, bool, bool, Vector2)
Adds an elliptical arc to the current figure. The arc curves from the last point to point,
choosing one of four possible routes: clockwise or counterclockwise, and smaller or larger.
The arc sweep is always less than 360 degrees. The method appends a line
to the last point if either radii are zero, or if last point is equal to point.
In addition the method scales the radii to fit last point and point if both
are greater than zero but too small to describe an arc.
void ArcTo(float radiusX, float radiusY, float rotation, bool largeArc, bool sweep, Vector2 point)
Parameters
radiusXfloatThe x-radius of the ellipsis.
radiusYfloatThe y-radius of the ellipsis.
rotationfloatThe rotation along the X-axis; measured in degrees clockwise.
largeArcboolThe large arc flag, and is false if an arc spanning less than or equal to 180 degrees is chosen, or true if an arc spanning greater than 180 degrees is chosen.
sweepboolThe sweep flag, and is false if the line joining center to arc sweeps through decreasing angles, or true if it sweeps through increasing angles.
pointVector2The end point of the arc.
BeginFigure()
Begins the figure.
void BeginFigure()
BeginGlyph(in FontRectangle, in GlyphRendererParameters)
Begins the glyph.
bool BeginGlyph(in FontRectangle bounds, in GlyphRendererParameters parameters)
Parameters
boundsFontRectangleThe bounds the glyph will be rendered at and at what size.
parametersGlyphRendererParametersThe set of parameters that uniquely represents a version of a glyph at particular font size, font family, font style and DPI.
Returns
BeginLayer(Paint?, FillRule, ClipQuad?)
Begins a new painted layer with the specified paint and fill rule. All geometry commands issued after this call belong to the layer until EndLayer() is called.
void BeginLayer(Paint? paint, FillRule fillRule, ClipQuad? clipBounds)
Parameters
paintPaintThe paint definition.
fillRuleFillRuleThe fill rule to use when rasterizing this layer.
clipBoundsClipQuad?The optional clip bounds to apply when rasterizing this layer.
BeginText(in FontRectangle)
Called before any glyphs have been rendered.
void BeginText(in FontRectangle bounds)
Parameters
boundsFontRectangleThe rectangle within the text will be rendered.
CubicBezierTo(Vector2, Vector2, Vector2)
Draw a cubic bezier curve connecting the previous point to point.
void CubicBezierTo(Vector2 secondControlPoint, Vector2 thirdControlPoint, Vector2 point)
Parameters
secondControlPointVector2The second control point.
thirdControlPointVector2The third control point.
pointVector2The point.
EnabledDecorations()
Provides a callback to enable custom logic to request decoration details. A custom TextRun might use alternative triggers to determine what decorations it needs access to.
TextDecorations EnabledDecorations()
Returns
- TextDecorations
The text decorations the render wants render info for.
EndFigure()
Ends the figure.
void EndFigure()
EndGlyph()
Ends the glyph.
void EndGlyph()
EndLayer()
Ends the current painted layer.
void EndLayer()
EndText()
Called once all glyphs have completed rendering.
void EndText()
LineTo(Vector2)
Draw a straight line connecting the previous point to point.
void LineTo(Vector2 point)
Parameters
pointVector2The point.
MoveTo(Vector2)
Sets a new start point to draw lines from.
void MoveTo(Vector2 point)
Parameters
pointVector2The point.
QuadraticBezierTo(Vector2, Vector2)
Draw a quadratic bezier curve connecting the previous point to point.
void QuadraticBezierTo(Vector2 secondControlPoint, Vector2 point)
Parameters
SetDecoration(TextDecorations, Vector2, Vector2, float)
Sets the details of a text decoration to be rendered. This only gets called if the decoration type was requested via EnabledDecorations() and after the glyph has been rendered via BeginGlyph(in FontRectangle, in GlyphRendererParameters) and EndGlyph().
void SetDecoration(TextDecorations textDecorations, Vector2 start, Vector2 end, float thickness)
Parameters
textDecorationsTextDecorationsThe type of decoration these details correspond to.
startVector2The start position from where to draw the decorations from.
endVector2The end position from where to draw the decorations to.
thicknessfloatThe thickness to draw the decoration.