Table of Contents

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

textElement SvgTextContentElement

The SVG text element being rendered

brush Brush

The fill brush (or null for stroke-only)

pen Pen

The stroke pen (or null for fill-only)

geometry Geometry

The 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