Re: [artworks] SVG scale

  • From: Jim Lesurf <jcgl@xxxxxxxxxxxxxxx>
  • To: artworks@xxxxxxxxxxxxx
  • Date: Fri, 13 Jan 2017 09:41:05 +0000 (GMT)

In article <2e7b69fd55.jim@xxxxxxxxxxxxxx>, Jim Nagel
<aw@xxxxxxxxxxxxxxxx> wrote:

Jim Lesurf  wrote on 12 Jan:
Out of curiosity I just drew a quick scribble in AW and exported it as
SVG. If I load the result into a text editor I can see the values for
the locations, etc. Plus it has a scaling matrix. For simple objects
I'd guess rescaling was easy. However although the top of the file
declares the content to be a W3C fomat it doesn't give details of the
scaling factors. The values given in this case seem to all be integers.

My hunt-around found two utilities to convert SVG to drawfile: -
draw2svg by Steven Simpson
http://www.lancaster.ac.uk/~simpsons/software/pkg-draw2svg ;(2007-2012) -
XP1dr2svg by Clive Semmens http://clive.semmens.org.uk/RISCOS/index.html
(2016)

One of these authors in his blurb decries a particular foreign
application that writes what he calls "VG" files -- ie, they have a
fixed factor that seems to contradict the whole idea of "scalable".

Hmm, if the utility acts as a plugin (or can be called from the
commandline), maybe we could suggest to Martin that it'd be nifty to be
able to drop an SVG file straight into Artworks.

FWIW I did a quick SVG using AW and experimented with altering the
'transform' element near the start of the content. Did this purely on a
'hunt and peck' basis having no idea of the explicit definition of the
transform or the co-ordinate system. But changing

<g transform="matrix(1 0 0 -1 0 2058.6016)" stroke-miterlimit="16"
fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="bevel"
stroke-linecap="butt">

into

<g transform="matrix(0.5 0 0 -0.5 150 1220)" stroke-miterlimit="16"
fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="bevel"
stroke-linecap="butt">

Did seem to scale down the objects when drawn by what looked like a factor
of two.

So I suspect a utility to scale the results might be fairly simple if we're
lucky. But no doubt there may be snags I didn't encounter with such a
simple test!

I used NetSurf to render the results.

Not sure it is relevant here but wrt SVG -> Drawfile it occurs to me that
it should also be possible to write a convertor that reads an SVG and
generates a list of the commands that my old !DrawGen takes to create a
DrawFile.

Jim

-- 
Electronics  http://www.st-and.ac.uk/~www_pa/Scots_Guide/intro/electron.htm
Armstrong Audio  http://www.audiomisc.co.uk/Armstrong/armstrong.html
Audio Misc  http://www.audiomisc.co.uk/index.html

------------------------------------------------------------
    To change, suspend or cancel your subscription go to
           //www.freelists.org/list/artworks
------------------------------------------------------------

Other related posts: