|
|
Donner 0.5.0
Embeddable browser-grade SVG2 engine
|
Shared SVG text engine. More...
#include "donner/svg/text/TextEngine.h"
Public Member Functions | |
| TextEngine (FontManager &fontManager, Registry ®istry) | |
| TextEngine (FontManager &fontManager, Registry ®istry, std::unique_ptr< TextBackend > backend) | |
| Test-only constructor that injects a custom TextBackend. | |
| TextEngine (const TextEngine &)=delete | |
| TextEngine & | operator= (const TextEngine &)=delete |
| void | addFontFace (const css::FontFace &face) |
| void | addFontFaces (std::span< const css::FontFace > faces) |
| void | prepareForElement (EntityHandle handle, ParseWarningSink &warningSink) |
Prepare text dependencies for the text root containing handle. | |
| std::vector< TextRun > | layout (const components::ComputedTextComponent &text, const TextLayoutParams ¶ms) |
| Lay out all spans, returning positioned glyph runs. | |
| FontVMetrics | fontVMetrics (FontHandle font) const |
| float | scaleForPixelHeight (FontHandle font, float pixelHeight) const |
| float | scaleForEmToPixels (FontHandle font, float pixelHeight) const |
| std::optional< UnderlineMetrics > | underlineMetrics (FontHandle font) const |
| std::optional< UnderlineMetrics > | strikeoutMetrics (FontHandle font) const |
| std::optional< SubSuperMetrics > | subSuperMetrics (FontHandle font) const |
| Path | glyphOutline (FontHandle font, int glyphIndex, float scale) const |
| bool | isBitmapOnly (FontHandle font) const |
| std::optional< TextBackend::BitmapGlyph > | bitmapGlyph (FontHandle font, int glyphIndex, float scale) const |
| std::optional< double > | measureChUnitInEm (std::span< const RcString > fontFamilies) |
| Measure the ch unit in ems for the given font-family cascade. | |
| void | resolvePerSpanLayoutStyles (EntityHandle textRootHandle, components::ComputedTextComponent &text) const |
| Resolve per-span layout-affecting style state on a computed text tree. | |
| const components::ComputedTextGeometryComponent & | ensureComputedTextGeometryComponent (EntityHandle handle) const |
Ensure cached text geometry exists for the text root containing handle. | |
| std::vector< Path > | computedGlyphPaths (EntityHandle handle) const |
Return glyph outlines for the text subtree rooted at handle. | |
| Box2d | computedInkBounds (EntityHandle handle) const |
Return the ink bounds for the text subtree rooted at handle. | |
| Box2d | computedObjectBoundingBox (EntityHandle handle) const |
Return the object bounding box for the text subtree rooted at handle. | |
| long | getNumberOfChars (EntityHandle handle) const |
Return the number of addressable characters for the text subtree rooted at handle. | |
| double | getComputedTextLength (EntityHandle handle) const |
Return the computed text length for the text subtree rooted at handle. | |
| double | getSubStringLength (EntityHandle handle, std::size_t charnum, std::size_t nchars) const |
Return the substring length for the text subtree rooted at handle. | |
| Vector2d | getStartPositionOfChar (EntityHandle handle, std::size_t charnum) const |
Return the start position of a character for the text subtree rooted at handle. | |
| Vector2d | getEndPositionOfChar (EntityHandle handle, std::size_t charnum) const |
Return the end position of a character for the text subtree rooted at handle. | |
| Box2d | getExtentOfChar (EntityHandle handle, std::size_t charnum) const |
Return the extent of a character for the text subtree rooted at handle. | |
| double | getRotationOfChar (EntityHandle handle, std::size_t charnum) const |
Return the rotation of a character for the text subtree rooted at handle. | |
| long | getCharNumAtPosition (EntityHandle handle, const Vector2d &point) const |
Return the character index at the given point for the text subtree rooted at handle. | |
Shared SVG text engine.
Owns the selected text backend and provides layout plus font-related operations while hiding backend selection from callers.
Usage: