Vixen
dd8b0a81
csharp
public static class GlyphRasterizer

Fills a glyph outline into a coverage bitmap, by scanline.

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

Remarks

This exists to be an oracle before it exists to draw anything. A distance field is judged by reconstructing coverage from it and comparing against a rasterisation of the same outline — two independent routes to one shape — and that is a much stronger gate than a golden image, which only says the output has not changed.

⚠ Non-zero winding unless a caller says otherwise, and every caller in this assembly is a font. A counter in an o is a contour wound the other way, and both rules agree about that; they disagree where two same-wound contours overlap, which happens in scripts that build a letter out of stacked strokes and where even-odd is simply wrong. FillRule carries why the option exists at all.

Methods (1)

  • public static CoverageBitmap Rasterize(GlyphOutline outline, int width, int height, float scale, Vector2 origin, FillRule rule = NonZero)

    Rasterises an outline into a bitmap of a given size.

Used by (4)

  • DistanceFieldVixen.Ui.Text
  • DistanceFieldTestsVixen.Ui.Text.Tests
  • RasterizerTestsVixen.Ui.Text.Tests
  • TextureTextVixen.Editor.TextureGraph