home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
misc
/
fprint.lzh
/
FPRINT.DOC
next >
Wrap
Text File
|
1985-02-17
|
15KB
|
349 lines
FPRINT Font Printer
Version 2.0
J Anthony Movshon
February 17, 1985
FPRINT formats text for output to an LA50 or LA100 with the extended
logic option. The input text can come either from a file or be typed in
by hand. FPRINT uses fonts generated by the FEDIT program, and outputs
the graphic sequences to draw those characters on the printer. FPRINT
also knows how to do text justification, centering, paging and other
document-formatting operations. FPRINT is based on a CP/M program of
the same name by A. Christopher Hall; the present version is for MS-
DOS, version 2 or later.
RUNNING FPRINT
There are several ways to run fprint; the general syntax is
fprint [ -p ] [ -o outfile ] [ infile ]
Simplest is to invoke the program by typing "fprint". You will get a
">" prompt. The first thing you must do is read in one or more font
files (described with the directives below). Then you can type lines of
text or issue directives to change the formatting, control the printing,
or include text from a file. When you are done, type a line containing
only a single ".". FPRINT will ask if you want the output sent to the
printer immediately; answer "Y" or "N". In either case, the output will
be in the default file FPRINT.TXT, which can subsequently be printed in
the usual way. It takes quite a while to print the file -- every
character of your text needs 20 to 100 ASCII characters to draw it -- so
some kind of print spooler is an advantage.
If you specify an input file on the command line, FPRINT will not
prompt for keyboard input but will immediately read and process the
file, diplaying the input text as it proceeds. When done, FPRINT will
immediately ask if you want the file printed. Note that the input file
must contain the directive to read the font file (as well as other
directives), since you don't get a chance to type that information in
yourself.
The command line options "-p" and "-o outfile" control the
destination of FPRINT's output. If you use the -p flag, FPRINT will not
create an output file but will print the formatted text as it is
processed. This option is useful when disk space is at a premium, since
FPRINT's output files can run to tens of thousands of bytes even for
rather short documents. The disadvantage of this method is that when
you are typing input from the keyboard, you must wait for FPRINT to
process each line before proceeding. The -o flag allows you to direct
FPRINT's output to another file than the default "fprint.txt".
FONTS
A number of fonts are supplied with the FPRINT/FEDIT package. They
come in three sizes: 12, 18, and 24 printer-dots ("points") high.
FPRINT's points (1/72 inch) are actually a little smaller than a true
point. The supplied fonts are described below. It's easy to make more
(especially if you can hack one of these fonts) using the font editor
FEDIT. You can make larger or smaller fonts, as long as the height is a
multiple of 6. However, 6 points is pretty tiny, and FEDIT cannot
presently edit a font larger than 24 points. By convention, the name of
the font file is the font style followed by one of the sizes, such as
ASCII12 or GOTHB24. The font file type is .FNT.
Font Size(s) Description
ASCII 12 Plain characters (too small to be fancy)
ROMAN 18, 24 Serifs. Book-like type.
ITALIC 18, 24 Serifs and slanted forward.
GOTH 18, 24 Gothic: Sans-serif. Block characters.
GOTHB 18, 24 Gothic Bold: Sans-serif; thicker than GOTH.
COPR 18, 24 Copperplate Gothic. Very small serifs.
CIRCUS 24 Gothic, thick at top and bottom; like a circus
sign or an old western wanted poster.
OLDENG 18 Old English Gothic lettering.
FEANOR 12, 18 Middle-Earth Elvenscript from "The Lord of the
Rings".
PUNC 18, 24 Incomplete plain punctuation and number font.
DIRECTIVES
Directives tell FPRINT to read font files or text files, change
fonts, set formatting parameters like line and character spacing, or
tabs, and change formatting techniques like justification and centering.
All directives begin with "." and must be preceded and followed by a
space or a CRLF. Most directives can appear anywhere between two words
on the line, mingled with text or other directives.
In the descriptions below, "n" means a decimal number and "c" is a
character. These and filename arguments must follow the directive
without intervening white space. Three types of spacing measure are
used by the various directives:
o A "space" is a character from some font. It's used, for example, to
separate words or to set paragraph indentations.
o A "microspace" is the room occupied by a single dot typed by one wire
of the printer; there are 144 microspaces to the hiorozontal inch of
print.
o A "line" is the height of a single graphic line, which contains 6
rows of print dots. There are 12 graphic lines to the vertical inch
of print.
Directives which are in effect at startup are marked "Default".
.An
Make font n (1 <= n <= 5) current: text will be output using that
font until another .A directive is encountered. See also .Fn.
Making a font current changes the values of character and line
spacing to the defaults or modified values for that font.
.B
Output a blank line when a blank line is typed. This seems
obvious, but see .NB. Default.
.C
Center the next line within the current width, not considering any
left margin that may be specified. .C works for only one line, so
you have to type ".C" before every line you want centered.
.Fnname
Read the font file "name.fnt" into font n. Some font must be read
in before any text is processed. FPRINT can hold up to 5
different fonts at a time. You may read fonts at any time; the
old font n, if there is one, will be replaced by the new one.
Note that reading a font does not make it current; the current
font is specified with the .An and .NA commands.
.JHc
Set the Justify Header Character to "c". If you are justifying
(either fill or no-fill) and have a non-zero left margin, then
when FPRINT wants to output a new paragraph it will put "c" at the
margin of the first line. This would be used to indent a
paragraph and start it with a "bullet". If "c" is the letter "N"
then the paragraphs will be numbered consecutively, starting with
1. The number and a period will be output at the margin
(Restriction: FPRINT only understands single digits now, so don't
use this with more than 9 paragraphs). To cancel the Header, use
.NH.
.JU
Justify within the given width and left margin. The right margin
is left ragged. Type a blank line to end a paragraph. .NJ stops
the justifying. See also paragraph indent (.Pn), blank line
outputting (.B and .NB), left margin (.Mn), and Justify Header
(.JHc). [This notation is confusing: what is meant by "justify" is
in fact "fill but do not justify", like .F;.NJ in RUNOFF].
.JF
Justify filled within the given width. Same as .JU except the
right margin is made straight.
.Ln
Set the number of blank lines output after a line of text. A
blank line is six micro-dots high (so in general it's much smaller
than the height of the text). The default value is carried with
each font, and varies. The usual value is 1. 0 is illegal. Once
set by .L, the default value for the current font is changed, so
if it is later reselected, the value set by .L is restored.
.Mn
Set the left margin for justified text. N is the number of
microspaces which precedes each line. Default: 0. Note that
previous versions of FPRINT set this margin not in microspaces but
in spaces of the current font. The default value is 144 (1 in).
.NA
Set no alternate font. This is the same as .F1.
.NB
When justifying, suppress the output of a blank line when a blank
line is typed. A blank line ends the current paragraph, however
it's not always desirable to have the blank line appear in the
output.
.NH
Clear the Justify Header Character. See .JHc.
.NJ
Stop justifying. Text will be output line by line as it is typed
in. Default.
.NTS
Clear all tab settings. See .NTn, .TSn, .TN and .TB. Default.
.NTn
Clear the tab which has been set at microspace position n. See
.NTS, .TSn, .TN and .TB.
.Pn
Set paragraph indent for justify. N is the number of spaces to
indent.
.PG
Force a page break and continue output on a new page.
.PLn
Set the length of the print area of the page to be n graphic
lines in length. The default is 108 (9 in).
.PMn
Set the top margin (the number of blank graphic lines at the top
of each new page) to n. The default value is 9 (3/4 in).
.PTn
Test that at least n graphic lines remain on the current page; if
not, force a page break and continue output on a new page.
.Rfile.nam
Read the file "file.nam" and process directives and text from it;
then return for user input.
.Sn
Set the letter spacing. This is the number of microspaces output
between characters. A wider value gives "extended" text; a
narrower one makes the text look "condensed". The default value
is carried with each font, and varies. This directive changes the
default value for the current font only: changing fonts selects
the default or altered value for the new font.
.TB
Move to the next tab setting. This will also be done if a tab
character (control-I, octal 11) is found in the text. The tab
settings must previously have been set up using .TSn commands.
Tabs encountered when no tab-stops have been set are treated as
spaces.
.TN
Set "normal" tabstops, every 144 microspaces (i.e. every inch), up
to 1440 (10 inches).
.TSn
Set a tab at the microspace position n.
.Wn
Set line width to be n microspaces, 144 microspaces to the inch.
A value of 1152 fills an 8 inch print line completely. The
maximum value of n is 2260, corresponding to a 15 inch line. The
value specified by .W includes and is not added to the left margin
value specified with .M; thus changes in .M do not change the
right margin. The default value is 1008, giving a 7-inch print
line, of which the first inch is blank margin.
PAGE MARGINS
The following diagram shows FPRINT's default margins and the
directives used to change them.
---------------------------------------------------------
| ^ |
| | Default is 3/4" |
| Top Margin |
| | Set with .PM |
| v |
| ^ |
| | |
| Left | |
|<------> | Default is 9" |
| Margin Page Length |
| Default is 1" | Set with .PL |
| Set with .M . |
| |
| Line |
|<------------------------------------------------> |
| Width |
| Default is 7", set with .PL |
| |
| . |
| | |
| v |
| |
| |
---------------------------------------------------------
Although the nominal left and right margins are 1 and 1 1/2 in on 8 1/2
by 11 in paper, on fanfold paper in an LA50, they become symmetrical and
roughly 1 1/4 in. Similarly, the asymmetry between the top (3/4 in) and
bottom (1 1/4 in) margin is usually rectified by the fact that the top
of the page is usually a little higher than the printhead when paper is
loaded.
SYSTEM REQUIREMENTS
FPRINT will run on a DEC Rainbow or other MSDOS personal computer
with minimal ANSI screen support; it requires a DEC LA34, LA50 or LA100
printer with graphics option. The companion font editor FEDIT requires
a VT100 or compatible screen and is configured for the Rainbow keyboard.
The source code should be reasonably easily ported to other kinds of
computer (the original version was written in BDS C for CP/M-80; the
present version is for Microsoft/Lattice C).
In a minimal MSDOS 2.05 or 2.11 system with 128 kbytes of memory,
FPRINT has enough free memory to accommodate any five fonts. If the
amount of free memory (revealed by CHKDSK) is for some reason smaller
than about 70000 bytes, it may be impossible to accommodate all fonts
simultaneously and a ".f" directive will elicit an error message saying
there is no more room for another font. When that happens, everything
is O.K., except that the latest font has not been read. If you really
want that font, you have to get rid of one of the other fonts (by
reading the new font over it).
BUGS AND LIMITATIONS
The paging routine does not presently number pages. This will be
fixed in version 2.1.
Multiple pages can not presently be printed easily using single
sheets, since no mechanism exists to pause to allow a new sheet to be
loaded. This will be fixed in version 2.1. It would be relatively easy
to write a program to print FPRINT files in this controlled manner.
The Justify Header Character is always printed at the left edge of
the paper; it should be possible to specify this margin separately.
While many bugs (some causing fatal crashes) have been removed from
the justification routines, these are sufficiently convoluted that is
perfectly possible that some remain.
FPRINT attempts be sensible about accepting strange parameter values
from directives, but it is probably possible to demolish the program by
feeding it enough weird numbers.
Characters beyond the 80th column of an input file are discarded
without warning.
Please report any bugs you may find or suggestions for improvements
to the author by one or more of the following routes. I would also
appreciate receiving copies of any new fonts you may create.
J. Anthony Movshon
US mail: 100 Bleecker Street
New York, NY 10012
ARPAnet mail: hipl!tony@nyu-cmcl2
USENET mail: {seismo|allegra|ihnp4}!cmcl2!hipl!tony
Or leave a message for me (as "Tony Movshon") on the DEC-WARE
Fido BBS (212 535-8924).