A RISC OS utility to convert Drawfiles to SVG
| File | Size | Last modified | Description | Requirements and optionals | |
|---|---|---|---|---|---|
|
|
Size unavailable | Timestamp unavailable | back end – to be merged with !Boot | RISC OS | |
|
|
Size unavailable | Timestamp unavailable |
|
RISC OS | |
|
|
Size unavailable | Timestamp unavailable | back end; for cross-compilation to RISC OS | ISO C99 | |
|
|
Size unavailable | Timestamp unavailable | front end; for cross-compilation to RISC OS | ISO C99 | |
This converts vector-graphic Drawfiles on RISC OS to SVG. It can handle:
path objects with identical, non-triangular start and end caps, which are converted directly to SVG paths,
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,
(transformed) text objects, which are converted to Draw paths, and
then to SVG
paths — or directly to <text>
elements if you choose (thanks to James Bursa's patch; fixed to
handle &, < and >),
group objects, which become <g>
elements (optional, as of 2000-09-24), and
(transformed) sprite objects (but only partially), which become
grey (transformed) rectangles (it should be easy to change these
into <image> elements
manually).
You can also control:
whether the outer <svg> has
x and y
attributes,
whether the input file type is checked,
whether the output file type is set,
the scale of the output, by either a factor, or to fit a particular width/height,
the SVG width of ?Drawfile-thin? lines,
the dimensions of a margin, added after any scaling,
a background which covers the margin too.
Some optimisations include:
reducing the need to specify all style properties by being aware of defaults, and
compressing paths by using relative co-ordinates.
draw2svg is a command-line program, but a WIMP front-end with interactive help is now provided. (The back end is still required.) There is also a configuration file to use it with David Ruck's !ComndCTRL.
Other things to do include:
converting text objects to <text> elements, using the text-to-path method
only as a back-up plan — partially done, but I'd like to improve on
it,
handling JPEG objects,
handling embedded images by converting them to <image> elements and extracting (and
converting) the images, or by trying to convert the images to
paths, or by working out URIs of the converted images.
Do let me know if you find some hideous bug, please!
Erm... okay
Draw2SVG has problems on your machine? Describe them (problems and machine type) to me, and include a couple of test files to demonstrate, if you can. These could be made available to others who can provide test results on other platforms.