home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Elysian Archive
/
AmigaElysianArchive.iso
/
printer
/
djfont.lha
/
DJFont.doc
< prev
next >
Wrap
Text File
|
1989-06-06
|
8KB
|
201 lines
DJFont -- a Laserjet to Deskjet Soft Font Converter
Version 0.3 for the Amiga -- June 3, 1989
Copyright 1989 Charles Tyson. All rights reserved.
P-link: C-M-T
Genie: C.Tyson
*** NOTES TO VERSION 0.3 ***
This program was written and compiled with Hisoft Basic 1.03. It runs
from either the Workbench (click on the icon) or a CLI (type DJFont).
DJFont has three functions: it converts fonts, prints samples of
converted fonts, and prints a table of character widths for use in
constructing printer drivers for word processors.
Functions must be marked with the up and down arrow keys, and selected
with the Return or Enter key.
Converting fonts:
To minimize disk access, you should put the Laserjet soft font into RAM:
before starting the program, and specify that the Deskjet soft font be
written into RAM:. DJFont uses a temporary file called T:Tallfont.tmp
while it is doing a conversion. You should assign T: to RAM:.
The program first asks for the name of the Laserjet font file to be
converted (just press Return if you want to get back to the main menu).
If the file doesn't exist, it asks again. DJFont then tests the file
for convertability--if the file doesn't look like a soft font or is too
large for the Deskjet (a 24 point font is about the biggest possible),
the program aborts.
A properly-written Laserjet font has a 16-character description field.
If this field has garbage in it (because the Laserjet font header was
poorly written or is in an old format), you will be asked for a
replacement description.
DJFont then asks for the name of the Deskjet font file to be created.
If the file already exists, you will be prompted for another name.
DJFont does all the rest. It displays the number of characters yet to
be converted so you can gauge the amount of time it will need to finish.
If the conversion process bombs, DJFont saves the partially-written
Deskjet file so you can try to determine what went wrong.
Version 0.3 of DJFont knows how to set underlining information in the
Deskjet font, and adjusts the bolding information based on the point
size of the font. DJFont is designed to work only with proportional
fonts, and may mangle fixed-space fonts.
DJFont 0.3 still hasn't been tested on 8-bit fonts (those with ASCII
characters above 126), but the program allocates 60K of memory for
itself in case it needs lots of string storage.
Don't forget to copy your converted fonts from RAM: onto a disk before
you shut off your computer!
Printing a sample:
This function downloads an already-converted font to the Deskjet and
prints out a sample for your consideration. The only information you
need to supply is the name of the Deskjet font.
This function wipes out any temporary fonts you have downloaded to your
Deskjet and resets the printer afterwards, so don't use it in the middle
of another printing job.
Printing character widths:
This function prints out the character widths (in 300ths of an inch) of
a converted font. Characters which aren't defined or have 0 width are
shown as "--".
This information can be used to make printer drivers for word processors
such as Wordperfect, which adjust the spacing of words letter by letter.
*** USING CONVERTED FONTS ***
Having converted a font, you'll no doubt want to download it to the
printer to see what it looks like. Here is a sketchy outline of the
steps to be taken, using CLI commands.
Note that the ECHO commands use the sequence "*E" which stands for the
ESCAPE character (CHR$(27) in Basic), and often end with the NOLINE
parameter so that unwanted linefeeds won't be sent to the printer.
Also, note that the ECHO sequence "**" only sends ONE asterisk to the
printer, not two!
Note for ARP users only: You may have changed the "CLI escape character"
to something other than an asterisk to avoid conflicts with ARP's
wildcards (see page 3 of the ARP 1.3 Overview). If so, replace the double
asterisks in the ECHO lines below with single asterisks, and replace the
asterisk in "*E" sequences with your escape character.
The ECHO commands which send Deskjet printer sequences are redirected to
>PAR: instead of >PRT: because
1) PRT: intercepts the escape sequences and tries to convert them to
Amiga-specific printer commands, and
2) PRT: sends a form feed after ECHO commands, wasting paper.
When you send actual text to the printer, you'll want to use PRT:
because ECHO won't send carriage returns to the Deskjet. The Deskjet
won't return to the left margin until it sees a carriage return, which
PRT: supplies.
When quotes are used in the examples below, you must use upper and lower
case as shown.
1. Before downloading any fonts, it is a good idea to print something--
anything--using PRT:. If you first use PRT: after downloading fonts, the
initialization routines of the printer device may wipe out the fonts.
ECHO >PRT: "Okay, load them fonts now!"
2. Now you must tell the Deskjet to expect a font. The command for
this is
ECHO >PAR: "*E**cNNNNND" NOLINE
where NNNNN is the ASCII representation of a number between 0 and 32767.
This number, the "font number," is arbitrary--just don't download two
fonts with the same number. For example, to prepare the Deskjet to
receive font number 100, you would
ECHO >PAR: "*E**c100D" NOLINE
3. Tell the Deskjet whether the font is to be "temporary" or "permanent."
The only difference between the two is that temporary fonts are more
vulnerable to being erased by printer resets than permanent fonts. Unless
you have special requirements, make the font permanent.
The permanent command is
ECHO >PAR: "*E**c5F" NOLINE
The temporary command is
ECHO >PAR: "*E**c4F" NOLINE
4. Next, copy the font file to the printer. The command for this is
COPY fontfilename TO PAR:
where fontfilename is, need I say it, the name of the soft font file.
5. To save you the trouble of typing three lines and counting
asterisks, I have written a program called DOWNLOAD that performs the
above steps. See its separate documentation for details on using it.
6. To see if the font was downloaded properly, you can press the
Deskjet's FONT and RESET buttons simultaneously. This causes the printer
to print out the full character set of every font in its memory. However,
it also wastes a sheet of paper, so you may want to go directly to the
next step.
7. "Tall fonts" on the Deskjet are printed in two passes. Any font over
11 points in size is likely to be a tall font. If the Deskjet prints a
tall font bidirectionally (which is its default setting), there will be a
"jaggie" where the two halves of the character meet. To prevent this,
tell the Deskjet to print in one direction only:
ECHO >PAR: "*E&k0W" NOLINE
8. You can make any downloaded font the Deskjet's default font if you
know the font number assigned to the font (see step 1 above). The
command is
ECHO >PAR: "*E(NNNNNX" NOLINE
where NNNNN is the font number. For example, to make font number 100
the default font,
ECHO >PAR: "*E(100X" NOLINE
9. If everything has gone well, your downloaded font will be used until
the printer is reset or until you select another font (via the panel
controls or by another "default font" command).
ECHO >PRT: "The quick brown fox jumped over the lazy dog, ha ha ha!"
*** USING CONVERTED FONTS -- THE ADVENTURE CONTINUES ***
To make downloaded fonts really useful, you need to be able to use them
within your word processing program. Wordperfect can space downloaded
fonts properly if you go through the tedious process of entering the
character widths and font selection codes via the Printdef utility.
Since the Wordperfect driver must be tailored to the specific fonts you
are using, I can't give any general advice. I have written and tested
Wordperfect drivers for versions 4.1 (Amiga) and 5.0 (IBM), so I can state
that it is possible. If you want to follow in my footsteps but are having
trouble with the details, send E-mail to me and I'll try to help.