ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: mf via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: mf <massifr@fastwebnet.it>
Subject: Re: SVG not rendering correctly with LMTX and conversion=mp
Date: Mon, 18 Oct 2021 23:20:27 +0200	[thread overview]
Message-ID: <2fc646dc-16f3-40e7-5561-418cb3cc149a@fastwebnet.it> (raw)
In-Reply-To: <01620710-a4cb-c8f7-f033-edfb48b9a8a4@xs4all.nl>

[-- Attachment #1: Type: text/plain, Size: 1609 bytes --]

Il 18/10/21 18:30, Hans Hagen via ntg-context ha scritto:
> 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).
> it is supported; i'll send you a snippet to test (as it was not really a 
> minimal example)
> 

Coming soon... (see attachment)

The problem was the order in which transformations are applied when 
multiple transformations are specified in the transform attribute, like 
in "translate(...)scale(...)...".

testsvg.tex and test.svg are the MWE and the SVG file provided by Jason 
Ross in the first post of this thread.

Massi

[-- Attachment #2: testsvg.pdf --]
[-- Type: application/pdf, Size: 24501 bytes --]

[-- Attachment #3: testsvg.tex --]
[-- Type: text/x-tex, Size: 63 bytes --]

\starttext
\externalfigure[test.svg][conversion=mp]
\stoptext 

[-- Attachment #4: test.svg --]
[-- Type: image/svg+xml, Size: 24353 bytes --]

[-- Attachment #5: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2021-10-18 21:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 15:15 Jason Ross via ntg-context
2021-10-18 15:38 ` Luis Montgomery via ntg-context
2021-10-18 15:49   ` Jason Ross via ntg-context
2021-10-18 16:16     ` Luis Montgomery via ntg-context
2021-10-18 16:06 ` mf via ntg-context
2021-10-18 16:30   ` Hans Hagen via ntg-context
2021-10-18 16:33     ` mf via ntg-context
2021-10-18 21:20     ` mf via ntg-context [this message]
2021-10-18 16:40   ` Hans Hagen via ntg-context
2021-10-18 20:38 ` Hans Hagen via ntg-context
2021-10-18 20:58 ` Luis Montgomery via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2fc646dc-16f3-40e7-5561-418cb3cc149a@fastwebnet.it \
    --to=ntg-context@ntg.nl \
    --cc=massifr@fastwebnet.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).