Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
ComputedTextComponent.h File Reference
#include "donner/base/Length.h"
#include "donner/base/RcString.h"
#include "donner/base/SmallVector.h"
Include dependency graph for ComputedTextComponent.h:

Classes

struct  donner::svg::components::ComputedTextComponent
 Pre‑computed layout information for a text subtree. More...
 
struct  donner::svg::components::ComputedTextComponent::TextSpan
 A contiguous slice of text with fully resolved layout attributes. More...
 

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.
 
namespace  donner::svg::components
 Contains the implementation of the Donner ECS,.
 

Class Documentation

◆ donner::svg::components::ComputedTextComponent

struct donner::svg::components::ComputedTextComponent

Pre‑computed layout information for a text subtree.

A ComputedTextComponent is attached by the layout system to the root "<text>" element after all "<text>", "<tspan>", and xml_textPath descendants have been resolved. It stores the final, absolute positions for each contiguous slice of text, allowing the renderer to iterate quickly without re‑evaluating attribute vectors on every frame.

The component contains a single public field, spans, which is the computed list of text spans.

Note
This structure is internal to the rendering pipeline and is not exposed through the public DOM API.
Collaboration diagram for donner::svg::components::ComputedTextComponent:
[legend]
Class Members
SmallVector< TextSpan, 1 > spans

◆ donner::svg::components::ComputedTextComponent::TextSpan

struct donner::svg::components::ComputedTextComponent::TextSpan

A contiguous slice of text with fully resolved layout attributes.

Offsets start and end refer to UTF-8 byte positions into the parent string stored in text. All coordinate and rotation values are given in the user coordinate system and already include any inherited transformations from ancestor "<text>" elements.

Collaboration diagram for donner::svg::components::ComputedTextComponent::TextSpan:
[legend]
Class Members
Lengthd dx Relative X shift applied to the span.
Lengthd dy Relative Y shift applied to the span.
size_t end Byte index (exclusive) one past the last code unit of the span within text.
Lengthd rotate Rotation applied to each glyph in the span (degrees).
size_t start Byte index (inclusive) of the first code unit of the span within text.
RcString text Back‑reference to the original text for this span.
Lengthd x Absolute X position for the first glyph of the span.
Lengthd y Absolute Y baseline position for the span.