|
|
Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
|
Pure text-to-outline conversion helper, decoupled from ImGui and from the editor shell so it can be unit-tested headlessly (see donner/editor/tests/TextToOutlines_tests.cc). More...
#include <optional>#include <string>#include <vector>#include "donner/svg/SVGDocument.h"#include "donner/svg/SVGElement.h"Classes | |
| struct | donner::editor::ConvertTextToOutlinesResult |
| Result of preparing a text-to-outline conversion. More... | |
Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
Functions | |
| ConvertTextToOutlinesResult | donner::editor::convertTextToOutlines (svg::SVGDocument &document, const svg::SVGElement &textElement) |
Prepare a text-to-outline conversion of textElement within document. | |
Pure text-to-outline conversion helper, decoupled from ImGui and from the editor shell so it can be unit-tested headlessly (see donner/editor/tests/TextToOutlines_tests.cc).
This implements the structural core of "Convert Text to Outlines":
The conversion is DOM-first: it builds unattached DOM elements and never mutates the document. The caller applies it as ordinary structural DOM edits - insert the group before the <text> (preserving paint order), insert each path into the group, delete the <text> - through the editor's mutation seam (EditorCommand::InsertElementCommand / DeleteElementCommand), so source reflection emits deltas and entity identity elsewhere in the document survives.
Error handling: if glyph-outline extraction fails or yields empty outlines, the function fails as a whole (ok == false, no elements created in the document tree) and the caller must not mutate the document.
|
nodiscard |
Prepare a text-to-outline conversion of textElement within document.
Builds detached replacement elements; does not attach them or mutate the document tree. See file comment for outline extraction, grouping, and style preservation semantics.
| document | Document containing textElement. |
| textElement | The <text> element to convert. Must be a <text> element belonging to document. |