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 18:06:46 +0200	[thread overview]
Message-ID: <a72bf826-7e42-ddd1-36b9-840d98b52872@fastwebnet.it> (raw)
In-Reply-To: <498c7a1d-1c3f-cd20-6c78-9edc58868461@gmail.com>

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

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).

Massi

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

[-- Attachment #3: 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 16:06 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 [this message]
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
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=a72bf826-7e42-ddd1-36b9-840d98b52872@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).