Closed bitgenerator closed 1 week ago
Currently, no.
@bitgenerator Text nodes manipulation has been added in the latest commit. Here's an example:
auto data = R"SVG(<svg xmlns="http://www.w3.org/2000/svg">
<text id='a' y='120' font-size='120'> Hello World</text>
</svg>)SVG";
auto document = Document::loadFromData(data);
auto text_element = document->getElementById("a");
auto text_node = text_element.children().front().toTextNode();
text_node.setData("I love SVG!!!");
document->updateLayout();
This should help you modify the text content as needed.
Thanks a lot! I've written a similar function but it's good to have a official change. ;-)
Is there a way to change the text of a text or tspan node, like the attributes?