Bug 508361

Summary: `toSvg` ignores text transforms
Product: [Applications] krita Reporter: Sabrina Jewson <sejewson>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.2.9   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Sabrina Jewson 2025-08-16 18:53:33 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY

[toSvg](https://api.kde.org/krita/html/classShape.html#aa9cc7dbe137e7edb123f0611f6fd9555) ignores transforms that have been applied to text objects.

STEPS TO REPRODUCE
1. Insert some text on a new layer
2. Open the scripter and run:

```python
import krita
k=krita.Krita.instance()
d=k.activeDocument()
n=d.activeNode()
print(n.shapes()[0].toSvg())
```

OBSERVED RESULT

There is no `transform=` on the text.

EXPECTED RESULT

There is a `transform=` attribute, and the coordinates and transforms of the text is lost. If you retry this experiment with a rectangle, a transform attribute is included.

This is especially noticeable in groups: it is currently impossible to losslessly convert a group to/from SVG (via `toSvg` and `addShapesFromSvg`), because all the text ends up bunched up in the top left of the group.

SOFTWARE/OS VERSIONS

Qt Version: 5.15.11

ADDITIONAL INFORMATION