Table of Contents

Interface IGlyphOutlineSink

Namespace
Egami.Fonts
Assembly
Egami.Fonts.dll

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

c1x float

The first control point's x.

c1y float

The first control point's y.

c2x float

The second control point's x.

c2y float

The second control point's y.

x float

The end point's x.

y float

The end point's y.

LineTo(float, float)

Adds a straight line to a point.

void LineTo(float x, float y)

Parameters

x float

The x coordinate.

y float

The y coordinate.

MoveTo(float, float)

Starts a contour at a point.

void MoveTo(float x, float y)

Parameters

x float

The x coordinate.

y float

The y coordinate.

QuadTo(float, float, float, float)

Adds a quadratic Bézier curve.

void QuadTo(float cx, float cy, float x, float y)

Parameters

cx float

The control point's x.

cy float

The control point's y.

x float

The end point's x.

y float

The end point's y.