Vixen
02b45cc4
csharp
public static class OutlineFlattener

Turns an outline's curves into line segments, at a tolerance the caller chooses.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

This is where the decision to keep curves as curves is finally spent. GlyphOutline holds Béziers because how finely to flatten one depends on how large it will be, and nothing knew that until now: a caller rasterising into an N-pixel cell knows exactly how much error is invisible.

⚠ The subdivision count comes from the curve's control polygon, not from a constant. A fixed count is either wasteful on a nearly-straight curve — most of a glyph's segments — or visibly faceted on a tight one, and a glyph has both within one contour.

Methods (1)

  • public static List<Edge> Flatten(GlyphOutline outline, float tolerance)

    Flattens an outline into edges, in the outline's own units.

Used by (2)

  • DistanceFieldVixen.Ui.Text
  • GlyphRasterizerVixen.Ui.Text