Getting <text ...> tag of a preset style (5.3.0 pre-alpha text tool)

I’ve been wondering if there’s a way to programmatically get the <text …> tag of a preset style from the new text tool Wolthera is working on in a plugin or script.

What I want to have, ideally, is some kind of dropdown where I can select one of the preset styles, and then programmatically create some editable text with the selected preset’s style by using the same <text …> tag the tool would usually create.

The svg data can be gotten via:

doc=Krita.instance().activeDocument()
node=doc.activeNode()

print("layer", node.toSvg() )

for shape in node.shapes():
    print ("shape", shape.toSvg(True) )

they mean the SVG from one of the new CSS style presets.

Right now, not really, none of the new text stuff is exposed to python at the moment. I just straight up didn’t have the time.

1 Like

I figured, getting everything up and running first takes priority after all.

Incredible work by the way. The new typesetting mode goes above and beyond everything I ever hoped for from the tool!

1 Like

Thanks! You’re the first person who’s told me they tried it, so I was super nervous how it would land. This really takes a load of me!

1 Like

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.