home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
laser
/
altrft22.arc
/
ALTERFNT.DOC
< prev
next >
Wrap
Text File
|
1988-10-27
|
47KB
|
820 lines
ALTERFNT.COM v2.2a
------------
Purpose: Extract image of a soft_font character into a file Usage 1
------- | View|Change downloadable laser soft_font characters Usage 2
Put new|altered characters into a font Usage 3
| Change Font Descriptor Usage 4
| Insert new character numbers and character code in a font Usage 5
| Convert Portrait font into Landscape font Usage 6
| Copy ranges of characters from one font to another Usage 7
| Delete ranges of characters from a font Usage 8
| Download font [print Table showing characters & Widths] Usage 9
Graphics Board Not Required
===
Command: (Type ALTERFNT from DOS, for a brief summary.)
-------
alterfnt /cdefgilps[ow] [filename[ filename]] [char[-char]] [char[-char]]..
..[ID#[ LPT#]]
==============================================================================
****WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING****
==============================================================================
Usages 6-9 can be executed without any special knowledge concerning
soft_fonts. BUT you MUST:
READ THIS DOCUMENT before you try Usages 1-5! BACKUP your fonts FIRST!!
================== ======
IMPORTANT! Back-up your original font files (make COPIES) before you
use this utility. It's EASY to make an irretrievable mess of fonts with
ALTERFNT. Font files are intolerant: one incorrect byte, and the printer
rejects them. It's your fault if you lose originals. There are no
warranties, expressed or implied, associated with this utility. I think it
works as described, but THERE MAY BE BUGS! There ARE odd fonts that don't
adhere strictly to the H-P rules (e.g. IBM10.ARC), and ALTERFNT may render
them unuseable. More likely, you will make mistakes (fonts are complicated),
or make characters that look awful. Once you change a font, there's no going
back, no cancel, no "restore" feature: the font is changed permanently. You
use ALTERFNT at your own risk ENTIRELY. You are hereby warned, and I accept
no responsibility for any losses or damages -- direct, indirect, or
consequential -- incurred. If you don't know, or aren't sure, how to COPY a
file (make a backup copy) or how to restore that copy to your disk under its
original name, or you aren't patient to STUDY THIS DOCUMENT and the examples
provided, then please QUIT NOW.
==============================================================================
Usages:
------
All files must be located in the current directory; no paths permitted
"\" and "/" are synonyms in command line parameter statements
"-" separates character-ranges only
1. alterfnt /G <softfont_source_filename.ext> <character_decimal_code>
Example: alterfnt /g tms12.fnt 65 (Ascii 65="A")
Usage 1 gets or extracts the character descriptor data AND the bit-
mapped image of one character in a fontfile, specified by decimal character
number, and writes it to a temporary Ascii file called BINPIC.TMP, which can
be read and changed by a word processor or (IMAGE ONLY) by ALTERFNT's built-in
Image Editor (see Usage 2). The image also scrolls on-screen, for simple
viewing, when you execute this option. The image consists of a pattern of
zeros and ones (0 and 1). "1" represents one printed dot in a 300x300
dot/inch matrix; "0" represents a space (no printed dot) in the same matrix.
The image is visible; it LOOKS LIKE a letter "A" or whatever (see several
examples below) except that the aspect of the character on-screen is distorted
because the ratio of screen columns to rows is not 1:1. If you change the
arrangement of 0s and 1s on the BINPIC.TMP image-map, Usage 3 can write that
changed image (stored in file BINPIC.TMP) into a new complete font_file named
TEMPFONT.TMP, which will contain all the OTHER characters of the original
(source) fontfile, together with new data for the ONE character that you have
changed.
| In v1.1, no "/G" parameter was required.
2. alterfnt /E
Usage 2 loads the image of one character, stored in BINPIC.TMP
(created with Usage 1), into ALTERFNT's Image Editor. BINPIC.TMP must exist.
The Editor displays and can change the image, but it cannot change the
Character Descriptor or the size of that image. Use a word processor to add
or subtract rows and columns, or to alter Character Descriptor values.
3. alterfnt /C[O]
Usage 3 copies an exact duplicate of the source_file named in Usage 1,
except that the single character stored in BINPIC.TMP (generated with Usage 1
and possibly changed by Usage 2 Editor or by a word processor) is substituted
(at beginning/ending byte locations tabled in BINPIC.TMP) for one character in
the source_file. This copy is written to a temporary fontfile named
TEMPFONT.TMP. TEMPFONT.TMP is used as an intermediate file, to protect the
source_file, which is NOT CHANGED. BINPIC.TMP and the original source font
that generated BINPIC.TMP must exist. On exit you are queried whether to
overwrite the source_file. This gives an opportunity to download TEMPFONT.TMP
and check the result before changing the source. Note, however, that
TEMPFONT.TMP will be erased and rewritten the next time you use ALTERFNT, so
you must copy TEMPFONT.TMP to another filename if you wish to continue to re-
write characters from any source file, retain the result of this run, but not
change the source_font. The "O" switch on the DOS command line automatically
overwrites the source with TEMPFONT.TMP. (It's illegal to call TEMPFONT.TMP
as the source_file argument in an ALTERFNT command string; TEMPFONT can't be
both source and destination file.)
| In v1.1, parameter "C" was labeled "P"; parameter "O" was labeled "C".
4. alterfnt /F <filename.ext>
Usage 4 allows you to view and/or change the 15 parameters of the Font
Descriptor which are significant for the LaserJet II. Experts only. (Font
Descriptors are summarized in DESCRPTR.TXT, part of this ALTRFT21.ARC)
5. alterfnt /I[O] <destination_filename.ext> <character_decimal_code>
Example: alterfnt /io tms12.fnt 65
Usage 5 inserts a character number (1-255) which does NOT CURRENTLY
EXIST, together with character code stored in BINPIC.TMP, into a font_file.
BINPIC.TMP (Usage 1) and the destination font_file must exist. Question: How
do you obtain a BINPIC image of a "non-existent character"? Answer: Steal a
`template' from another character, then optionally modify it. That's
permissible because tabled "Start_Modification | End_Modification" byte
locations are, in this Usage ONLY, ignored [the tabled "Character Number" is
ALWAYS ignored], and the program manually determines where to place the
character within the font on the basis of the character number supplied on the
DOS command line. All other Character Descriptors remain significant. This
usage will abort if the character number already exists. VERY IMPORTANT:
This is the ONLY Usage of ALTERFNT which can put a character number that does
not already exist. Note that the character NUMBER inserted must fall within a
range accepted by the Font Type (one of the Font Descriptors) of the present
Font; otherwise the Font will crash when you download it to the printer
(ALTERFNT does not check, but Font Type can be changed with Usage 4). Font
Type "0" (7-bit) will only accept characters within the range 32-127; Font
Type "1" (8-bit) accepts chars 32-127 and 160-255; Font Type "2" (PC-8)
accepts chars 1-6, 16-26, 28-255. Switch "O" overwrites the source_file with
TEMPFONT.TMP on exit.
6. alterfnt /L <portrait_filename.ext>
Usage 6 copies Portrait fonts into a new font_file which is fully
converted to Landscape orientation. The Portrait source is not affected.
Landscape files adopt the filename of the portrait file, plus extension .LND:
thus, TMS12.FNT is copied/converted to TMS12.LND. Any pre-existing file named
e.g. TMS12.LND is erased. (Why pay extra for Landscape files?)
7. alterfnt /P[O] <source_filename.ext> <destination_filename.ext> ...
...<source_begin_char[-source_end_char]> <dest_begin_char[-dest_end_char]>
Examples:
Put source character 65 into destination character 65, and overwrite source:
alterfnt /po tms12.fnt template.fnt 65 65
Put one source character 45 into destination character range 200-210:
alterfnt /p tms12.fnt template.fnt 45 200-210
Put range of source characters 1-31 into destination characters 128-158:
alterfnt /p tms12.fnt template.fnt 1-31 128
Usage 7 puts a range of source characters into an equivalent range of
(possibly different) destination character numbers, or it puts a single source
character into one or more destination character numbers. If only one source
character is specified, it is loaded into the entire destination range (one or
more characters). If multiple-character source range is specified, only the
first character of the destination range need be specified. If a specified
character number is absent in the destination file, ALTERFNT quits when it
reaches that number. The Overwrite "O" switch is automatically enabled if
more than one character will be written (source file is changed).
8. alterfnt /D[O] <softfont_filename.ext> <begin_char[-end_char]>
Example: alterfnt /d tms12.fnt 128-255
Usage 8 deletes one or more characters from a font_file. The
character number(s) and associated code are both removed entirely. If a range
is specified, the beginning and ending characters must exist in the soft_font.
The overwrite "O" switch is automatically enabled if more than one character
will be written (source file is changed).
9. alterfnt /S[W] <softfont_filename.ext> <font_ID#>[ lpt#]
Example: alterfnt /sw tms12.fnt 0 2
Usage 9 downloads one fontfile to parallel printers (serial interface
not supported). Printer must be on-line (no check is performed). The file is
given "Permanent" status (a software reset will not erase it). A font ID
number (range 0-32767) must be specified. LPT1 is default (specify optional
range 1-4). Optional switch "W" prints (after downloading the font) a table
displaying each character in the font in Ascii order, together with its
Width. "Width" is defined not as character width alone, but as net cursor
movement (left offset + char width + right offset, or Delta X/4). "Width" is
stated in dots (300 dots/inch). Decipoints, an alternate measure of width
(720 decipoints/inch), equals 2.4*dots. The character width table is printed
on 1 sheet of paper (most utilities require 5+ sheets), but characters in
fonts larger than about 20 points may overlap.
* * *
ALTERFNT's basic concept: extract the image of a single character
from a softfont, change that image on-screen (where it is displayed
magnified), then write this new image back into the file.
It's a simple idea, and ALTERFNT is fast and easy. This document is
long because there are many extra considerations if you start to change a
character's height, width, etc. You can treat ALTERFNT as a toy, to play with
characters, make minor changes to their appearance, etc. You can also use it
to completely revamp a font (change it from Portrait to Landscape, 7-bit to
PC-8, anything at all) - but at this level you must be thoughtful. You may
want to order the LaserJet Technical Reference Manual from H-P. Putting a
diagonal slash through a "0" zero is a piece of cake, but to create new
characters takes clear technical thought and, often, a sense of orthographic
aesthetics that you can only hone with trial and error (it's not easy to make
a good-looking character).
ALTERFNT does no physical harm to a Hewlett Packard LaserJet II, even
if ALTERFNT is misused; but I have not tested the program, and cannot attest,
that it works on any other laser printer.
Repeat: BACKUP your original fonts! Do not alter originals.
With effort, ALTERFNT can generate new fonts virtually from scratch,
but ALTERFNT is really designed to change, not create, fonts. After reading
this text, you'll understand a few basics of LaserJet character definition.
Version 2.x:
-----------
Greatly enhanced in features, and much faster. Writing character Ascii 1 in a
chock-full 35K font with 245 characters defined [8Mhz AT]:
Version 1.1: 163 seconds
Version 2.x: 10 seconds
Much more error-checking of BINPIC.TMP input files. User is still responsible
for providing correct Character Descriptor data, but many obvious errors are
flagged
Built-in Image Editor (Usage 2, see "Hands-On" below)
Bit-dot patterns of any line-length work
ALTERFNT now accepts changes to all the CHARACTER DESCRIPTORS (even those
marked "DO NOT ALTER")
Change all FONT DESCRIPTORS recognized by the LJ-II, with new ALTERFNT Usage 4
(change the Maximum Cell Width, Font Orientation, etc etc)
New functions to put long ranges of characters into fonts (Usage 7), to delete
one or more characters from a font (Usage 8), and to insert a previously
non-existent character's number and image data (Usage 5)
Convert Portrait font into a Landscape font (Usage 6, nifty)
New Usage 9 downloads a font, and has a handy "W" switch to print out a full
table of its characters with their individual Widths - useful for
configuring word processor printer files (see also "Hands-On"). Don't
blithely change your fonts without checking regularly that the alterations
actually PRINT! Download and print a table of its characters.
You can't run ALTERFNT successfully unless you read this text.
--- ----- --- -------- ------------ ------ --- ---- ---- ----
You need:
a laser printer (the program was written for, & tested upon, an
HP LaserJet II). May also work with the DeskJet [untested].
at least 1 laser soft_font, preferably a normal (not bold or italic) portrait
font which includes extended characters above decimal 127 so that you can
replace seldom-used characters with new characters of your own devising
a word processor that writes pure Ascii text (e.g. XyWrite III+) and puts a
hard CR/LF Carriage Return/Line Feed combination (Ascii 13 followed by
Ascii 10) at line ends
file ALTERFNT.COM from this ARChive
Additionally, Vern Buerg's LIST.COM is handy for checking font_files (do they
define a character number? was a number deleted properly? etc)
The Hewlett Packard LaserJet Technical Reference Manual (chapter on "Soft Font
Creation") has complete information.
* * *
Hands-On
--------
This experiment will give you a tiny, painless taste of ALTERFNT (the
program has much more powerful capabilities):
Put a COPY of a standard softfont file in the same directory as
ALTERFNT.COM. From DOS, command ALTERFNT /G FONTFILENAME.EXT 79 (Ascii code
for a capital "O"), then hit the Enter key (carriage return, or <cr>):
e.g. alterfnt /g garamond.por 79<cr>
You'll see a big "O" scroll up the screen, preceded by a table of
information comprising mainly the Character Descriptors. Now (in DOS)
command ALTERFNT /E<cr>. This loads ALTERFNT's Image Editor, which is
designed to refine the appearance of a character. You can't change the
Character Descriptors with this Editor, and the Editor won't accept a
character much larger than 1/2" x 1/2" (158 dots x 158 dots, in a 300
dot/inch matrix -- actually that's BIG 38-point type -- use a word processor
for even bigger characters or for changes to height, width, descriptors,
etc.) Cursor controls (listed on the Editor's bottom line) move you around
the screen, or page down|up (page right|left on big characters with F2 and
F1). Apart from cursor controls, and "Esc"ape to Quit, you can only INPUT
two characters: zero (0) and one (1). Note that the entire image of letter
"O" is composed of zeros and ones, each representing one dot in the matrix.
(This isn't my idea; this is how softfonts are designed.) "1" means print a
dot; "0" means don't print a dot (print a space).
Let's CHANGE this pattern, by adding a cross "+" in the center of the "O".
Draw the lines of the cross by replacing zeros with ones, two or three
columns|rows wide or thick (otherwise it will appear like a hairline).
Don't worry if you're messy; you're not affecting your source file. When
done, save this image by hitting "Esc"ape, to quit. Now, "C"opy the changed
image into a copy of the font by commanding ALTERFNT /C<cr>. The "C" switch
puts the image into a temporary fontfile called TEMPFONT.TMP; if you use the
/CO switch, you'll overwrite your source file, e.g. GARAMOND.POR, and
permanently change it. The TEMPFONT.TMP intermediate file lets you test
without harming the source file. TEMPFONT.TMP will be identical in every
respect to your source file except for the one character which you just
changed (the file length may differ also, because ALTERFNT writes a string
of Ascii "0"s from the end of the last character to end-of-last-sector).
Now download this TEMPFONT.TMP file to your printer (Usage 9). Command,
from DOS:
alterfnt /sw tempfont.tmp 0<cr>
Parameter "0" assigns TEMPFONT.TMP a font ID# of zero (legal values for the
font ID are 0-32767). The "W" parameter lists every character in the font
on paper, in Ascii order, with character Widths. N.B.: Any strange printer
behavior at this stage -- e.g. it prints two sheets, or the yellow Form Feed
light stays on -- means that the font file is corrupt (with good fonts,
ALTERFNT should quit to DOS as soon as the printer begins to process its
first and only sheet). Don't even try to fix the font; start from scratch.
Extract a new BINPIC image of the character that has been changed, from an
ORIGINAL copy of the font file, then graft the changed bit/dot picture onto
a fresh BINPIC (as described in section "Read Character from One File, Write
to Another File", below). Keep in mind that fonts can crash when an older
BINPIC.TMP file is re-used and the "Start_Modification | End_Modification"
byte locations have changed.
You might try putting a slash through a zero. Study the existing character
"/" (Ascii 47) first, to see how it's constructed (not a mere straight
line). The techniques of professional orthographers are fascinating (HP's
are brilliant).
* * *
Character Basics
----------------
LaserJet softfont files adhere to a rigid format. They begin with a
general definition of font characteristics (the "Font Descriptor", which
defines the typeface, pitch, underline positioning, stroke weight, etc, for
the entire font). You WON'T tamper with this Font Descriptor if you are
simply ADAPTING or ALTERING a pre-existing font (the primary use of ALTERFNT).
Select a font with general characteristics which you like, and accept them.
(ALTERFNT Usage 4 alters the Font Descriptor; Character Descriptors can be
changed with a word processor as an intermediate step between Usages 1 and 3.)
There are three pieces of basic information in the introductory Font
Descriptor which you need to keep in mind. They are: the maximum permissible
"Cell Height" and "Cell Width" of characters, and the location of an arbitrary
"Baseline" which serves as a reference point for several parameters of
individual character definitions ("Character Descriptors and Data"), which you
WILL be changing.
After the overall Font Descriptor, softfont files describe each
individual character in the font, in ascending character-number order (note
that font character numbers, e.g. in the Roman-8 set, do NOT necessarily
correspond to the console-displayed IBM character set). Each character has a
16-byte "Character Descriptor", followed by the Data which describes the
character's appearance. Not every character in the range 0-255 is defined;
off-the-shelf HP Roman-8 fonts, for example, print only characters in the
Ascii range 32-127 (plus, with fonts which access the extended-character set,
Ascii 161-254). You can access a more extended range using ALTERFNT, and a
PC-8 Font like TEMPLATE.FNT (provided here -- see below).
Fortunately, the Data which determines character appearance can be
printed to a file and to the console screen, re-shaped by you, then rewritten
to the fontfile very easily, with Usages 1-3.
Alter a Character:
-----------------
As an example, at left on the next page is ALTERFNT's output of a
Times Roman TMS12.FNT (a Public Domain font) capital "G" Ascii 71. (If you
are looking at a printout of this DOC, hold the page at arms-length distance
for greater visual clarity.) It illustrates why many computer-generated PD
fonts aren't nearly as handsome as the hand-crafted fonts which Hewlett
Packard sells; the one is stodgy where the other is svelte. The simplest use
of ALTERFNT is to clarify character appearance. In this case, no change is
made to the size or position of the character matrix; we just alter the
pattern of 0's and 1's, with ALTERFNT's Editor (Usage 2) or a word processor.
At right, we've cleaned this character up (thinned, smoothed, elongated, etc):
OLD NEW
00000000000000011111100000000000000000 00000000000000011111110000000001100000
00000000000011111000011110000010000000 00000000000011111111111110000001100000
00000000011111111000011111110110000000 00000000011111100000001111110001100000
00000000111110000000000011111110000000 00000000111110000000000011111101100000
00000011111100000000000000111110000000 00000011111100000000000000111111100000
00000111111000000000000000011110000000 00000111111000000000000000011111100000
00001111110000000000000000001110000000 00001111110000000000000000001111100000
00011111100000000000000000000110000000 00011111100000000000000000000111100000
00111111000000000000000000000111000000 00111111000000000000000000000111100000
00111110000000000000000000000011000000 00111110000000000000000000000011100000
01111110000000000000000000000011000000 01111110000000000000000000000011100000
01111110000000000000000000000000000000 01111110000000000000000000000001100000
11111100000000000000000000000000000000 11111100000000000000000000000001100000
11111100000000000000000000000000000000 11111100000000000000000000000000000000
11111000000000000000000000000000000000 11111100000000000000000000000000000000
11111000000000000000000000000000000000 11111000000000000000000000000000000000
11111000000000000000001111111111111110 11111000000000000000000000000000000000
11111000000000000000001111111111111000 11111000000000000000111111111111111111
11111000000000000000000000111111110000 11111000000000000000000001111111111000
11111000000000000000000000011111100000 11111000000000000000000000011111100000
11111000000000000000000000011111100000 11111000000000000000000000001111100000
11111100000000000000000000011111100000 11111000000000000000000000001111100000
11111100000000000000000000011111100000 11111000000000000000000000001111110000
11111100000000000000000000011111100000 11111100000000000000000000001111110000
11111100000000000000000000011111100000 11111100000000000000000000001111110000
01111110000000000000000000011111100000 01111110000000000000000000001111110000
01111110000000000000000000011111100000 01111110000000000000000000001111110000
00111111000000000000000000011111100000 00111111000000000000000000001111110000
00111111000000000000000000011111100000 00111111000000000000000000001111100000
00011111100000000000000000011111100000 00011111100000000000000000001111100000
00001111110000000000000000011111100000 00001111110000000000000000011111100000
00000111111000000000000000011111100000 00000111111000000000000000011111000000
00000011111100000000000000111111000000 00000011111100000000000000111110000000
00000000111111100000000011111100000000 00000000111111100000000011111100000000
00000000001111111111111111100000000000 00000000001111111111111111100000000000
00000000000001111111111100000000000000 00000000000000111111111000000000000000
Another example: Suppose you don't like the standard open-quote [grave
accent] Ascii 96; make it complement a close-quote (and prettify it -- note
how sloppy the original at left is; the matrix unnecessarily includes two
columns of zeros at right which aren't used [the Delta X parameter, q.v.
below, should have been used instead to pad spaces]):
OLD NEW
00000100 00111000
00001100 11111110
00011000 11111111
00110000 11111111
01100000 11111100
01000000 11000000
11000000 11000000
11000000 11000000
10001000 01100000
11111100 00110000
11111100 00011000
11111100 00001100
11111100 00000110
00111000 00000011
Make New Characters:
-------------------
Suppose you want to create your own characters, or change the size and
position of the matrix (make a character bigger or smaller, add diacritical
marks, etc). This requires some acquaintance with softfont creation. The
procedure isn't difficult, but you must be fastidious: printers will IGNORE
an improperly defined character or font (your printer may eject sheet after
sheet on download -- always check the lights on the printer control panel, to
make sure that the printer has received the font; if the FormFeed light stays
on, it means that the printer received extra or bad characters, and has queued
them for printing -- i.e. something is wrong).
When ALTERFNT writes a bit map to BINPIC.TMP, BINPIC includes a
prefatory table of information drawn from the Font- and Character-Descriptors,
as well as byte locations for writing new data to TEMPFONT.TMP. Following is
the table for Portrait character "g", Ascii 103, in font TMS12.FT:
[Font Name. DO NOT ALTER] TMS12.FT
[Character Number. IGNORED] 103
[Baseline. DO NOT ALTER] 38
[Max Cell Width. DO NOT ALTER] 52
[Max Cell Height. DO NOT ALTER] 53
[Font Orientation. DO NOT ALTER] 0
[Start_Mod_Byte. ALTERFNT USE] 10345
[Next_Mod_Byte. ALTERFNT USE] 10473
[Internal_use. DO NOT ALTER] 4
[Continuation. DO NOT ALTER] 0
[Internal_use. DO NOT ALTER] 14
[Internal_use. DO NOT ALTER] 1
Character Orientation: 0
[Internal_use. DO NOT ALTER] 0
Left Offset: 2
Top Offset: 24
Width: 22
Height: 36
Delta X: 100
A complete matrix or "cell" for characters in this font is mapped
below; character "g" is located within it, in accordance with the information
tabled above (note that ALTERFNT.COM produces character-only maps, like "G"
and "`" above, not full-cell maps like "g" below):
PORTRAIT VERSION: 1 2 3 4 5
1234567890123456789012345678901234567890123456789012
- 0000000000000000000000000000000000000000000000000000 = 1
| 0000000000000000000000000000000000000000000000000000 = 2
| 0000000000000000000000000000000000000000000000000000 = 3
| 0000000000000000000000000000000000000000000000000000 = 4
| 0000000000000000000000000000000000000000000000000000 = 5
| 0000000000000000000000000000000000000000000000000000 = 6
| 0000000000000000000000000000000000000000000000000000 = 7
| 0000000000000000000000000000000000000000000000000000 = 8
| 0000000000000000000000000000000000000000000000000000 = 9
| 0000000000000000000000000000000000000000000000000000 =10
M 0000000000000000000000000000000000000000000000000000 = 1
a 0000000000000000000000000000000000000000000000000000 = 2
x 0000000000000000000000000000000000000000000000000000 = 3
i 0000000000000000000000000000000000000000000000000000 = 4
m - - 0000000011110000000000000000000000000000000000000000 = 5
u | | 0000001110001111111111000000000000000000000000000000 = 6
m | | 0000011100000111111111100000000000000000000000000000 = 7
| | 0000111000000011110000000000000000000000000000000000 = 8
C | | 0001111000000011111000000000000000000000000000000000 = 9
e | T 0011111000000001111000000000000000000000000000000000 =20
l | o 0011111000000001111100000000000000000000000000000000 = 1
l | p 0011111000000001111100000000000000000000000000000000 = 2
| 0011111000000001111100000000000000000000000000000000 = 3
H H O 0011111000000001111000000000000000000000000000000000 = 4
e e f 0011111000000001111000000000000000000000000000000000 = 5
i i f 0011111100000001111000000000000000000000000000000000 = 6
g g s 0001111100000001111000000000000000000000000000000000 = 7
h h e 0000111100000001110000000000000000000000000000000000 = 8
t t t 0000011110000001100000000000000000000000000000000000 = 9
0000001111111111000000000000000000000000000000000000 =30
= = = 0000001000000000000000000000000000000000000000000000 = 1
0000010000000000000000000000000000000000000000000000 = 2
5 3 2 0000110000000000000000000000000000000000000000000000 = 3
3 6 4 0001110000000000000000000000000000000000000000000000 = 4
| | | 0011111111111110000000000000000000000000000000000000 = 5
| | | 0011111111111111111000000000000000000000000000000000 = 6
| | | 0011111111111111111110000000000000000000000000000000 = 7
| | | 0000111111111111111111000000000000000000000000000000 = 8
| | - BASELINE *--0011000000000011111110%000----BASELINE------------ =39
| | -------------/ 000111000000000000111110 \----------------- 0000000 =40
| | |"*"=position | 001100000000000000001110 |"%"=position | 0000000 = 1
| | | of cursor | 011100000000000000001100 | of cursor | 0000000 = 2
| | | BEFORE | 011100000000000000001100 | AFTER printing, | 0000000 = 3
| | | printing | 011100000000000000001100 | determined by | 0000000 = 4
| | ------------- 011100000000000000011000 | Delta X | 0000000 = 5
| | 011110000000000000110000 ----------------- 0000000 = 6
| | 0111111111111111111000000000000000000000000000000000 = 7
| | 0011111111111111100000000000000000000000000000000000 = 8
| | 0001111111111111000000000000000000000000000000000000 = 9
| - 0000001111110000000000000000000000000000000000000000 =50
| 0000000000000000000000000000000000000000000000000000 = 1
| 0000000000000000000000000000000000000000000000000000 = 2
- 0000000000000000000000000000000000000000000000000000 = 3
|-|< Left Offset = 2
|<-------Width = 22 >|
|<-------Delta X = 25*4>| [i.e. Delta X = 100]
|<-------------Maximum Cell Width = 52------------>|
LANDSCAPE VERSION: 1 2 3 34 5
12345678901234567890123456789012345678901234567890123
=====================================================
52 0000000000000000000000000000000000000 | 0000000000000 -
..................................... | ............. |
..................................... | ............. |
35 0000000000000000000000000000000000000 B 0000000000000 |
4 0000000000000000000000000000000000000 A 0000000000000 |
3 0000000000000000000000000000000000000 S 0000000000000 |
2 00000000000000000 ----------------- E 0000000000000 |
1 00000000000000000 |"%"=position | L 0000000000000 |
30 00000000000000000 | of cursor | I 0000000000000 |
9 00000000000000000 | AFTER printing, | N 0000000000000 |
8 00000000000000000 | determined by | E 0000000000000 M
7 00000000000000000 | Delta X | | 0000000000000 a
6 00000000000000000 ----------------- \| 0000000000000 x
5 00000000000000000000000000000000000000%00000000000000 i
4 00000000000000000000000000000000000000000000000000000 - m
3 00000000000000001000000000000000000000111000000000000 - - | u
2 00000000000000011000000000000000000001111111000000000 | | | m
1 00000000000000011000000000000000000011111111100000000 | | |
20 00000000000000011000111000000000000011110000110000000 T | | C
9 00000000000000011011111111100000000111110000011000000 o | | e
8 00000000000000011111111111110000000111100000001000000 p | | l
7 00000000000000011111111111111000000111100000001100000 | D l
6 00000000000000011111111111111100000111000000001110000 O H e
5 00000000000000011110000000000100001111000000001110000 f e l W
4 00000000000000011000000000000100001111000000001110000 f i t i
3 00000000000000010000000000000100001111000000001110000 s g a d
2 00000000000000100000000000000100001111000000001111000 e h t
1 00000000000000100000000000000100001111000000001111000 t t X h
10 00000000000000100000000000000100001111000000001111000
9 00000000000000110000000000001100001111000000001111000 = = = =
8 00000000000000011000000001111100001111000000001111000
7 00000000000000011111111111111110001111000000001111000 2 2 2 5
6 00000000000000001111111111111001111111110000001110000 3 2 5 2
5 00000000000000000111111111110000111111110000011110000 | | * |
4 00000000000000000011111111100000011110011111111110000 | | 4 |
3 00000000000000000001111111000000001110001111111100000 | | | |
2 0000000000000000000000000000000000000 | 0111111000000 | - | |
1 0000000000000000000000000000000000000 | 0000000000000 - | -
------------------------------------------->* -
|"*"=position |
| of cursor | |< Left Offset = (-24) >|
| BEFORE | |<-------Width = 36--------------->|
| printing |
-------------
|<-------Maximum Cell Height = 53------------------>|
You should NOT change any of the following entries in the BINPIC table unless
you know what you're doing; they are informational. By the bye, if you're
thinking of mixing portrait and landscape orientation in one font, that's
against HP's rules:
[Internal Use] [don't change]
[Alterfnt Use] [don't change]
Character Number [ignored by ALTERFNT Usage 3]
[Baseline] [don't change]
[Max Cell Width] [don't change]
[Max Cell Height] [don't change]
[Font Orientation] [don't change]
[Start_Mod_Byte] [don't change]
[Next_Mod_Byte] [don't change]
[Continuation] [don't change]
You may want or need to change some of the following. Unlike v1.x, you can
enter new values in BINPIC.TMP anywhere you want on the line to which they
pertain, after the colon ":" or right-bracket "]". Then <cr>. Be sure to
ERASE the old values:
Font Name
Character Orientation
Left Offset
Top Offset
Width
Height
Delta X
(The following discussion pertains specifically to Portrait font
values; Landscape fonts are a bit different. N.B. In the Landscape map
above, note that Font Descriptors "Maximum Cell Height" and "Maximum Cell
Width" do NOT change orientation, whereas Character Height and Width DO change
orientation! Study the above cells carefully.)
You may add or subtract rows or columns to/from the cell (but don't
exceed the maximum cell height and width for the font). If you change row or
column sizes, some or all of the top offset, left offset, character height,
character width, and "Delta X" values will change also. For top offset, left
offset, height, and width, simply count them up (refer to figures "g" above in
the proper orientation for an elucidation), and enter new values in the
BINPIC.TMP table in decimal notation. The Baseline takes a value of 0 for
calculation of the relative top offset.
"Delta X" is slightly complicated: in Portrait,
Delta X=4*((left_offset)+(character_width)+(right_offset)). Delta X
determines where the cursor will be located when the NEXT character is printed
(see position "%" in figure "g"); the right offset figure is implicit in
Delta X, and not otherwise stated. Because Delta X represents quarter-dots,
the total left/right_offset+char_width value is multiplied by 4, and entered
as a decimal number in BINPIC.TMP's table. N.B.: Delta X is only significant
for proportional fonts.
Values must AGREE!! For example, if you change the width or left
offset, then change Delta X accordingly; if you alter the height, examine the
impact on top offset (if top offset stays the same, then make sure you don't
push below the bottom of the cell); and so forth. You MUST be fastidious,
otherwise the font crashes.
Version 2.x checks BINPIC.TMP fairly thoroughly for errors before
beginning to write files. When data doesn't agree, lines are different
lengths, or the structure of BINPIC.TMP is incorrect, the problem is described
(the correct formula for calculation generally given). Note that some checks,
e.g. for the validity of Delta X, are not performed. The reason is worth
examining. In general, Delta X MUST exceed the values for (Width +
Left_offset [+ an implied right-offset]) multiplied by 4. In rare cases, the
implicit right_offset is a negative number; in other words, the cursor moves
left after printing. Thus Delta X is here less than (Width + Left_offset)*4.
Since these are aesthetic judgments, no routine check is possible.
Don't delete a descriptor line! If in doubt, go back and generate a
new BINPIC.TMP with Usage 1, to compare. The best procedure is to keep
BINPIC.TMP in a window of your word processor, and use the DOS Shell function
to go back and forth between the editor and ALTERFNT. N.B.: Never use an old
BINPIC.TMP file twice!! The starting and ending byte locations logged in
BINPIC will change when you re-write a font, which henceforth makes this
BINPIC invalid. ALTERFNT performs no check for the accuracy of these
locations when re-writing a file.
Read Character from One File, Write to Another File:
---------------------------------------------------
Suppose you want to read character 64 from one font_file and write it
as character 200 in another file. You CANNOT accomplish this by changing the
character number in BINPIC's table (ALTERFNT uses BINPIC's tabled byte-
locations to determine where to make changes, not the character number). If
you don't want to alter the character as an intermediate process, use Usage 7.
If you do want to alter it, use your (multiple-window) word processor as a DOS
shell. Command from DOS [ALTERFNT Usage 1]:
alterfnt /g source_file 64
and load the resultant BINPIC.TMP into a window of your word processor. Then
shell to DOS and command [ALTERFNT Usage 1]:
alterfnt /g destination_file 200
Load this second BINPIC in a second word processor window.
[You need two BINPICs because ALTERFNT requires character information
derived from the source_file, as well as read/write byte locations from
the destination_file.]
Make the desired changes to the bit-image from the source_file. Now do a
Block DELETE on the DESTINATION_file BINPIC: erase every line beginning with
the line labelled "Character Orientation" down to the bottom of the bit map
(end-of-file) -- but preserve the first twelve lines of this DESTINATION_file
BINPIC. (In v1.x, the top seven lines were preserved.) Then do a Block MOVE
from the SOURCE_file BINPIC, from line "Character Orientation" to the bottom,
and append this block (which includes the bottom portion of the SOURCE_file
BINPIC table plus the whole bit map) to the truncated DESTINATION_file BINPIC.
Store this revised destination_file BINPIC to disk (make it the BINPIC.TMP
file-of-record). Shell to DOS, and run ALTERFNT /C [Usage 3] to write a new
TEMPFONT.TMP.
With a keyboard or word processor [e.g. XyWrite] macro program, you
can write macros to change a normal characters to bold; to expand point sizes;
etc.
TEMPLATE.FNT
------------
TEMPLATE.FNT is for the adventurous only. It's a portrait font_file
which defines every character number from 1 to 255 except characters 7-15 and
27. Every number is loaded with the same dummy character (a 1-bit/HMI 0
"nothing" [see v2.0 Update Notes, below] -- you can't use this file as-is).
TEMPLATE's Font Descriptor defines it nominally as a PC-8 font (Symbol Set
10U). It has rough characteristics (cell height & width, proportional
spacing, pitch, etc) of a 12pt TimesRoman typeface, but it's assigned Typeface
value 100 (an undefined typeface), so make it whatever you want. This is for
people who don't like the idiosyncratic Roman-8 set, or don't understand why
HP omitted characters 1-31, 128-160, and 242-246. Make a SuperFont, with more
characters than you can use. Refer to DESCRPTR.TXT and then use ALTERFNT
Usage 4 [described in v2.0 Update Notes, below] to change the Font Descriptor
as required.
Other Files in ALTRFT21.ARC:
---------------------------
DESCRPTR.TXT byte locations, and brief explanations, of Font and
Character Descriptor values [technical]
TEMPLATE.FNT blank PC-8 font accessing almost every character 1-255
Limitations:
-----------
ALTERFNT should work with any file- or character-size; it has been
tested on files of 85K bytes, and 40pt characters.
ALTERFNT only accesses files in the current directory; no pathing is
permitted.
This file is designed for monochrome display adaptors (NO GRAPHICS
REQUIRED).
Hewlett Packard (and perhaps other commercial font publishers also)
categorically forbids its licensees (soft-font purchasers) to modify HP soft-
fonts.
Update Notes for Version 2.2:
============================
Corrects improper compile of v2.1
Update Notes for Version 2.1:
============================
Usage 9 is added, which downloads single fonts to a parallel printer, and
optionally prints a character|width table of the font. DOWNLD.COM is removed
from ALTRFT21.ARC. Note that this has two drawbacks: DOWNLD performs a check
for printer on-line before downloading, and offers the option of
Permanent|Temporary font status. ALTERFNT Usage 9 automatically downloads
fonts with Permanent status, and does not perform an on-line check.
Documentation errors fixed.
Update Notes for Version 2.0:
============================
The executable file (ALTERFNT.COM) is totally revised. Usages 2, 4-8 are
added. Usages 1 and 3 operate more or less as before (error-checking and much
speed added, but Usage 1 now requires a "/g" parameter, and Usage 3 (formerly
called Usage 2) takes new parameter names "c" and "o"). ALTERFNT
documentation is clarified.
TEMPLATE.FNT
------------
TEMPLATE.FNT is changed and improved. As noted above, TEMPLATE.FNT is an
EMPTY (PC-8 type) font containing character descriptors for every character
except those reserved by Hewlett-Packard (7-15 and 27). Hewlett-Packard deals
with empty characters by skipping them: they don't exist in the font. I put
them in TEMPLATE.FNT so it would be simple to make new characters: you don't
have to create descriptors for them, which requires work and thorough
understanding (there's plenty to contend with anyway). But the old
TEMPLATE.FNT was loaded with illegal dummy characters, which worked only
accidentally (my error).
The new TEMPLATE.FNT contains legal dummy characters which are not really
"empty": left offset=-1, width=1, height=1, Delta X=0, and it prints a
single-dot "0" (=blank). In other words, "empty" characters move the cursor
backward 1 dot, then print a 1-dot space. Result: no printing and no cursor
movement in sum. This works even when printing in column 0 at left
(theoretically, there's no column into which the cursor can move in response
to left offset = -1, but let's not fuss: it works).
How do you make a real space (Ascii 32)? Two ways: 1) If you want, e.g. an
11-dot space, set width=11, height=1, top offset=0, Delta X=44, and put eleven
"0"s in the bit-image: "00000000000"<cr>. 2) Delete (Usage 8) the space
character (Ascii 32); on receipt of undefined characters (e.g. Ascii 32),
fonts default to the Pitch (HMI) value in the Font Descriptor. In this
example, set Pitch (Usage 4) to "44". Pitch is described in 1/4 dots, so a
value of 44 yields an 11 dot space. N.B.: A subtle benefit of TEMPLATE.FNT
is that undefined characters result in no cursor movement, whereas fonts which
omit characters print an HMI space on receipt of an undefined character.
Some users have loaded TEMPLATE.FNT with characters, the font prints fine when
tested, but TEMPLATE won't work with their word processor. Probable reason:
it's a PC-8 font, which is Symbol set 10U (Roman-8 is 8U). You must configure
your word processor to issue appropriate Escape sequences. Its easy with
XyWrite (no WP I've seen beats XyWrite for flexibility of all sorts), but some
WPs lack XyWrite's configurability.
Have fun!
* * *
ALTERFNT.COM v2.2a (c)R.J.Holmgren 10/27/88
Voice: (212)749-7882 [5-10 PM EST/EDT]
Messages: Sound of Music BBS (516)536-8723
This file is provided FREE to all. User assumes ALL risks of malfunction
or misapplication. Copyright Holder PROHIBITS the sale or commercial
distribution of this program. Please report bugs or suggestions.