These tools come with tgdlp4xx.obj. They require a 80186 or
higher CPU and are to use from the DOS Command Line
Interpreter:


COLORX:

COLORX is a color palette extractor for several bitmap file
formats. COLORX supports BMP, GIF, LBM and PCX graphics
formats.

FUNCTION:
If a true color bitmap file format like PPM is used every
pixel has its own RGB color triplet representing the color of
the pixel. In indexed color formats like GIF every pixel is
nothing else but an index to a color table holding the RGB
triplets of the pixels. This color table can be sorted in
various ways. Giving every pixel its own RGB triplet makes a
color table unnecessary. Therefore the sorting within the
color table is lost in a true color format. To preserve the
sorting COLORX was made. COLORX writes a PPM compatible color
palette file (plain text/UNIX style) which can be used when
converting the PPM format to the indexed LP4 format.

USAGE:
COLORX srcfile.ext [destfile[.ext]] [-noscale]

If dest. file is left out dest. file name will be src. file 
name with .PAL extension.
If dest. extension is omitted dest. extension will be .PAL
If dest. file already exists, COLORX overwrites the file.

-noscale: a rather unimportant option. Most bitmap file
formats store R,G,B values ranging from (0,0,0) to
(255,255,255). Of course a VGA card can't take that. Therefore
the R,G,B values are automatically scaled to (0,0,0) -
(63,63,63) by COLORX. If you don't want this scaling you can
prevent it by setting the option -noscale.


BMPTOPPM:

BMPTOPPM converts a OS/2 or Windows Bitmap to a Portable PixMap
- the graphics file format used by all LP4 conversion
utilities.

FUNCTION:
All LP4 conversion utilities delivered with this package
require a PPM file as input. However the PPM graphics format
is not well known on the PC platform and is therefore only
supported by a few programs. On the other side the BMP
graphics file format is very popular among PC users and there
is a lot of software existing that converts almost any graphics
file to the BMP format.
BMPTOPPM can read OS/2 and Windows BMP files and convert them
into the PPM format used by PPMTOLP4 and FNTTOLP4. BMPTOPPM
can read the following BMP formats:

color depth (bits)	type		compression
===================================================
      1			OS/2 PM 1.2	RGB
      1			Windows 3.0	RGB
      4			OS/2 PM 1.2	RGB
      4			Windows 3.0	RGB
      4			Windows 3.0	RLE4 *)
      8			OS/2 PM 1.2	RGB
      8			Windows 3.0	RGB
      8			Windows 3.0	RLE8 *)
     24			OS/2 PM 1.2	RGB **)
     24			Windows 3.0	RGB **)

*) many programs can't compress bitmaps according to the RLE
   compression scheme correctly. Therefore it is not
   recommended to use this compression scheme when storing
   bitmaps.

**) BMPTOPPM can convert true color bitmaps to the PPM format.
    However if these true color bitmaps contain more than 256
    colors (they usually do) the LP4 conversion utilities will
    refuse to work with them.

BMPTOPPM can convert bitmaps with up to 4096x4096 pixels in
size without using extended or expanded memory or a temporary
file (Yeah! There is some black magic working for you).

USAGE:
BMPTOPPM srcfile[.ext] [destfile[.ext]] [-debug]

If src. file extension is left out .BMP is used.

If dest. file is left out dest. file name will be src. file 
name with .PPM extension.
If dest. extension is omitted .PPM will be used.
If dest. file already exists, BMPTOPPM will overwrite the file.

Options: -debug: displays some additional information about
	  the BMP bitmap file.


PPMTOLP4:

PPMTOLP4 converts a PPM pixmap into the LP4 bitmap format used
by lp4supp.obj/tgdlp4xx.obj and LP4TOSP4.

FUNCTION:
For maximum blitting speed (blitting = transferring a bitmap
into video memory) it is required that all bitmaps have a
certain ModeX compatible format. The conversion into this
format is not trivial. Therefore this program is included in
the tgdlp4 package that lets you easily convert from PPM to
LP4 - the format accepted by lp4supp.obj. PPMTOLP4 can only
convert PPM pixmaps with up to 256 colors - even if the PPM
pixmap format is a true color format.
You can convert standard bitmap formats like GIF and PCX to
PPM using the PBMPLUS utilities. The PBMPLUS utilities require
a '386 or above CPU.
Alternatively Image Alchemy can be used which does the same
job. However Image Alchemy is restricted to a bitmap size of
640x480 in the unregistered version. Image Alchemy runs on
a '286 CPU and above.
You can also use BMPTOPPM which is included in this package to
convert BMP files to the PPM format.

