
				FontUtils
				~~~~~~~~~
Program Name: FontUtils
Date	    : 10-Sep-97
Author	    :  A.Thoukydides, 1997
Purpose	    : Zap font file manipulation
Description : Manipulate Zap fonts, allowing extraction of specified
	      character ranges, merging of fonts, resizing of characters,
	      resolution conversion, and the addition of bold, italic and
	      underline effects.

 The command line syntax is:

     FontUtils [-width <width>] [-height <height>]
	       [-xoffset <xoffset>] [-yoffset <yoffset>]
	       [-90x90dpi | -90x45dpi]
	       [-bold | -italic | -underline]
	       [-stylesize <size>] [-stylepos <pos>]
	       [-first <first>] [-last <last>]
	       [-magx <xfactor>] [-magy <yfactor>]
	       [-base <basefile>]  <infile> <outfile>

 where

     -width <width>	 - Set the width in pixels of each character to the
			   specified value. If this option is omitted, then
			   the size of the first character to be processed
			   is used.

     -height <height>	 - Set the height in pixels of each character to the
			   specified value. If this option is omitted, then
			   the size of the first character to be processed
			   is used.

     -xoffset <xoffset>  - The horizontal offset in pixels to apply. If this
			   option is not specified then a default value of
			   zero is used.

     -yoffset <yoffset>  - The verical offset in pixels to apply. If this
			   option is not specified then a default value of
			   zero is used.

     -90x90dpi		 - Force the resolution of the output sprites to be
			   90 DPI x 90 DPI. This should be used with fonts
			   that are displayed at 1dpp by Zap in square pixel
			   modes.

     -90x45dpi		 - Force the resolution of the output sprites to be
			   90 DPI x 45 DPI. This should be used with fonts
			   that are displayed at 2dpp by Zap in square pixel
			   modes.

     -bold		 - Apply a bold effect to all processed characters.
			   This ORs each character with a copy of the
			   character shifted one pixel to the left. This
			   process is repeated the number of times specified
			   by the -stylesize value.

     -italic		 - Apply an italic effect to all processed
			   characters. Each character is split into
			   horizontal strips; those above the centre line
			   are shifted to the right, and those below are
			   shifted to the left. The -stylesize value sets
			   the number of strips to use, and the -stylepos
			   option can be used to offset the position of the
			   centre line from the default.

     -underline		 - Apply an underline effect to all processed
			   characters. This sets one or more rows of pixels
			   at the bottom of each character. The -stylesize
			   option is used to specify the number of rows,
			   and the -stylepos option can be used to change
			   the position of the underlining.

     -stylesize <size>	 - Set the size or strength of the style effect (if
			   any). If this option is not specified then a
			   default value for the selected style is used. The
			   effect of this setting depends on the style being
			   applied.

     -stylepos <pos>	 - Set the relative position of the style effect (if
			   any). If this option is not specified then a
			   default value or zero is used. The effect of this
			   setting depends on the style being applied.

     -first <first>	 - The code of the first character to process from
			   infile, specified in decimal.

     -last <last>	 - The code of the last character to process from
			   outfile, specified in decimal.

     -magx <xfactor>	 - 1 for normal, 1.5 extra wide etc.

     -magy <yfactor>	 - 1 for normal, 1.5 extra high etc.

     -base <basefile>	 - The initial contents of the output sprite file.
			   If this option is omitted then the an empty file
			   is used as the base. This can be used to add
			   or replace characters to an existing font, or to
			   allow intermediate results to be combined.

     <infile>		 - The name of the source font sprite file.

     <outfile>		 - The name of the destination font sprite file.
			   This will contain any sprites in basefile
			   (if specified), plus each of the characters
			   within the specified range from infile.

 Notes:

     The CnvrtFonts utility should be used to convert fonts between the Zap
     font file format and the sprite files manipulated by this utility.

     The source sprite files must have each character stored as an
     individual sprite with the name of each sprite being the character code
     as three hexadecimal digits. This is the standard output format of both
     CnvrtFonts and FontUtils.

     Any of the three filenames may be the same. This allows, for example,
     effects to be applied in-place to a range of characters without
     requiring any intermediate files.

     Any scaling, resizing and translation is applied before the bold,
     italic or underline effects. Better results can sometimes be achieved
     by performing a transformation in two stages, using a larger
     intermediate sprite size for applying any style changes.

     This program can be easily modified to apply other effects. Have a
     look at PROCbold, PROCitalic and PROCunderline for three very different
     examples of how characters can be altered.

     Two versions of the main program are provided:

     FontUtils  - the original program by Alexander Thoukydides.
     FontU_TW	- as modified by Tim Tyler to work in a task window on
		  20-Sep-1997.  This allows the program to be used with the
		  DDE front end provided.  The syntax is closely related to
		  that of the original, but some dimensions which were in
		  os-units are now in pixels, and there are a couple of
		  extra switches.  The program is also slower in places.
     FontUtilEg - is provided as an example Obey file for use with the
		  original FontUtils program.
