mirror of
https://github.com/PDP-10/its.git
synced 2026-03-09 04:19:38 +00:00
Working paper 78: FED, the Font "EDitor".
This commit is contained in:
305
doc/wp/fed.78w1
Normal file
305
doc/wp/fed.78w1
Normal file
@@ -0,0 +1,305 @@
|
||||
.xgp
|
||||
.font 0 25vg
|
||||
.font 1 s25xif
|
||||
.font 2 25vmic
|
||||
.font 3 40vshd
|
||||
.ulfont 87
|
||||
.squish
|
||||
.topm 50
|
||||
.sidm 50
|
||||
.spw 16
|
||||
.he1
|
||||
FED and Font Formats
|
||||
.nf
|
||||
.in 38
|
||||
2Massachusetts Institute of Technology
|
||||
|
||||
Artificial Intelligence Laboratory0
|
||||
.in 0
|
||||
.sp 5
|
||||
.spread
|
||||
/3WORKING PAPER #780//(revision 1)/
|
||||
.ri
|
||||
8 October, 1975
|
||||
.sp 4
|
||||
.ce
|
||||
FED, the Font "EDitor"
|
||||
.center
|
||||
and
|
||||
.center
|
||||
Font Formats
|
||||
|
||||
.center
|
||||
by
|
||||
|
||||
.center
|
||||
Joseph D. Cohen and J. Pitts Jarvis
|
||||
.sp 6
|
||||
.center
|
||||
Abstract
|
||||
.adjust
|
||||
This memo describes
|
||||
FED, a program used for compiling and inspecting fonts;
|
||||
AST font format, a text format which can be used to create and edit fonts;
|
||||
and KST font format, the binary format used by SCRIMP, TJ6, and PUB.
|
||||
.sp 6
|
||||
Work reported herein was conducted at the Artificial Intelligence
|
||||
Laboratory, a Massachusetts Institute of Technology research program
|
||||
supported in part by the Advanced Research Projects Agency of the
|
||||
Department of Defense and monitored by the Office of Naval Research
|
||||
under Contact number N00014-70-A-0362-0005.
|
||||
.sp
|
||||
Working Papers are informal papers intended primarily for internal use.
|
||||
.he2
|
||||
Font Editor and Console Operation.
|
||||
.pa
|
||||
.sect
|
||||
FED, the Font "EDitor"
|
||||
.sp
|
||||
FED is a program used for compiling and inspecting fonts.
|
||||
FED understands the following font formats:
|
||||
.in 16
|
||||
.un 8
|
||||
AST -- text format which can be used to create and edit fonts in TECO;
|
||||
.un 8
|
||||
KST -- MITAI and CMU compiled font format, used by programs like SCRIMP, TJ6, and PUB;
|
||||
.un 8
|
||||
CMU -- a newer compiled CMU format;
|
||||
.un 8
|
||||
CU -- the newest compiled CMU format;
|
||||
.un 8
|
||||
FNT -- SAIL compiled font format; and
|
||||
.un 8
|
||||
XH -- Xerox PARC compiled font format.
|
||||
.in 0
|
||||
FED reads all formats, but writes only AST and KST.
|
||||
.sp
|
||||
FED asks for an input file name. If the second name is AST, KST, FNT, or XH,
|
||||
FED assumes the input file to be in the appropriate format. If the second name
|
||||
is something else, FED asks what FORMAT the input file is in.
|
||||
If the file name is blank, FED kills itself.
|
||||
FED reads the file and types out various decimal data.
|
||||
A FIXED width font is one in which the CHARACTER WIDTH of all defined characters is the same as
|
||||
the CHARACTER WIDTH of a space.
|
||||
FED calls all other fonts VARIABLE width.
|
||||
.sp
|
||||
FED tries to display the font on the user's terminal, if it's a TV display;
|
||||
or on the 340, if the user is near there, and the 340 and PDP6 are available.
|
||||
FED displays as though one XGP dot equals one display dot, so the size and proportion
|
||||
of the font will be distorted.
|
||||
(200 horizontal XGP dots = 1 inch, 192 vertical dots = 1 inch.
|
||||
~108 horizontal 340 dots = ~108 vertical 340 dots = 1 inch.
|
||||
~58 horizontal TV display dots = 1 inch. ~57 vertical TV display dots = 1 inch.
|
||||
A TV font display will therefore be enlarged 4 diameters over the same
|
||||
font on the XGP.)
|
||||
.sp
|
||||
FED then offers to write out the font.
|
||||
If you type N, FED restarts itself; if
|
||||
you type Y, it asks for the output file name; and if anything else is typed, it repeats
|
||||
its offer.
|
||||
If you write the file, FED will offer to compact the raster.
|
||||
(This is a horizontal compaction accomplished by eliminating leading
|
||||
and trailing blank columns.) If you type Y, FED will compact the raster
|
||||
as much as possible, and tell you how many words the compaction will
|
||||
save in the XGP's PDP11. When compacting, FED will also let you know
|
||||
if there are any characters whose raster is wider than the defined
|
||||
raster width.
|
||||
The input default system name is FONTS, the output default system name is
|
||||
the job's SNAME.
|
||||
Input and output default second file name is KST.
|
||||
.sp
|
||||
Please do not write new fonts onto the FONTS directory --
|
||||
it is almost full. Absolutely do not modify
|
||||
fonts on the FONTS directory. All concerned programs are perfectly capable of reading
|
||||
fonts from your very own directory. The reason for this injunction is that it has
|
||||
been determined, after much experimentation, that the definition of "improvement" is
|
||||
consistently a local variable. Please keep your "improvements" to yourself.
|
||||
.sp
|
||||
.block 23
|
||||
A typical FED console session looks as follows:
|
||||
(User typein is underlined, 1î0 is a carriage return.)
|
||||
|
||||
.nf
|
||||
1:fedî
|
||||
FED 119
|
||||
INPUT: jdc;ast >î
|
||||
FORMAT: kstî
|
||||
READING: DSK:JDC;AST 25
|
||||
142 DUPLICATE CHARACTER
|
||||
FILE: DSK:JDC;AST 25
|
||||
KSTID: 0
|
||||
CHARACTERS READ: 128
|
||||
HEIGHT: 25
|
||||
WIDTH: (VARIABLE)10
|
||||
WRITE? (Y OR N)y
|
||||
FILE: ast kstî
|
||||
FILE ALREADY EXISTS. CLOBBER? (Y OR N)y
|
||||
WRITING: DSK:JDC;AST KST
|
||||
COMPACT RASTER? (Y OR N)y
|
||||
2032 (OCTAL) PDP11 WORDS SAVED
|
||||
INPUT: î
|
||||
|
||||
:KILL0
|
||||
.ad
|
||||
.he2
|
||||
AST Font Format
|
||||
.pa
|
||||
.sect
|
||||
AST Font Format
|
||||
.sp
|
||||
The AST font format is a text format which can be used to
|
||||
create and edit fonts in TECO. An AST file has one page of font data, followed by
|
||||
one page of character data for each defined character. All numbers except
|
||||
CHARACTER CODE are decimal.
|
||||
It is the order of the numbers, rather than
|
||||
the text identification after them, that FED looks at.
|
||||
The identification is merely a convenience.
|
||||
.sp
|
||||
The file's first page is font data and looks like:
|
||||
.nf
|
||||
1n KSTID dev:dir;file name
|
||||
n HEIGHT
|
||||
n BASE LINE
|
||||
n COLUMN POSITION ADJUSTMENT0
|
||||
.sp
|
||||
.ad
|
||||
.in 8
|
||||
.un 8
|
||||
1KSTID0 is a currently unimplemented feature. It is intended to be a unique number
|
||||
for each font so that PDP11 will know which fonts are loaded,
|
||||
and not do unnecessary reloads.
|
||||
KSTID is used by CMU. (KSTID should be set to 0.)
|
||||
FED writes, on every page of the output AST file, the file name of the
|
||||
source font file. On input FED ignores the file name data in AST files.
|
||||
.un 8
|
||||
1HEIGHT0 is the height of all characters in XGP raster lines.
|
||||
.un 8
|
||||
1BASE LINE0 is the location of the character base line in XGP raster
|
||||
lines from the top of
|
||||
all characters. (The base line is used by the XGP underscore command.
|
||||
See Working Paper #72, XGP Font Catalog.)
|
||||
.un 8
|
||||
1COLUMN POSITION ADJUSTMENT0 is an artifact. It is a
|
||||
number which is added to the LEFT KERN of each character to get its total left kern.
|
||||
To be SAIL compatible, COLUMN POSITION ADJUSTMENT should be 0, and all kerning
|
||||
sould be included
|
||||
in individual character data.
|
||||
.in 0
|
||||
.sp
|
||||
The rest of the file is one page of character data for each defined character.
|
||||
Each page looks like:
|
||||
.nf
|
||||
1n CHARACTER CODE
|
||||
n RASTER WIDTH
|
||||
n CHARACTER WIDTH
|
||||
n LEFT KERN
|
||||
* *
|
||||
* *
|
||||
*
|
||||
* *
|
||||
* *0
|
||||
.sp
|
||||
.ad
|
||||
.in 8
|
||||
.un 8
|
||||
1CHARACTER CODE0 is the octal ASCII code of the character.
|
||||
.un 8
|
||||
1RASTER WIDTH0 is the width of the raster in XGP dots.
|
||||
It is a good idea to make the raster width as small as possible,
|
||||
in order to save space in font files, and to allow the XGP PDP11 to
|
||||
store more fonts.
|
||||
A leading blank column can be flushed if RASTER WIDTH and LEFT KERN are
|
||||
decremented. Trailing blank columns can be flushed by simply decrementing RASTER WIDTH.
|
||||
(The FED compact feature does this automatically.)
|
||||
.un 8
|
||||
1CHARACTER WIDTH0 is the amount, in XGP dots, that printing this character will
|
||||
advance the line postion.
|
||||
This number is completely independent of RASTER WIDTH, and LEFT KERN.
|
||||
For example, if CHARACTER WIDTH<RASTER WIDTH,
|
||||
characters will overlap.
|
||||
If CHARACTER WIDTH>RASTER WIDTH, there will be extra
|
||||
blank columns in the character. How many appear on each side is determined
|
||||
by LEFT KERN.
|
||||
.un 8
|
||||
1LEFT KERN0 (plus COLUMN POSITION ADJUSTMENT, if any) is the amount to move left
|
||||
from the logical left end of the character before printing the raster.
|
||||
(Positive left kern means move left; negative, move right.)
|
||||
.un 8
|
||||
1*0 is any printing character used to define the CHARACTER RASTER.
|
||||
Each raster row is represented by a text line.
|
||||
If a space appears, the bit is off in the
|
||||
raster, if a printing character appears, the bit is on. Carriage return terminates the
|
||||
text row, and implies blanks for the rest of the raster row.
|
||||
Formfeed terminates the raster, and implies trailing blank raster lines.
|
||||
The first row is the top row. Information wider than
|
||||
RASTER WIDTH is ignored.
|
||||
.in 0
|
||||
.he2
|
||||
KST Font Format
|
||||
.pa
|
||||
.sect
|
||||
KST Font Format
|
||||
.sp
|
||||
KST is CMU's oldest and MITAI's only compiled binary font format.
|
||||
SCRIMP, TJ6, PUB, and other programs all use KST files as their font
|
||||
definitions. KST format is as follows:
|
||||
.nf
|
||||
Word 0/ 1KSTID0
|
||||
Word 1/ 9 bits 1COLUMN POSITION ADJUSTMENT0, 9 bits 1BASE LINE,,HEIGHT0
|
||||
.ad
|
||||
The remainder of the file has one block of data for each character. Each block
|
||||
looks like:
|
||||
.in 16
|
||||
.un 8
|
||||
1USER ID0 ;not currently used but low order bit is on. This
|
||||
bit can be used to find the beginning of a new block. The last block is followed by a -1.
|
||||
.nf
|
||||
.in 0
|
||||
1LEFT KERN,,CHARACTER CODE
|
||||
RASTER WIDTH,,CHARACTER WIDTH
|
||||
CHARACTER MATRIX0
|
||||
.ad
|
||||
The character matrix is stored four 8-bit bytes per word,
|
||||
so that ILDBs with 8-bit byte size get successive bytes.
|
||||
The remaining two low order bits are 0.
|
||||
The bits are reversed in each byte (becuase of the way the XGP interface works)
|
||||
so that the high order (leftmost) bit of the character is the
|
||||
low order bit of the byte. The matrix is stored row by row. Each row starts
|
||||
at a word boundary.
|
||||
.sp
|
||||
Some old MIT KST files, and all CMU's KST
|
||||
files do not use the RASTER WIDTH variable. (All characters have
|
||||
RASTER WIDTH=CHARACTER WIDTH.) The third word of those files has 0 in the
|
||||
left half.
|
||||
Programs which directly examine KST files for RASTER WIDTH should therefore,
|
||||
if RASTER WIDTH=0, use CHARACTER WIDTH instead.
|
||||
(Note that this also means that while MITAI can use CMU's KST files,
|
||||
CMU cannot use MITAI KST files.)
|
||||
Since when RASTER WIDTH=0, MITAI programs substitute CHARACTER WIDTH,
|
||||
you should not write a program which will set RASTER WIDTH to zero.
|
||||
When FED finds a character with zero RASTER WIDTH, FED will write
|
||||
the character with RASTER WIDTH=1. This does not waste any space in
|
||||
the XGP's PDP11, since the PDP11 does a vertical compaction of rasters,
|
||||
eliminating top and bottom blank lines.
|
||||
.he2
|
||||
Odds and End
|
||||
.pa
|
||||
.sect
|
||||
Odds and End
|
||||
.sp
|
||||
The KST, FNT, XH, and FED internal formats are
|
||||
listed in the extravagantly commented FED source file (stored on the SYSENG directory).
|
||||
FED also has extensive comments on programming the PDP10 to PDP11
|
||||
interface. FED was written by Pitts Jarvis, with additions
|
||||
by Joe Cohen.
|
||||
Brian Harvey is responsible for SAIL font hackery, whose specifications
|
||||
and fonts we copied.
|
||||
.sp
|
||||
Fonts are stored on the FONTS; directory, and are described in
|
||||
Working Paper #72, XGP Font Catalog, by Tom Knight.
|
||||
.sp
|
||||
The source file for this memo is 1WP;FED 78Wn0, where n is the revision number.
|
||||
.sp
|
||||
.ce
|
||||
THE END
|
||||
|
||||
Reference in New Issue
Block a user