Converts drawfiles to SVG (Scalable Vector Graphics) format, for import into various applications on Mac or PCs (or of course on any computer, if it has an app that handles SVG files). I’ve tested it with Safari, Firefox, LibreOffice, Inkscape and The GIMP on a Mac.

For a few example drawings that I originally drew in !Draw and which are now SVGs, see SVGsamples.

It doesn’t do a perfect job, but it’s not bad and I’ll improve it in time. It does a good job of solid lines and curves, and gets stroke widths, fills and colours correct. Line patterns are also correct.

View Boxes! You can make a “view box” so that only what’s inside the box will be rendered by SVG rendering apps. To do this, make a rectangle corresponding to the area you want to be visible, with no fill, and a “thin” line outline in the darkest shade of grey (not black) of !Draw’s default palette. !XP1Dr2SVG will convert this into an SVG View Box. Don’t use thin line outlines in this shade of grey, with no fill, for anything else – they won’t appear in the SVG file, and you’ll end up with a view box equal to the bounding box of whichever such path is on top.

Thin Lines !Draw renders lines of zero width (“thin” lines) as the thinnest lines the current medium can display. !XP1Dr2SVG converts them to 0.25pt, because otherwise SVG doesn’t render them at all. If you want a thinner line than 0.25pt, you can specify it in !Draw.

Arrowheads If you have triangular ends (arrowheads) on any lines, these are all converted to a standard size (equivalent to Width 2, Height 4 in !Draw terms). They’re also all black, regardless of the colour of the line they’re attached to. I will improve this fairly soon, matching colour and arrowhead dimensions. LibreOffice ignores them completely (it has its own idiosyncratic method of making arrowheads), but the other applications all recognize them.

!Draw has a peculiarity that arrowheads on lines are applied to the ends of dots and dashes in dotted and dashed lines.

(a) This would be incredibly difficult to reproduce in SVG, and
(b) isn’t usually what you really want anyway (although I have made use of it in “show windings” in !XP1PathEd).

This is NOT reproduced by !XP1Dr2SVG: it just puts arrowheads on the ends of whole lines. Unlike the other apps, the GIMP puts arrowheads on the ends of subpaths – but not on dashes like !Draw does.

SVG doesn’t allow different endcaps on the ends of lines (apart from arrowheads). There’s a way around this (now implemented) for solid lines, but not exactly for dashed lines.

Text !XP1Dr2SVG converts Trinity to Times, Homerton to Arial, Corpus to Courier – and everything else to Arial. These three fonts can be rotated to any angle, OR have different height and width (that is, condensed or expanded) - but NOT both at once. If you want other fonts, or rotated extended or rotated condensed text, or any kind of skewed text, converted faithfully, convert them to path in !Draw first. It’s unlikely I’ll do anything more than this with text. This is enough to cope with almost everything in my own work. I’ve only done this much to keep file sizes down and maintain editability after conversion.

* I can make other fonts convert where there are clear equivalences between RISC OS fonts and those on other systems – but I don’t want to end up converting to fonts that might not be available on the target systems. I’ll probably do some of this for my own system, and the font table in !RunImage is pretty obvious and easily edited if you want to. The table can be extended to as many fonts as !Draw can handle (255) with no complications.

Sprites !XP1Dr2SVG doesn’t convert Sprites. They are simply ignored. I do not intend to do anything about this. I might make jpegs transfer over, now that !Draw can handle them.

An oddity when importing to LibreOffice Draw worth being aware of: if you open an SVG file in LibreOffice, if there are paths with a “nonzero” winding rule (as distinct from an “evenodd” winding rule), they’ll appear as “evenodd” – but if you open a blank drawing and drag and drop the file onto the draw window, LibreOffice gets it right! (This applies to the version of LibreOffice I updated to yesterday – it may not apply to all versions.)

Download XP1Dr2SVG here

(It’s a self-extracting archive, so all you have to do is download the file into a suitable directory, set the file type to FFC, and double-click on it, which will create the whole application in the same directory. You can then delete the original downloaded file.)