Aside from the obvious applications such as word processing, desktop publishing, and so on, many other programs use Draw files in quite unique ways. As an example, the sound editing program Sonor can export sound waves in Draw format.
In this article I hope to demonstrate some of the flexibility that Draw and the RISC OS desktop can provide.
Combining sources
Many applications use the underlying Draw module to render content, and, as such, often allow content to be exported in the drawfile format. This is very useful when combining media created in several applications - as the 'toolkit' approach to RISC OS application design encourages.
In this example I created and formatted a spreadsheet. When I was happy with the figures, I exported the required area as a drawfile, for use in another document. The text, calculations, cell borders and shading all transferred as expected, and became ordinary elements in the resulting draw file.
Cartoons
One limitation of vector graphics is that the line thickness is constant along the entire path. Although it's possible to work around this using a pressure sensitive stylus and an appropriate driver, I find it less natural than using a real pen... so for this cartoon example that's precisely what I used. And a scanner. And David Pilling's Trace application.
I scanned in a small sketch drawn using an italic pen (for those thick and thin lines) - just the outline, no colour. Trace converted this into a series of black polygons. I imported this into Draw and applied colour by drawing some rough coloured shapes, deliberately going over into the black, and sending them to the back, behind the black outlines.
Although the original drawing was only a couple of inches in size, the new vector file can be enlarged considerably - I produced prints in at least A4 size.
Converting text to paths
Although there are many fonts available for RISC OS, sometimes using a font without modification can look a little plain - particularly for logos.
Draw doesn't provide any facilities for kerning text, so to move the individual letters closer together you need to either input each letter as a separate object, or convert the text to a path, which produces a group of objects which can be manipulated independently. For this logo for Arse Records (a fictional company, of course!) I used the latter method.
Because the letters are now ordinary paths, it is possible to change them. I edited each letter to make the text look more distinctive - extending and sharpening the start and end of the 'a' and 'e' respectively, broadening the 'r', and filling in the corner of the 's'. I also removed the space between each letter.
The downside to this technique is that the text can no longer be edited, nor the font changed. A potential advantage is that you can send the file to somebody who does not have that font and they will be able to see the file perfectly.
Draw files are always useful
Several years ago I wrote a desktop Rubik's cube game. Again I used the Draw module to render the graphics - a slight overkill perhaps, but it allowed me to use thick lines very easily, and when a third party module to provide anti-aliasing was released my application benefitted from it immediately.
I also wrote a feature to save the current view as a draw file, which allowed me to knock up this poster in a couple of minutes. I could drag and drop the draw file from the Rubik application directly into the Draw document. I grouped the elements of each cube, and rotated them until I has happy with the arrangement.
I drew the shadow by hand - a grey polygon, with a thick, slightly lighter grey outline to give a softer edge to the shadow - and sent it to the back behind the cubes so I didn't have to worry about carefully tracing the edges adjacent to the cubes.
To provide the white spacing between the black text and the grey shadow, I duplicated the text, converted it to a path, and applied a thick white outline. The thick white version sits between the grey shadow and the black text.
Write scripts to create draw files
You don't have to be a hardcore programmer to create drawfiles. DrawScript extends BBC Basic with "extra" graphics commands. I modified one of the example scripts to produce this image to promote the Icon Bar's URL.
In closing
Although Draw is hardly the most powerful rendering engine - it lacks several useful features such as clipping and transparency - its ubiquity across the RISC OS desktop and application suite makes for outstanding productivity. Whether you create images using Draw, another application, or by writing your own script, the main limitation can only be your imagination.