On 10/18/2021 6:06 PM, mf via ntg-context wrote:
Il 18/10/21 17:15, Jason Ross via ntg-context ha scritto:
The following MWE fails to render the text in the attached SVG properly:
\starttext \externalfigure[test.svg][conversion=mp] \stoptext
The axis labels, tick labels, and title are all incorrect. This file was generated with Matplotlib.
If you open test.svg with Inkscape, ungroup and then save, you get a SVG that is typeset right with LMTX.
Looking at the differences between the two SVGs, I can see that Inkscape changes all the transform="translate(...)scale(...)" attributes into transform="matrix(...)".
Now focus on the "y = sin(x)" text. In the attachment I modified the transform attributes of that text, from "translate(...)scale(...)" to "matrix(...)", taking the values from the version obtained from Inkscape.
Use that SVG with your MWE and you'll see "y = sin(x)" appearing in the right place in the PDF.
I would say the "translate(...)scale(...)" specification is not supported in LMTX (yet). does the spec say anywhere what teh order is?
<!-- g transform="translate (14.118498 132.66443) rotate (-90) scale (0.1 -0.1)" --> this looks better but <g transform="scale (0.1 -0.1) rotate (-90) translate (14.118498 132.66443) "> how about 10 scales and 15 rotations and 3 transforms in any order? Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------