Draw -> SVG
Clive Semmens (2335) 3276 posts |
Sorry, no. ARM did once put me through a C++ course, which I passed no problem, but I’ve never used C in anger. ARM Assembly language and BBC BASIC are my languages (well, Fortran, COBOL and PDP8 & IBM 3790 Assembly languages way back in the distant past). This app is all in BASIC.
Can do, but it’s an awfully easy wheel to reinvent! Will put one on my website and link from here later this afternoon. |
Clive Semmens (2335) 3276 posts |
http://clive.semmens.org.uk/RISCOS/TestSVG is the DrawFile – just set its type to aff and there you go. The result from !XP1Dr2SVG is in http://clive.semmens.org.uk/RISCOS/TestResult.svg – there are some things there I can fix but haven’t yet, and some that really aren’t a practical proposition, mostly described in the help file and the “More About…” on my website. http://clive.semmens.org.uk/RISCOS/TestResult2.svg is the result with the text converted to path first. I don’t currently convert text, and never will do a thorough job – see the help file for what I do intend to do. I didn’t have a test file like this – just made quick and dirty test files to test specific issues, and converted damn great old files I needed for my own purposes. |
Chris Evans (457) 1614 posts |
TestResult2.svg viewed in the latest FireFox 45.0.1 on Windows 10 |
Clive Semmens (2335) 3276 posts |
You’re seeing exactly what I’m seeing in every application except the GIMP (slightly different there as described below) – which is exactly what I expected to see. SVG doesn’t do endcaps that are different on each end, apart from arrowheads. I can bodge that for lines 1-3, by making a round arrowhead, but I haven’t done it yet. It won’t work for dashed lines, because SVG doesn’t put arrowheads on every dash, only on the ends of lines – as you can see on line 7. The rendering of line 8 varies between apps – the GIMP renders it just like !Draw does, but the other apps I have render just one arrowhead on the end. I can fix the black arrowhead on the green line, and the fact that the size of the arrowheads doesn’t follow the size of them in !Draw – when I get round to it. What I’m really interested to know is what the output from “Save As SVG” in versions of !Draw that have that facility looks like when the test file’s loaded into them. |
David Pitt (102) 743 posts |
Emailed. |
Clive Semmens (2335) 3276 posts |
Cheers Dave! So basically:
|
edwardx (1628) 37 posts |
Let’s not forget draw2svg. It can do text to path conversion. Also: “path objects with triangular caps or different start and end caps, which are each converted to a capless path overlayed with another path to draw the caps” |
Clive Semmens (2335) 3276 posts |
If it does what it says on the tin, edwardx, it sounds like pretty much what I was aiming at – I couldn’t forget it because I didn’t know about it. Now I’ve got this far I think I’ll just finish the job anyway. Mine will be less of a faff to install – no “front-end, back-end” and Unix library to think about: it’s a plain vanilla app that you can put wherever you like (written in BBC BASIC). Thanks for the heads up though! |
Clive Semmens (2335) 3276 posts |
Updated – it no longer ignores text. It converts Trinity to Times, Homerton to Arial, and Corpus to Courier. Any other font it converts to Courier, so in general you’re likely to want to convert those to path in !Draw – or if you have corresponding fonts on your target system, it’s fairly obvious how to edit the font table in !RunImage. I’ve not bothered to investigate what other fonts commonly on Acorn systems have equivalents that are reliably available on other systems – if anyone cares to tell me about any, I can update to include them in the table in the downloadable app. It does bold, italic (or oblique) and bold italic (or oblique) as well as medium, allows for different font height and width, and allows for rotated text. If you have rotation on the same piece of text as different height and width, it ignores the width value – if you have those and want them to come across correctly, convert them to path first. It also won’t do any kind of skewed text faithfully. I will not be bothering to sort out such corner cases – you’ll just have to convert to path to get them across correctly. Still to do: adjustable, correctly coloured arrowheads and the best compromise for various combinations of linecaps. |
Clive Semmens (2335) 3276 posts |
Updated again this morning in response to emails: (1) It now filetypes its output SVG (&AAD) so it’s recognized as SVG on RISCOS as well as on other systems; (2) Fonts other than Trinity, Corpus or Homerton are now converted to Arial rather than Courier, resulting in more sensible line lengths. Those three are still converted to Times, Courier and Arial respectively, of course. |
Clive Semmens (2335) 3276 posts |
Updated again. I found a bug… Vertical text caused a Division By Zero error. Simple case of using ATN to find the angle…y/x is y/0 for vertical text… Investigating that realized that ATN can’t distinguish between 1st & 3rd quadrant, or between 2nd & 4th, so any text in those quadrants would have come out 180° awry. All fixed now and on my website (link above). |
Clive Semmens (2335) 3276 posts |
A couple of examples of real Draw files converted to SVG by !XP1Draw2SVG here (also examples of !Xp1ReDraw’s dashed lines and other tricks): http://clive.semmens.org.uk/CV.html?Art%2FMaps – this URL is an example of “security by obscurity”: it’s not linked on my website. They’re really rather spoilers for my novels :( |
Clive Semmens (2335) 3276 posts |
http://clive.semmens.org.uk/RISCOS/SVGSamples.html now somewhat more browser-fiendly. |
Rick Murray (539) 13850 posts |
You did that in Draw? Whoa! |
George T. Greenfield (154) 749 posts |
Know the feeling….! |
Clive Semmens (2335) 3276 posts |
Yup. I can’t actually think of a package I’d rather work in for vector graphics – possibly because I know Draw better than anything else, but probably also because I know (and like) the file format so I can write programs to create things like those railway lines and rivers, or to link up paths etc. etc. Draw is one of my main reasons for still using RISC OS – Draw, BBC BASIC, & ARM assembler. I’d like to get Zap back – I don’t currently have a working version 8~( – that was another favourite. The other thing I’d like is NetSurf working on the same set up as my big screen modes – currently I have one SD card with an old RC14 and working NetSurf that only supports 1920×1200, and another SD card with a later RC14 that supports up to 3840×2160 but on which NetSurf doesn’t work. At the moment to get something from the Pi in a big mode to the Mac, I have to save to the Pi’s hard drive, switch SD cards, and then email myself…probably something quite stupid like having NetSurf set up wrong (it starts but crashes as soon as you try to talk to the world), but I managed to set it up on the old RC14… |
Rick Murray (539) 13850 posts |
I preferred DrawPlus. It was almost exactly like Draw, only with all those little things you wish Draw did, like cursors to nudge objects, etc. I have OpenVector which I’m trying to get to grips with, but it seems kind of overkill for my drawing needs. Still, beats plain old Draw. ;-)
Ah, yes. That could make a huge difference.
I like the fact that the entire system and its applications are much simpler. No horrible bloat, and nothing goes to lengths to second-guess what you’re trying to do. Oh, and RISC OS is maybe the last bastion of sanity where software does not routinely spy on users and everything isn’t full of ***ty advertising. You see that blank column to the right below the navigation stuff? On most other websites, one would expect to see adverts from Amazon, PC World, and so on. Or how about a message pop up from the DisplayManager icon to tell you that you can buy a 4K display for only £££ by clicking the link…?
There’s something very pleasing about mindless hacking in ARM code.
You don’t? I got Tank’s original OMAP version, and the more recent update that fixes a number of ZPP issues: http://www.tankstage.co.uk/Software/ and then http://www.tankstage.co.uk/Software/ZeroZap.zip It isn’t perfect, it can still crash in odd ways (so get in the habit of hitting F3 frequently), but it works okay otherwise. It’s my editor of choice (sorry Fred, Zap’s disassembler is better ;-) ). |
Clive Semmens (2335) 3276 posts |
Yup – I didn’t feel the need for DrawPlus way back when, but it must have moved on. I intend to try OpenVector at some point soon – before I start any major new vector drawings.
Pschaw. I’m writing this sitting staring at a 43" 4K display 19" from my nose right_now. Which cost me £299 in Argos. So effoff DisplayManager. Ads on most sites don’t bother me much though, as long as they don’t pop up in front of what I’m doing, or consume too much bandwidth – sites that do either of those things don’t get visited again (I’m looking at you, Local Newspaper). Yup, Zap was always my editor of choice. Nothing else I’ve tried comes close. I really must get round to getting hold of a working copy again. |
Fred Graute (114) 645 posts |
For StrongED 4.69 and earlier, sure. With the latest test release (4.70a11) there is very little in it IMO. Why not give it a try and let me know what you think. You might, shock horror, even like it. ;-) |
Steve Pampling (1551) 8172 posts |
but the rules of the game state that you have to say what exactly makes it “better” and then Fred gets to modify StrongED to be like that. Which is where he’s pointing… |
Clive Semmens (2335) 3276 posts |
I’m prepared to give it a try, Fred… |
Steve Pampling (1551) 8172 posts |
If you look on the StrongED page you will notice the link in the text for “Test release” I’m avoiding quoting the direct link to the test page. |
Clive Semmens (2335) 3276 posts |
Booked that – and OpenVector – to look at next time I’m working on the Pi. Some more illustrations I did in Acorn Draw now on http://clive.semmens.org.uk/CV.html?Art%2FMaps |
Steve Fryatt (216) 2105 posts |
Given that NetSurf is pretty good at logging stuff, what does the log say after it’s crashed? |
Clive Semmens (2335) 3276 posts |
I shall take a look next time I’m on the Pi! |