Draw file export
David R. Lane (77) 766 posts |
I need to export a Draw file to someone who is unlikely to use RISC OS. What is the best format to convert it to, and which is the best RISC OS application to use to achieve this? By ‘best’ I mean smallest file size, most accurate and any other desirable property. The Draw file will consist of lines, a circle and some text, but no sprites. I have found some possibilities using DPlngscan or DrawToSprite, for example. One article, found from a DuckDuckGo search, seemed to suggest Netsurf can be used; but, whereas Netsurf will display a Draw file, I didn’t see an option to save it as anything other than a Draw file. |
Stuart Swales (8827) 1357 posts |
I have exported several Draw files created on RISC OS by using OakDraw (now free) on Windows – OakDraw can export directly to SVG, and I’ve used these on web sites OK. |
David Boddie (1934) 222 posts |
Maybe Clive’s XP1Dr2SVG is what you’re looking for. See this discussion for details. |
Paul Sprangers (346) 524 posts |
If you happen to have ArtWorks, then import your Draw file and export it as SVG. You should probable tick ‘Export text as shapes’. |
David Boddie (1934) 222 posts |
Thinking about Paul’s answer, even printing to PostScript would be a good first step. Alternatively, PrintPDF might also be an option. |
David R. Lane (77) 766 posts |
I have tried Clive’s XP1Dr2SVG and the resulting SVG file opened in Libre Office Draw on Linux. It was a very simple Draw file with a few lines some with arrow heads at the ends and a little text. It looked fine in Libre Office Draw except that the arrow heads (what Draw calls triangle ends) looked smaller than in the original where the triangles had width 6 and height 15. It doesn’t matter much for my purpose. I didn’t convert the text to paths, but it came out just fine. I have just read in the Help file that all arrowheads come out with dimensions width 2 and height 4 in Draw sizes, but it says “I will improve this fairly soon, to make colours and dimensions correct”. The Help file is dated 10/09/17! So, thank you Clive for the application. By the way, what does the XP1 signify in part of the application name? I don’t use Mickeysoft and so OakDraw is a non-starter for me. I don’t have Artworks as I don’t have a use for it. |
Clive Semmens (2335) 3276 posts |
Oops. “Fairly soon…” I suppose time dilates terribly as one gets older…I’ll have a look at this, in case it bites anyone else. I’ve a feeling there’s an issue with the colours, and LibreOffice Draw renders SVG a bit differently from other apps – or the version I had at the time did, I’ll check that I’ve got the most recent update before I look at this again.
It’s registered with ROOL or Acorn or someone. I used to have a little business making RISCOS fonts back in 224 glyph days, Xenophilia Fonts – hence XP, but XP was taken so they registered me as XP1. XPF would probably have been better, but that’s water under the bridge. |
David R. Lane (77) 766 posts |
In topic Draw → SVG, see here , |
Clive Semmens (2335) 3276 posts |
I’ve had a look at what’s required to make arrowheads match the ones in the Drawfile, and while it’s perfectly possible to do, it’s non-trivial to make the general case work. How many people want non-black and/or different size* arrowheads? Let me know if you do – if no-one speaks up, I won’t bother until I want them myself… * different size meaning in a different ratio to the line width. Arrowheads do scale with the line width as is. |
Jean-Michel BRUCK (3009) 359 posts |
To export draw files, you can also use !Draw2DXF, !Draw→WMF or !Draw2SVG. |
David J. Ruck (33) 1635 posts |
Clive, sorry to be awkward, I always use non standard arrow heads. |
Clive Semmens (2335) 3276 posts |
Non-standard height and width? Coloured lines? Or both? (Draw only lets you have the same colour arrowheads as the line; SVG defines the arrowhead colours independently & doesn’t provide for inheritance. So for every colour used on lines that have arrowheads I need to define a matching coloured arrowhead – or multiple ones if there are multiple different heights &/or widths.) When people reported comparisons between the various other programs’ “save as SVG” options, none of them did a great job. Mine isn’t perfect either, but four years ago people seemed to think it was better than the others. |
David J. Ruck (33) 1635 posts |
I like mine more pointy, but the same colour as the line. |
David R. Lane (77) 766 posts |
Clive, I also have non-standard arrowheads, usually with a width to height ratio of 6:15. My arrowhead lines have always been black. Does anyone know how well Draw version 2.27 (from the RISC OS ‘Select era’) exports to SVG compared with the other applications mentioned above? The Draw in current ROMs should include export to SVG, just as TechWriter/EasiWriter includes export to MS Word, RTF, HTML etc. or Fireworkz and Eureka include export to CSV. One for the wish list? |
Chris Hall (132) 3554 posts |
Perhaps, one day, Windows will acquire a standard vector graphic format. WMF (Windows Meta File) seems to have become less popular. |
Clive Semmens (2335) 3276 posts |
Okay. The demand is clearly there for fairly generalized treatment. Don’t promise a very quick timescale, but shouldn’t be all that long! I’ll make all arrowheads match the line colours as per Draw, and the sizes match whatever you do in Draw. What I do not intend to do is make the arrowheads repeat on every dash in a dashed line, which is what Draw does. SVG doesn’t, although some apps render then on control points…not sure whether that’s the official behaviour or not, some apps don’t! |
Clive Semmens (2335) 3276 posts |
Okay – http://clive.semmens.org.uk/RISCOS/XP1Dr2SVG.html is now updated to put correctly sized and coloured arrowheads and endcaps on lines. What it still doesn’t do is put them on the ends of dashes within dashed lines – which is rarely what I want anyway. Since it is occasionally what I want, I might implement it one day. In the course of sussing out enough of SVG to improve the endcaps and arrowheads I’ve discovered how it could be done, but I’d want to be able to switch it on and off, preferably on a line-by-line basis, so I’d have to have some way of marking in Draw which lines to process which way. I have some ideas about how to do that…and similar tricks that would make it possible to specify a different colour for arrowheads if anyone wanted to do that. I can imagine uses. There is of course a simple trick for doing different coloured endcaps/arrowheads anyway: copy the line on top of itself, with the arrowheads only on the underneath one. |
Matthew Phillips (473) 721 posts |
We find arrowheads repeating on each dash very useful for doing one-way streets in RiscOSM but for most other purposes the feature is not helpful! |
Clive Semmens (2335) 3276 posts |
I also use it to show which way the winding goes on paths, to know whether a closed path will be emboldened or skinnified by my Embolden app, but that use doesn’t go outside RISCOS, so converting it to SVG isn’t relevant. But in recent updates of SVG there’s a feature for repeating arrowheads along a line, so it’s possible to make it work – even with chain lines (or the more complex dash patterns XP1ReDraw can generate). Care needed to avoid the arrowheads ending up in the wrong places relative to the dashes though! Not a trivial job – but with sufficient encouragement I might get round to it! Relatively easy if the feature is only required on one pattern of dashed line, if that’s any help. |