ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Convert SVG to MetaPost
@ 2019-08-12 10:10 Jon Wong
  2019-08-12 11:15 ` Taco Hoekwater
  2019-08-12 11:30 ` luigi scarso
  0 siblings, 2 replies; 6+ messages in thread
From: Jon Wong @ 2019-08-12 10:10 UTC (permalink / raw)
  To: ntg-context

Hi all,

Is it possible to convert SVG to MetaPost?

Currently, I have Bash scripts in my workflow to invoke Inkscape (converting SVG to PDF). I don’t like to allow shell access to TeX.

If I can convert SVG to MetaPost, I will gladly Git-track MetaPost files instead of SVG files. That will do away with having to convert SVG into PDF (via Inkscape).

Regards
Jon
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Convert SVG to MetaPost
  2019-08-12 10:10 Convert SVG to MetaPost Jon Wong
@ 2019-08-12 11:15 ` Taco Hoekwater
  2019-08-13  8:37   ` Hans Hagen
  2019-08-12 11:30 ` luigi scarso
  1 sibling, 1 reply; 6+ messages in thread
From: Taco Hoekwater @ 2019-08-12 11:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

> On 12 Aug 2019, at 12:10, Jon Wong <jhannwong@gmail.com> wrote:
> 
> Hi all,
> 
> Is it possible to convert SVG to MetaPost?
> 
> Currently, I have Bash scripts in my workflow to invoke Inkscape (converting SVG to PDF). I don’t like to allow shell access to TeX.
> 
> If I can convert SVG to MetaPost, I will gladly Git-track MetaPost files instead of SVG files. That will do away with having to convert SVG into PDF (via Inkscape).

SVG (and Inkscape) can do many graphical things that metapost can not do, so I think that would be a bad idea even if there was a tool that could do the conversion for some subset of SVG.

That said, SVG is just an XML format, so it should be possible to process simple SVG using ConTeXt’s built-in xml parser (with suitable processing environments, of course). How much work that would entail and whether it is
feasible depends on the actual SVG graphics.

Best wishes,
Taco
 
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Convert SVG to MetaPost
  2019-08-12 10:10 Convert SVG to MetaPost Jon Wong
  2019-08-12 11:15 ` Taco Hoekwater
@ 2019-08-12 11:30 ` luigi scarso
  2019-08-12 11:33   ` Jon Wong
  1 sibling, 1 reply; 6+ messages in thread
From: luigi scarso @ 2019-08-12 11:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 685 bytes --]

On Mon, Aug 12, 2019 at 12:11 PM Jon Wong <jhannwong@gmail.com> wrote:

> Hi all,
>
> Is it possible to convert SVG to MetaPost?
>
> Currently, I have Bash scripts in my workflow to invoke Inkscape
> (converting SVG to PDF). I don’t like to allow shell access to TeX.
>
> If I can convert SVG to MetaPost, I will gladly Git-track MetaPost files
> instead of SVG files. That will do away with having to convert SVG into PDF
> (via Inkscape).
>
>
you can check pstoedit
http://www.calvina.de/pstoedit/pstoedit.htm

it can convert postscript to metapost.
So svg->pdf->ps->mp seems to be possible.
Of course, I am not sure if it fits in  your workflow.

-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 1206 bytes --]

[-- Attachment #2: 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Convert SVG to MetaPost
  2019-08-12 11:30 ` luigi scarso
@ 2019-08-12 11:33   ` Jon Wong
  2019-08-13  8:42     ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Jon Wong @ 2019-08-12 11:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1614 bytes --]

Hi Taco!

Very enlightening!

I’ll just use both MetaPost and SVG for their intended purposes. (SVG will come from workflow involving GIMP/Inkscape; MetaPost for logical, rather than graphical, figures.)

Regards
Jon


> On Aug 12, 2019, at 7:30 PM, luigi scarso <luigi.scarso@gmail.com> wrote:
> 
> 
> 
> On Mon, Aug 12, 2019 at 12:11 PM Jon Wong <jhannwong@gmail.com <mailto:jhannwong@gmail.com>> wrote:
> Hi all,
> 
> Is it possible to convert SVG to MetaPost?
> 
> Currently, I have Bash scripts in my workflow to invoke Inkscape (converting SVG to PDF). I don’t like to allow shell access to TeX.
> 
> If I can convert SVG to MetaPost, I will gladly Git-track MetaPost files instead of SVG files. That will do away with having to convert SVG into PDF (via Inkscape).
> 
> 
> you can check pstoedit 
> http://www.calvina.de/pstoedit/pstoedit.htm <http://www.calvina.de/pstoedit/pstoedit.htm>
> 
> it can convert postscript to metapost.
> So svg->pdf->ps->mp seems to be possible.
> Of course, I am not sure if it fits in  your workflow.
> 
> -- 
> luigi
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 3379 bytes --]

[-- Attachment #2: 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Convert SVG to MetaPost
  2019-08-12 11:15 ` Taco Hoekwater
@ 2019-08-13  8:37   ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2019-08-13  8:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Taco Hoekwater

On 8/12/2019 1:15 PM, Taco Hoekwater wrote:
> Hi,
> 
>> On 12 Aug 2019, at 12:10, Jon Wong <jhannwong@gmail.com> wrote:
>>
>> Hi all,
>>
>> Is it possible to convert SVG to MetaPost?
>>
>> Currently, I have Bash scripts in my workflow to invoke Inkscape (converting SVG to PDF). I don’t like to allow shell access to TeX.
>>
>> If I can convert SVG to MetaPost, I will gladly Git-track MetaPost files instead of SVG files. That will do away with having to convert SVG into PDF (via Inkscape).
> 
> SVG (and Inkscape) can do many graphical things that metapost can not do, so I think that would be a bad idea even if there was a tool that could do the conversion for some subset of SVG.
> 
> That said, SVG is just an XML format, so it should be possible to process simple SVG using ConTeXt’s built-in xml parser (with suitable processing environments, of course). How much work that would entail and whether it is
> feasible depends on the actual SVG graphics.
indeed, and i actually did a partial converter a while ago just to see 
if it could be done but then decided to delay that till i really need it
(normally converting a svg to pdf is quite ok) .. i might pick it up on 
some cold winternight

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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Convert SVG to MetaPost
  2019-08-12 11:33   ` Jon Wong
@ 2019-08-13  8:42     ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2019-08-13  8:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jon Wong

On 8/12/2019 1:33 PM, Jon Wong wrote:
> Hi Taco!
> 
> Very enlightening!
> 
> I’ll just use both MetaPost and SVG for their intended purposes. (SVG 
> will come from workflow involving GIMP/Inkscape; MetaPost for logical, 
> rather than graphical, figures.)
if you have inkscape installed you can do

\externalfigure[test.svg][width=10cm]

and context will handle the conversion

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-13  8:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12 10:10 Convert SVG to MetaPost Jon Wong
2019-08-12 11:15 ` Taco Hoekwater
2019-08-13  8:37   ` Hans Hagen
2019-08-12 11:30 ` luigi scarso
2019-08-12 11:33   ` Jon Wong
2019-08-13  8:42     ` Hans Hagen

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