USAGE:
Once you have converted your favourite graphics format into
the PPM format you can use PPMTOLP4 this way:
PPMTOLP4 srcfile[.ext] [destfile[.ext]] [@[colormap[.ext]]] [-option] [-option] ...

If src. file extension is left out .PPM / .PNM is used.

If dest. file name is left out src. file name will be used
with .LP4 extension.
If dest. file extension is omitted .LP4 will be used.
If dest. file already exists and it is a valid V1.2 LP4 file
the bitmap which was converted by PPMTOLP4 will be appended
to the existing LP4 file. This means you can build an archive
of up to 255 bitmaps in a single LP4 file.

If no colormap is specified, PPMTOLP4 will create the index
color table directly from the PPM file. This index color table
is sorted by the first appearance of each color in the PPM
file.
If @ is found in the argument list without a colormap name
src. file name will be used with .PAL extension as colormap
file name.
If a colormap file name is specified, but without extension,
.PAL extension will be assumed.
If a colormap is specified PPMTOLP4 will sort the colors of
the bitmap according to their order in the colormap. Using a
colormap can slow down the conversion process significantly.
COLORX can be used to extract a colormap of the processed
image out of BMP, GIF, LBM and PCX files.

Options: -debug: displays some additional information about
	  the LP4 bitmap.
	 -title: each LP4 bitmap in a LP4 file can be given a
	  name by using this option. Names longer than 31
	  chars will be cut to fit in 31 chars. No spaces
	  inside the name are allowed.
	  Example: -titleHello_World gives the converted
	  bitmap the name Hello_World which will be stored
	  with the bitmap in the LP4 file.
	  If the -title option without a following bitmap name
	  is given src. file name without extension will be
	  used as bitmap name.
	 -lum: sort the bitmap colors by increasing luminance.
	  Color 0 will have the lowest luminance and color 255
	  the highest luminance (if the bitmap has 256 colors).
	  This option can only be used in conjunction with
	  a colormap which can be specified by @. If no
	  colormap for the PPM file is available the PPM
	  file itself can be used as a colormap.


FNTTOLP4:

FNTTOLP4 converts a PPM pixmap which contains a font matrix
into a LP4 font usable by lp4supp.obj/tgdlp4xx.obj.

FUNCTION:
FNTTOLP4 is a font OCR software which can convert fixed and
proportional width fonts into the LP4 format. To use this
program it is required to create a font matrix bitmap and
save it as a PPM file. FNTTOLP4 takes this PPM file and
converts the font information inside it into a font that can
be used by tgdlp4xx.obj. The PPM pixmap which shall be
converted may not have more than 256 colors - otherwise
FNTTOLP4 will fail. The upper left pixel of the PPM pixmap
must have a color which is not being used in the font
characters (= must have the background color). If a colormap
is used color 0 (the first color in the .PAL file) must be the
background color.
The font matrix bitmap you have to create must have a certain
appearance. In principle it looks like this for fixed width
fonts:

@ @|$

@ !"#$%&'()*+,-./ $
@0123456789:;<=>? $
@@ABCDEFGHIJKLMNO $
@PQRSTUVWXYZ[\]^_ $
@abcdefghijklmno $
@pqrstuvwxyz{|}~  $

The first character line in a font matrix bitmap is the 'sync
line'. It contains sync characters which are required for the
font OCR process.
The first character in a fixed width font sync line (the
'master sync') has to occupy (at least a part of) the leftmost
column of the fixed font character matrix. The @ character in
the Windows fixedSys font fullfills this condition. But you
may have to use other characters for other fixed width fonts.
The master sync has to be connected horizontally. For example
" can never be a valid master sync since there is a gap
between the two quotes.
The next character in the sync line is always the space char.
After the space char the master sync character has to follow.
Following the 2nd master sync are two auxiliary sync chars:
The first auxiliary sync character has to occupy (at least a
part of) the bottom row of the fixed font character matrix.
| does this in the Windows fixedSys font case.
The second auxiliary sync has to occupy (at least a part of)
the top row of the fixed font character matrix. $ does this in
the Windows fixedSys font case.
After the sync line leave one line blank.
Now the font data lines follow. Each font data line begins
with the master sync. Immediately after the master sync the
character data follows. Each line has to contain 16 'data'
characters. After the 16 data characters a space follows and
after the space the auxiliary sync #2. The font data lines may
not overlap. The data chars are stored in the font data lines
in increasing ASCII code order - beginning from ASCII code
20h (SPACE char).
You don't have to define always six font data lines. If a
font only contains uppercase characters you may only define
four font data lines for example.
However there MUST be always 16 data chars in a font data line.
If the last font data line contains less than 16 data
characters fill it up with spaces so that the auxiliary sync #2
is always at data character position 18. It is also required
that the last font data line contains auxiliary sync #1. If
it isn't there already put it after auxiliary sync #2 at data
character position 19.
FNTTOLP4 is very sensitive to the appearance of the master
sync. The master sync must always look the same in each font
data line - otherwise FNTTOLP4 will fail.
Take a look at fixedsys.wri and fixedsys.bmp to become
familiar with the conversion of fixed width fonts.

