Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
PlacedTextGeometry.h File Reference

Shared, backend-agnostic text geometry for RendererInterface::drawText. More...

Include dependency graph for PlacedTextGeometry.h:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
namespace  donner::svg
 Donner SVG library, which can load, manipulate and render SVG files.

Functions

Path donner::svg::TransformPath (const Path &path, const Transform2d &transform)
 Apply an affine transform to every point of a path.
Path donner::svg::PlacedGlyphOutline (const TextEngine &textEngine, FontHandle font, const TextGlyph &glyph, float scale)
 Build the placed outline for a single glyph in document space.
Box2d donner::svg::ComputeTextBounds (const TextEngine &textEngine, const std::vector< TextRun > &runs, std::span< const components::ComputedTextComponent::TextSpan > spans, const Box2d &viewBox, const FontMetrics &fontMetrics, float fontSizePx)
 Compute the text element's bounding box for objectBoundingBox paint.

Detailed Description

Shared, backend-agnostic text geometry for RendererInterface::drawText.

RendererTinySkia::drawText and RendererGeode::drawText historically each re-derived per-glyph placement (outline → stretch → translate → rotate), which let the two copies drift (see docs/design_docs/0038). This header is the shared placement layer both backends consume so the geometry is computed once. It encodes tiny-skia's behavior verbatim (tiny-skia is the parity reference); geode converges to it.

Pure geometry only: inputs/outputs are donner::Path / Transform2d / TextEngine — no backend paint types. No allocation beyond what Path itself does; no exceptions.