Interface IGlyphOutlineSink
Receives a glyph outline from GetGlyphOutline(ushort, IGlyphOutlineSink), in font units with y up. Each contour starts with MoveTo(float, float) and ends with Close(); a closing line back to the start point is implied by Close() and not sent.
public interface IGlyphOutlineSink
Examples
// Character map, advance, ink box and kerning, all in font units with y up.
ushort a = face.GetGlyph('A'), v = face.GetGlyph('V');
float advance = face.GetAdvance(a);
GlyphExtents ink = face.GetGlyphExtents(a);
float kern = face.GetKerning(a, v);
FontExtents extents = face.Extents;
// An outline arrives through a sink: lines and quadratics for TrueType, lines and cubics for CFF.
var counter = new SegmentCounter();
face.GetGlyphOutline(a, counter);
Remarks
TrueType outlines arrive as lines and quadratic curves, CFF outlines as lines and cubic curves; neither is converted.
Methods
Close()
Ends the contour, joining it back to its start point.
void Close()
CubicTo(float, float, float, float, float, float)
Adds a cubic Bézier curve.
void CubicTo(float c1x, float c1y, float c2x, float c2y, float x, float y)
Parameters
c1xfloatThe first control point's x.
c1yfloatThe first control point's y.
c2xfloatThe second control point's x.
c2yfloatThe second control point's y.
xfloatThe end point's x.
yfloatThe end point's y.
LineTo(float, float)
Adds a straight line to a point.
void LineTo(float x, float y)
Parameters
MoveTo(float, float)
Starts a contour at a point.
void MoveTo(float x, float y)
Parameters
QuadTo(float, float, float, float)
Adds a quadratic Bézier curve.
void QuadTo(float cx, float cy, float x, float y)