|
NovaSVG 0.10.0
A header-only SVG library
|
Renders the (HTML-ish) content captured inside a <foreignObject>. More...
#include <svgelement.h>

Public Member Functions | |
| virtual | ~ForeignObjectRenderer ()=default |
| virtual void | render (const SVGForeignObjectElement *element, SVGRenderState &state) const =0 |
Renders the (HTML-ish) content captured inside a <foreignObject>.
This is an extension point on purpose: ForeignObjectSimple below only understands a small, deliberately shallow slice of HTML5 – it strips every tag (div/span/p/i/b/...) and just draws the remaining plain text centered in the foreignObject's box, using the font/fill already inherited through the normal SVG/CSS cascade. That's enough to cover what tools like Mermaid actually emit (a single short, non-wrapping, centered text run per foreignObject), without pretending to be a real HTML/CSS layout engine.
A more complete renderer (e.g. one backed by litehtml) can be hooked in later without touching SVGForeignObjectElement itself: implement this interface and call SVGForeignObjectElement::setRenderer() (or replace ForeignObjectSimple::instance() below) to swap it in.
Definition at line 1145 of file svgelement.h.
|
virtualdefault |
|
pure virtual |
Implemented in novasvg::ForeignObjectSimple.
Referenced by novasvg::SVGForeignObjectElement::render().