Bug 508361 - `toSvg` ignores text transforms
Summary: `toSvg` ignores text transforms
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (other bugs)
Version First Reported In: 5.2.9
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-16 18:53 UTC by Sabrina Jewson
Modified: 2025-08-16 18:53 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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