Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
TextTypes.h File Reference
#include <memory>
#include <optional>
#include <vector>
#include "donner/base/Path.h"
#include "donner/svg/components/DocumentResourceFamilyBudget.h"
#include "donner/svg/resources/FontManager.h"
Include dependency graph for TextTypes.h:
This graph shows which files directly or indirectly include this file:

Classes

class  donner::svg::TextPathMeasurementReservation
 Lifetime charge for retained text-path measurement geometry. More...
struct  donner::svg::StretchedTextPath
 Shared path mapping used to warp glyph outlines for textPath method="stretch". More...
struct  donner::svg::ResolvedTextFont
 Resolved face and used font size for layout or declaring-element decoration metrics. More...
struct  donner::svg::TextGlyph
 A single positioned glyph in a laid-out text run. More...
struct  donner::svg::TextRun
 A run of positioned glyphs laid out with one primary face. 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.

Functions

FontHandle donner::svg::GlyphFont (const TextRun &run, const TextGlyph &glyph)
 Returns the face that draws glyph: its fallback face when it has one, otherwise the run's.

Class Documentation

◆ donner::svg::StretchedTextPath

struct donner::svg::StretchedTextPath

Shared path mapping used to warp glyph outlines for textPath method="stretch".

Class Members
bool closed = false
bool linear = false
MeasuredPath measuredPath
shared_ptr< TextPathMeasurementReservation > measurementReservation
vector< double > segmentEndDistances
double startOffset = 0.0

◆ donner::svg::ResolvedTextFont

struct donner::svg::ResolvedTextFont

Resolved face and used font size for layout or declaring-element decoration metrics.

Class Members
FontHandle font
float usedSizePx = 0.0f

◆ donner::svg::TextGlyph

struct donner::svg::TextGlyph

A single positioned glyph in a laid-out text run.

Produced by the text engine for simple and full shaping backends.

Class Members
bool absoluteInlinePosition = false This visual chunk origin applies an authored horizontal absolute position.
bool allowSyntheticOblique = true Immutable outline policy resolved from the source span and its requested font style.
uint32_t cluster = 0 Byte offset into the span text for the glyph's source cluster. Byte offset of the SVG positioning group; absent uses the source cluster.
bool emergencyBreakBefore = false A safe emergency boundary precedes this visual glyph group after contextual shaping.
bool emergencyLineStart = false First visual group of a planned line, retaining logical order between backward lines.
FontHandle font Face for a cluster that the run's face cannot render; null when TextRun::font renders it. Use GlyphFont to resolve the face that draws the glyph.
float fontSizeScale = 1.0f Per-glyph font size multiplier (< 1.0 for small-caps).
int glyphIndex = 0 Glyph index (backend-specific: stbtt or HarfBuzz).
bool hangingBefore = false Preserved logical end space hanging before a backward line's visual content.
optional< uint32_t > positioningCluster
bool rightToLeft = false Resolved horizontal source-character direction. Global visual adjacency for source-span decoration continuity; absent on legacy layouts.
double rotateDegrees = 0 Per-glyph rotation in degrees.
bool sideways = false
float stretchScaleX = 1.0f Additional X-axis glyph stretch from lengthAdjust.
float stretchScaleY = 1.0f Additional Y-axis glyph stretch from lengthAdjust.
optional< double > textPathLocalRotateDegrees Authored rotation before path warping. True when vertical layout set this glyph sideways, a quarter turn from upright, so the glyph's own x axis runs along the inline axis.
double textPathNormalOffset = 0.0 Offset from the path along its left normal.
optional< double > textPathOrigin Logical path distance for a stretched outline origin.
double verticalOriginOffset = 0 Inline-axis distance from the pen position to an upright vertical glyph's origin, already included in yPosition. Zero for horizontal and sideways glyphs.
optional< uint32_t > visualOrder
double xAdvance = 0 Horizontal advance; staged paths use canonical local X.
double xKern = 0 Kerning adjustment applied before this glyph (for path layout).
double xPosition = 0 Absolute X position for this glyph.
double yAdvance = 0 Flat vertical advance; zero after text-path staging.
double yPosition = 0 Absolute Y baseline position.

◆ donner::svg::TextRun

struct donner::svg::TextRun

A run of positioned glyphs laid out with one primary face.

Clusters that face cannot render carry their fallback face in TextGlyph::font.

Class Members
FontHandle font Primary font handle for this run.
vector< TextGlyph > glyphs Positioned glyphs.
bool onPath = false True if glyphs are positioned along a textPath.
shared_ptr< const StretchedTextPath > stretchedTextPath Shared nonlinear path mapping.
bool textLengthAppliedOnPath True when path placement consumed this run's textLength.
float usedFontSizePx = 0.0f Font size used for shaping, including font-size-adjust.