SVGDraw 1.00
============

SVGDraw edits and shows SVG pictures and saves them as Drawfiles, so that
they can be loaded into Draw, OvationPro, Artworks and other programs.

Using it
--------
* Double-click !SVGDraw to put it on the icon bar. Click SELECT on the
  icon to start a new, empty picture. The Examples directory inside
  !SVGDraw has some pictures to try.
* Drag an SVG file (type &AAD, or a text file whose name ends in /svg)
  onto the icon to open it. The source window shows the SVG text and the
  picture window shows the converted picture.
* SVG files can also be double-clicked while SVGDraw is running.
* Edit the SVG text in the source window. The picture is converted again
  when you stop typing. The source window's title shows how many problems
  were found, and the first of them.
* Drop a new file on the picture window to show it instead. If the file
  is edited elsewhere, choose Reload to see the changes.
* If parts of the picture could not be converted exactly, the Problems
  window opens with a list of them and their line numbers in the file.
* MENU over either window:
    Info     - details of the SVG file.
    Save     - save the SVG source. F3 also opens the save box.
    Export Draw - save box: drag the Drawfile icon to a directory display
               or to another application (e.g. Draw), or type a full path
               and click Save. Shift-F3 also opens the save box.
    Edit     - Undo (F8), Redo (F9), Cut (Ctrl-X), Copy (Ctrl-C),
               Paste (Ctrl-V), Delete, Select all (Ctrl-A) and Clear
               selection (Ctrl-Z) in the source window.
    Zoom     - scale the picture.
    Picture  - bring the picture window to the front.
    Source text - open the source window.
    Problems - open the Problems window.
    Reload   - read the SVG file again.
* Close the picture window to close the document.

Source window toolbar
---------------------
The toolbar has:
    Find     - open the Find window (F4).
    Go to    - go to a line (F5).
    Lines    - show or hide line numbers.
    Wrap     - turn word wrap on or off.
Then come the SVG language driver's buttons: svg and g put the
selected lines in an element, rect, circle, ellipse, line, polygon, path
and use insert an element, text wraps the selection in <text>, and <!--
makes the selection a comment.

Ctrl-F6 formats the whole source, and Shift-Ctrl-F6 the selected lines,
using the SVG driver's formatting rules.

Keys in the source window
-------------------------
  F3            Save the source
  Shift-F3      Export Draw
  Ctrl-F1       File information
  F4            Find and replace
  F5            Go to line
  F8            Undo
  F9            Redo
  Ctrl-X/C/V    Cut, copy and paste
  Ctrl-A        Select all
  Ctrl-Z        Clear the selection
  Ctrl-L        Show or hide line numbers
  Ctrl-B        Jump to the matching bracket
  Tab/Shift-Tab Indent or outdent the selected lines
  Ctrl-F4       Indent the selected lines
  F6            Set or clear a bookmark on this line
  Shift-F6      Go to the next bookmark
  Shift-F9      Start or stop recording a keystroke macro
  Ctrl-F9       Play the macro

Memory
------
SVGDraw converts pictures in its own dynamic area, the SVGDraw heap,
which is given back after each conversion. Choose Choices... from the
icon bar menu to set the most memory it may use (64 MB to begin with).
Click Set to use the new limit until SVGDraw quits, or Save to keep it
for next time.

If a picture is too big for the limit, SVGDraw says the SVGDraw heap is
full: raise the limit in Choices and choose Reload.

The Problems window's first line shows the most memory the conversion
used and how big the SVGDraw heap grew.

Choices
-------
The Choices window also sets how pictures are converted. Changes apply
to pictures loaded or reloaded afterwards.

* Images: JPEG stores PNG images as JPEGs, which are much smaller (PNGs
  with transparent areas stay sprites). Sprite stores them as 32bpp
  sprites. Leave out omits images.
* JPEG quality: 1 to 100 (85 to begin with). Lower is smaller.
* Largest image: PNGs wider or taller than this many pixels are shrunk
  to fit, which saves memory. 0 keeps them at full size.
* Gradient bands: the bands of colour in each gradient (64 to begin
  with). Fewer make smaller Drawfiles.
* Curves: how accurately curves are flattened where they are clipped,
  and for markers and text on a path.
* Apply clip paths: switch off to draw clipped parts whole.

What is converted
-----------------
Shapes
  - rect (with rounded corners), circle, ellipse, line, polyline,
    polygon and path, with all path commands including arcs
  - fill and stroke colours (names, #rgb, rgb(), hsl()), fill-rule,
    stroke-width, stroke-linecap, stroke-linejoin, dashes, markers
Structure
  - g, svg (nested, with viewBox and preserveAspectRatio), use, symbol,
    defs, switch, a, transform
  - style sheets (<style>) with type, class, id, attribute, descendant
    and child selectors; style attributes; presentation attributes
Paint
  - linear and radial gradients are drawn as bands of solid colour
  - patterns are drawn in a single colour
  - opacity is mixed with white, as Drawfiles have no transparency
Clipping
  - clip paths made of one shape that is convex (rectangles, circles,
    ellipses and so on), and the edges of nested svg and marker
    viewports
Text
  - text, tspan, textPath and tref, with x, y, dx, dy and rotate,
    text-anchor, letter-spacing, word-spacing, underline, overline and
    line-through
  - fonts are chosen by family: sans-serif fonts use Homerton,
    serif fonts Trinity and monospace fonts Corpus, in Medium or Bold
    and upright or italic; a RISC OS font name (e.g. Homerton.Bold) is
    used as given
  - UTF-8 text is converted to Latin-1
Images
  - PNG images embedded in the file (data: URIs) become JPEG objects or
    sprites (see Choices); JPEG images stay JPEG objects

What isn't converted
--------------------
Filters, masks, blend modes, clip paths made of text or several
shapes, and images in separate files. Each of these is listed in the
Problems window, and the picture is drawn without it.

Requirements: RISC OS 3.5 or later, the DrawFile module and (for the
GCCSDK build) SharedUnixLibrary 1.07+ (supplied in the !System from
www.riscos.info). JPEG objects need DrawFile 1.43 or later.
