PeachDrawing.Core
PeachDrawing.Core
CanvasParagraphExtensions Class
Draws text that PeachDrawing.Text has already shaped and laid out onto any Canvas, so the positions a
ParagraphLayout reports are the positions the text is painted at. Everything is in the canvas’s user units,
the units DrawRectangle(Brush, double, double, double, double) takes; layout sizes are read in the same
units, so a paragraph laid out at 16 draws 16 user units tall on a canvas whose PixelsPerPoint is 1.
public static class CanvasParagraphExtensions
Inheritance System.Object → CanvasParagraphExtensions
| Methods | |
|---|---|
| DrawGlyphRun(this Canvas, GlyphRun, double, PaintPoint, PaintColor, double) | Draws a run of already-shaped glyphs, each starting where the previous one’s advance ends, without shaping anything: the glyphs and positions are the shaper’s, so a color font, kerning and ligatures come out as they were shaped. |
| DrawParagraph(this Canvas, ParagraphLayout, PaintPoint, PaintColor) | Draws every run of layout in one color. |
| DrawParagraph(this Canvas, ParagraphLayout, PaintPoint, Func<PlacedRun,ParagraphPaint>, Action<Canvas,PlacedRun,Rect>) | Draws every run of layout, painted as paintForRun says. |