Method DrawGeometryWithPaintOrder
- Namespace
- SharpVectors.Renderers.Texts
- Assembly
- SharpVectors.Rendering.Wpf.dll
DrawGeometryWithPaintOrder(SvgTextContentElement, Brush, Pen, Geometry)
Draws geometry respecting the paint-order CSS property.
For text rendering with paint-order support, this method creates separate drawings when stroke-first rendering is needed, instead of using the standard DrawContext.DrawGeometry which applies fill then stroke.
protected void DrawGeometryWithPaintOrder(SvgTextContentElement textElement, Brush brush, Pen pen, Geometry geometry)
Parameters
textElementSvgTextContentElementThe SVG text element being rendered
brushBrushThe fill brush (or null for stroke-only)
penPenThe stroke pen (or null for fill-only)
geometryGeometryThe text geometry to draw
Remarks
This method respects the SVG paint-order CSS property with Phase 1 support: - paint-order: normal/fill → Uses standard DrawGeometry (fill then stroke) - paint-order: stroke → Creates separate geometry drawings (stroke then fill)
This allows text to have visible outlines by rendering stroke underneath and fill on top, matching modern browser behavior.
For text rendering, when paint-order="stroke" is used: 1. Stroke geometry is drawn first (as background outline) 2. Fill geometry is drawn second (as foreground text) 3. Result: text appears with colored outline effect