                                Trace
                                =====
                                    
Introduction
============
On the Archimedes pictures are stored in two formats. Sprites and Draw files.
Sprites consist of many points (or pixels) that can be any colour. Draw files
are specifications of lines that when drawn, form a picture. There are
advantages and disadvantages to both types of file. Sprite files can be
edited with the Paint application, and Draw files with Draw.

Sprite files use quite a lot of memory, and can't be easily scaled. If you
attempt to make sprite files larger they will develop jagged edges.
Similarly, such 'jaggies' will show up when the sprite is printed on a high
resolution printer. Trace, allows you to convert Sprites into Draw files and
solve some of these problems.


Getting Started
===============
Double click on the !Trace application icon, after a pause while the program
loads and initialises, an icon will appear on the icon bar. Clicking with the
mouse menu button over this, displays a small menu, this provides an entry to
quit the program, and a dialogue box showing the version number of the
program. Clicking on the icon with the select button will open the main Trace
windows. Initially, these will be blank. Clicking the menu button over them,
will display the main Trace menu. The two windows, show the Sprite file being
traced and the resulting Draw file. A new sprite file can be loaded by
dragging it into either of the windows, or onto the icon bar icon.


The selections on the main menu are as follows;

Save Draw
---------
Moving the pointer to the right of this, will display a standard save box.
Dragging the Draw file icon allows the Draw file to be saved to disc or
direct into other programs. If no Draw file has been produced, this option
will be shaded out.

Save Sprite
-----------
This allows the sprite image to be saved. It is useful if you have imported
a sprite from Paint after making a change, and then decide you would like to
keep the sprite.

Trace
-----
This tells the program to trace the Sprite file currently loaded. Tracing can
take a long time, whilst it is going on, the pointer will change to an
hourglass. Once tracing is complete, the finished Draw file will appear in
the Draw window. You can then use the Save entry to save the Draw file either
to disc or into another application.

Zoom
----
Leads to a standard RISC OS magnifier that can be used to scale the images.

Choices
-------
This leads to a sub menu with two entries;

Error
-----
This allows you to enter the average error for each pixel traced. In other
words how closely the Draw file corresponds to the Sprite file. Large values
will produce Draw files that poorly correspond to the Sprite file. Small
values will produce Draw files that are more accurate. However, if this
number is too small, the Draw file will start to reproduce the individual
pixels of the Sprite (just the oppostite of what we are trying to do). Draw
files will become larger as the error is decreased. In general, error has to
be adjusted to get the best results for a given image.

Save
----
This allows the configurable options (Error) to be saved for future use.
After selecting this entry, the next time you use Trace, it will start up
with the current values.

Info
----
This displays information about the Draw and Sprite images.

Batch Mode
==========
Becauase tracing can take some time, it is often useful to be able to go
away and leave the program tracing a collection of sprites. To do this,
assemble your sprites in a directory, then drop the directory on the icon
bar icon. Trace will create another directory called 'Draw' in the same
place as your original directory, and then commence to scan through your
sprites, tracing each in turn and putting the resulting Draw files in the
'Draw' directory.

Escape
======
Tracing can be stopped by pressing the Escape key.


The Finished Product
====================
After sucessfully tracing your sprite, it will often be best to load the Draw
file into Draw. Many improvements can be made with Draw. Although a lot of
Sprites will Trace well, some will give poor results, and Draw can often save
these files.

The one type of Sprite which will give bad results, are those in which
colours have been represented by dithering (lots of small dots of different
colours). Paint can be used to preprocess Sprites to get better results.

The more complex the sprite is, the larger the Draw file, and the longer
Tracing will take. To start with try a simple Sprite and then as you get a
feel for the program, build up to more complex images.


D2Font
======
This is a program that will convert Draw files into Outline fonts. One of the
things you may trace, is text. Trace will convert these into Draw files, but
you can't use Draw files as fonts in the common DTP programs. To use them,
you need to turn the Draw files into fonts, this is what D2Font does.

To get started, double click on the D2Font icon. D2Font will appear on the
icon bar. Clicking on the icon bar icon, will open a window consisting of a
large number of squares, one for each character in the font. You now have to
use Draw, to save each character of the font, dropping the save icon into the
appropriate square.

Because filling the grid, may take some time, you can save the grid and all
the Draw files in it. Pressing the menu button over the main window, will
provide a menu with two save options. The first "save D2Font" is used to save
the entire grid. Grids are saved in a special D2Font file. This can be
reloaded by double clicking or dragging to the icon bar.

When you have finished filling the grid, the second save option saves the
font. This presents a directory icon, which you must drag into your current
!Fonts directory. The font will then appear if you double click !Fonts or
next time you reset the computer. The directory, contains 'Outlines' and
'IntMetrics' files. It is important that the font is created with the correct
name, unlike a normal file, you can't rename a font directory to change the
font name.

Other options on the main menu, allow you to clear all the grid, or just one
character.

If you double click on one of the character squares, a large version of the
character will appear. There will be a red line under the character. You can
use the Select and Adjust buttons respectively to drag the line up and down,
and to make it bigger and smaller. The red line represents the baseline and
width of the font. Normally, you need to make the width of the character
slightly larger than the character outline. For letters like lower case 'g',
the baseline needs to be half way up the character.

It is also possible to manipulate the base line for characters which don't
have a Draw file loaded. The reason why this is useful, is because certain
characters, like Space, although they don't print anything, must have a
width. So for such characters, you can use this feature to give the correct
behaviour.

Because changing the base lines for every character, can be tedious. Two menu
entries are provided. 

'Mono space' makes the base line width for every character, the given
fraction of the maximum character width. So entering 120% would make the base
line for every character 120% of the width of the widest one.

'Prop space' make the base line width for each character, the given fraction
of the characters width. For example, entering 120% (not a bad choice for
most fonts) would mean that each character had a border of 10% of its width
on each side.


Finally, a drag on a grid square using select, will allow you to save the
contents as a Draw file to another application.

There is a freely available font editor, written by Acorn, this is very
useful for examining the fonts produced and for fine tuning them. Copies are
available from Acorn support BBS's (e.g. Arcade 081-654-2212) and from many
other sources in return for a blank disc and postage.


Files on the disc
=================

!Trace              The Trace application.
!D2Font             The D2Font application.
!SparkPlug          Archive reader program.
TraceDemo           Examples of use of Trace.
D2FontDemo          Examples of use of D2Font.


Credits
=======
Thanks to Jason Williams for telling me how to do the difficult bits and for
providing some examples of D2Font use. 


Notes
=====

To use Trace, you need to have version 3.50 (or greater) of the shared  C
library in the modules subdirectory of your !System directory (usually on
applications disc 1). If this is not present, the program will fail to run
and give an error message. A copy of CLib version 3.75 is included on this
disc. To update your System resources (including the CLib module), you should
insert the disc, open a window on it and double click the Sysmerge
application and follow any instructions that are issued. This will ensure
that this program and other new programs will run correctly.

More details are given in the !Sysmerge.!Help file. To see this press the
menu button over the Sysmerge directory, and choose the Help item from the
appropriate menu.


D2Font 1.08, Trace 2.12
Release 1.13 May 1996


(c) Copyright David Pilling September 1991.

======
If you have any comments, suggestions, bug reports or complaints or would
like further copies of this disc or details of the many other discs available
for the Archimedes, please write to;

David Pilling
P.O. Box 22,
Thornton Cleveleys,
Blackpool.
FY5 1LR.
United Kingdom.

From time to time enhanced versions of discs will appear. You can upgrade
your copy to the latest one by sending your original disc with return postage
back to the above address.