The font matrix bitmap for a proportional width font may look
like this:

A A |$

A ! ' # $ % & ' ( ) * + , - . / $
A 0 1 2 3 4 5 6 7 8 9 : ; < = > ? $
A @ A B C D E F G H I J K L M N O $
A P Q R S T U V W X Y Z [ \ ] ^ _ $
A  a b c d e f g h i j k l m n o $
A p q r s t u v w x y z { | } ~ $

Note: In a proportional width font matrix ALL characters have
to be connected horizontally. Take a look at the font data
line #1. " is replaced by ' to fullfill this condition.

Again, the first line in the matrix is the 'sync line'. It
holds special 'sync' characters which are required for the
font OCR process. The first character in the sync line is the
'master sync'. For a proportional width font it is required
that the x-spacing between two master syncs printed immediately
after each other is 0 (this means: in this situation the
master syncs should 'stick' together but should not overlap).
'A' fullfills this condition in the TrueType Arial font case.
After the master sync the space character follows and again a
master sync. The next two characters are the auxiliary syncs
#1 and #2:
The first auxiliary sync character has to occupy (at least a
part of) the bottom row of the prop. font character matrix.
| does this in the Windows TTF Arial font case.
The second auxiliary sync has to occupy (at least a part of)
the top row of the prop. font character matrix. $ does this in
the Windows TTF Arial font case.
After the sync line leave one line blank.
Now the font data lines follow. Each font data line begins
with a master sync. Then the character data follows. Note
that there is a space between each character in the font data
lines to prevent overlapping of characters. Each font data
line must contain 16 data characters. After the 16 data chars
follows the auxiliary sync #2. You will notice that font data
line #1 contains only 15 data characters. This is due to the
fact that the sync line's space character will be inserted by
FNTTOLP4 at the beginning of the first font data line - giving
in summary 16 data characters for the 1st font data line as
well. The font data lines may not overlap. The data chars are
stored in the font data lines in increasing ASCII code order -
beginning from ASCII code 21h ('!' char).
You don't have to define always six font data lines. If a
font only contains uppercase characters you may only define
four font data lines for example.
However there must be always 16 data chars in a font data line
(except the font data line which would contain ASCII code 20h
- the SPACE character. The space character will always be
inserted from the sync line at logical font matrix/ASCII 
code 20h. Therefore this line may only contain 15 data 
chars).
If the last font data line contains less than 16 data
characters fill it up with auxiliary sync #2's so that it
contains at least 16 data chars (- in this case count the
auxiliary sync #2 as a data character). Also auxiliary sync #1
has to appear in the last font data line. If it isn't there
already put it after the last auxiliary sync #2 (of course you
have to leave a space between auxiliary sync #2 and auxiliary
sync #1).
FNTTOLP4 is very sensitive to the appearance of the master
sync. The master sync must always look the same in each font 
data line - otherwise FNTTOLP4 will fail.
Take a look at arial24.wri and arial24.bmp to become familiar
with the conversion of proportional width fonts.

USAGE:
FNTTOLP4 srcfile[.ext] [destfile[.ext]] [@[colormap[.ext]]] [-option] [-option] ...

If src. file extension is left out .PPM / .PNM is used.

If dest. file name is left out src. file name will be used
with .LP4 extension.
If dest. file extension is omitted .LP4 will be used.
If dest. file already exists and it is a valid V1.2 LP4 file
the font which was converted by FNTTOLP4 will be appended
to the existing LP4 file. This means you can build an archive
of up to 255 fonts in a single LP4 file.

If no colormap is specified, FNTTOLP4 will create the index
color table directly from the PPM file. This index color table
is sorted by the first appearance of each color in the PPM
file.
If @ is found in the argument list without a colormap name
src. file name will be used with .PAL extension as colormap
file name.
If a colormap file name is specified, but without extension,
.PAL extension will be assumed.
If a colormap is specified FNTTOLP4 will sort the colors of
the font according to their order in the colormap. Using a
colormap can slow down the conversion process significantly.
COLORX can be used to extract a colormap of the processed font
out of BMP, GIF, LBM and PCX files.

Options: -debug: displays some additional information about
	  the LP4 font.
	 -fixed: instructs FNTTOLP4 to create a fixed width
	  font. By default FNTTOLP4 attempts to create a
	  proportional width font.
	 -starthh: hh stands for a hex value from 00-f0. This
	  option tells FNTTOLP4 which ASCII code the first
	  data character in the first font data line has. If
	  you want to create a font which consists only of the
	  numbers 0-9 you naturally want to start from ASCII
	  code 30h which is the code for '0'. The default
	  start character (= first data font line, first data
	  character) is 20h (SPACE). Refer to ASCII code
	  tables for further information.
	 -spcddd,ddd: ddd stands for a decimal number from
	  -99 to +99 (the + can be omitted). You can add an
	  artificial spacing between characters by using this
	  option. While not often used with fixed width fonts
	  it is required for proportional width fonts to
	  create a spacing between the characters so that they
	  do not stick together. The first decimal value is
	  the spacing in x direction, the second decimal value
	  of the option the spacing in y direction. Note that
	  the spacing can be negative to support italic chars.
	  The default value for spacing in the x/y direction
	  is 0/0.
	 -title: each LP4 font in a LP4 file can be given a
	  name by using this option. Names longer than 31
	  chars will be cut to fit in 31 chars. No spaces
	  inside the name are allowed.
	  Example: -titleHello_World gives the converted
	  font the name Hello_World which will be stored with
	  the font in the LP4 file.
	  If the -title option without a following font name
	  is given src. file name without extension will be
	  used as font name.
	 -lum: sort colors of the font by increasing luminance.
	  Color 0 will have the lowest luminance and color 255
	  the highest luminance (if the font has 256 colors).
	  If you are using this option the color with the
	  lowest luminance must be the background color of the
	  font matrix if FNTTOLP4 should work properly.
	  This option can only be used in conjunction with
	  a colormap which can be specified by @. If no
	  colormap for the PPM file is available the PPM
	  file itself can be used as a colormap.


LP4TOSP4:

LP4TOSP4 is used to convert LP4 bitmaps into a LP4 sprite
animation.

FUNCTION:
A sprite animation is consisting out of LP4 bitmaps of the same
(x,y)-size. Bitmaps for a sprite animation are called 'sprite
animation sequences'. Each sprite animation sequence may
occupy up to 65520 bytes. Sprite animation sequences can be
'played back' by the TGDLP4 graphics driver to give the
illusion of animation for a sprite.
To generate a sprite animation you first have to draw the
single sprite animation sequences, convert them into PPM
format and using PPMTOLP4's append option concatenating them
in the right order into a single LP4 file. The first bitmap
stored in a LP4 file will become sprite animation sequence #0,
the second bitmap will become sprite animation sequence #1
and so on. A sprite animation may have up to 255 animation
sequences (sprite animation sequence numbers 0-254). If you do
not need an animation for certain sprites simply create a LP4
file with only one bitmap entry.
After you have created the LP4 bitmap file you can convert
the bitmaps in it into a sprite animation by using LP4TOSP4.

Note: Each bitmap in a LP4 file has its own color palette.
This is not true with sprite animation sequences in a sprite
animation. Therefore LP4TOSP4 will take only the palette of
the first bitmap recorded in your LP4 file and assume the
palette is valid for all following sprite animation sequences
of that file.

USAGE:
LP4TOSP4 srcfile[.ext] [destfile[.ext]] [-option] ...

If src. file extension is left out .LP4 is used.

If dest. file name is left out src. file name will be used
with .SP4 extension.
If dest. file extension is omitted .SP4 will be used.
If dest. file already exists and it is a valid V1.2 LP4/SP4
file the sprite animation which is created by LP4TOSP4 will
be appended to the existing LP4/SP4 file. This means you can
build an archive of up to 255 sprite animations in a single
LP4/SP4 file.

Options: -debug: displays some additional information about
	  the LP4 sprite animation.
	 -title: each sprite animation in a LP4/SP4 file can
	  be given a name by using this option. Names longer
	  than 31 chars will be cut to fit in 31 chars. No
	  spaces inside the name are allowed.
	  Example: -titleHello_World gives the converted
	  sprite animation the name Hello_World which will be
	  stored with the sprite animation in the LP4/SP4 file.
	  If the -title option without a following sprite
	  animation name is given src. file name without
	  extension will be used as sprite animation name.


SHAREWARE LIMITATIONS:
----------------------

PPMTOLP4 (Shareware):
PPMTOLP4 can only convert PPM pixmaps with a size of up to
320x200 pixels to the LP4 format.

FNTTOLP4 (Shareware):
FNTTOLP4 will convert max. 64 characters from a PPM font
matrix pixmap to a LP4 font. The -starthh option is disabled.
FNTTOLP4 will assume that the first data character to convert
has the ASCII code 20h (SPACE).

LP4TOSP4 (Shareware):
LP4TOSP4 can create sprite animations with up to 8 sprite
animation sequences instead of 255.

