Interface IGlyphRenderer
A surface that can have a glyph rendered to it as a series of actions.
Namespace: SixLabors.Fonts
Assembly: SixLabors.Fonts.dll
Syntax
public interface IGlyphRenderer
Methods
| Edit this page View SourceBeginFigure()
Begins the figure.
Declaration
void BeginFigure()
BeginGlyph(in FontRectangle, in GlyphRendererParameters)
Begins the glyph.
Declaration
bool BeginGlyph(in FontRectangle bounds, in GlyphRendererParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
FontRectangle | bounds | The bounds the glyph will be rendered at and at what size. |
GlyphRendererParameters | parameters | The set of parameters that uniquely represents a version of a glyph in at particular font size, font family, font style and DPI. |
Returns
Type | Description |
---|---|
bool | Returns true if the glyph should be rendered otherwise it returns false. |
BeginText(in FontRectangle)
Called before any glyphs have been rendered.
Declaration
void BeginText(in FontRectangle bounds)
Parameters
Type | Name | Description |
---|---|---|
FontRectangle | bounds | The rectangle within the text will be rendered. |
CubicBezierTo(Vector2, Vector2, Vector2)
Draw a cubic bezier curve connecting the previous point to point
.
Declaration
void CubicBezierTo(Vector2 secondControlPoint, Vector2 thirdControlPoint, Vector2 point)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | secondControlPoint | The second control point. |
Vector2 | thirdControlPoint | The third control point. |
Vector2 | point | The 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.
Declaration
TextDecorations EnabledDecorations()
Returns
Type | Description |
---|---|
TextDecorations | The text decorations the render wants render info for. |
EndFigure()
Ends the figure.
Declaration
void EndFigure()
EndGlyph()
Ends the glyph.
Declaration
void EndGlyph()
EndText()
Called once all glyphs have completed rendering.
Declaration
void EndText()
LineTo(Vector2)
Draw a straight line connecting the previous point to point
.
Declaration
void LineTo(Vector2 point)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | point | The point. |
MoveTo(Vector2)
Sets a new start point to draw lines from.
Declaration
void MoveTo(Vector2 point)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | point | The point. |
QuadraticBezierTo(Vector2, Vector2)
Draw a quadratic bezier curve connecting the previous point to point
.
Declaration
void QuadraticBezierTo(Vector2 secondControlPoint, Vector2 point)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | secondControlPoint | The second control point. |
Vector2 | point | The point. |
SetDecoration(TextDecorations, Vector2, Vector2, float)
Provides the positions required for drawing text decorations onto the IGlyphRenderer
Declaration
void SetDecoration(TextDecorations textDecorations, Vector2 start, Vector2 end, float thickness)
Parameters
Type | Name | Description |
---|---|---|
TextDecorations | textDecorations | The type of decoration these details correspond to. |
Vector2 | start | The start position from where to draw the decorations from. |
Vector2 | end | The end position from where to draw the decorations to. |
float | thickness | The thickness to draw the decoration. |