FontEditDoc.tioga
Michael Plass, December 8, 1986 1:24:58 pm PST
FontEdit
CEDAR 6.0 — FOR INTERNAL XEROX USE ONLY
FontEdit
Michael Plass
© Copyright 1985, 1986 Xerox Corporation. All rights reserved.
Abstract: Provides tools and commands for editing raster fonts, and other forms of bitmaps, and for manipulationg font dictionaries.
Created by: Michael Plass
Maintained by: Michael Plass <Plass.pa>
Keywords: Font, Bitmap, Edit, Widths, Metrics, Bold, Italic, Stipple, SampledBlack, ac, sd, ks, cd
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
File types treated by this package:
.ac - Aligned Characters
A raster font with rasters that have each scanline starting on a new 16-bit boundary.
.cd - Character Dictionary
A collection of fonts in .ac, .oc, or .sd format.
.oc - Orbitized Characters
A raster font with tightly-packed rasters (suitable for Dover printers).
.sd - Spline Description
A cubic-spline description of a font.
.sf - Text Spline Description
A text-form cubic-spline description of a font.
.strike - Strike Font
A raster font suitable for use on CRT displays.
.ks - Kerned Strike Font
A raster font suitable for use on CRT displays, that allows characters to overlap.
Refer to the press font format memo on [Indigo]<PrintingDocs>FontFormats.press for details about these formats.
Executive commands:
FontDictAnalyze foo.cd (or foo.ac or foo.oc or foo.sd)
Writes foo.cdtxt, which contains an editable text description of the top-level contexts of the press-style font dictionary. The format of a .cdtxt file is a fairly literal lisp-list-like encoding of the top-level structure of the dictionary, with references into the original file for the actual font data. Refer to the press font format memo for details of how to interpret the contents.
In font dictionaries used on product Print Services printers, be warned that the resolutionY field has been ambushed to encode the character set information instead; in such files, the value of resolutionY is 10 time the character set number. Also, be warned that there are fonts in circulation on such printers that have bogus resolutionX values, and the Print Services code accordingly ignores this field.
Before editing the output file, it is a good idea to run ReadIndent over it to create tioga node structure from the indentation. If desired, use the interpreter to set the variable FontDictImpl.maxPerLine to a larger value (25 is good) to get more tokens per line of output.
FontDictAssemble foo.<format> [ ← bar.cdtxt ]
Parses the input file (default name has extension ".cdtxt") as produced by FontDictAnalyze and assembles a new font dictionary. Note that .ac, .oc, and .sd files are just dictionaries that happen to have only one member, so this command may be used for either merge or extract operations. There is some checking to make it hard to create completely bogus dictionaries, but this program assumes you know what you are doing and will most likely respond to erroneous input with an uncaught signal.
FontEdit foo.ks (or foo.strike or foo.ac)
will make a tool to edit the named file.
FontBold output ← input
synthesizes a bold font. (ks, strike, or ac)
FontSlant output ← input
synthesizes a slanted font. (ks, strike, or ac)
FontMerge <outputFile> ← <inputFile1> <CharSpec1>; <inputFile2> <CharSpec2>; . . .
will make a new font file by selecting characters from old ones.
<outputFile> is the output file name. The extension (.ac, .ks or .strike) is used to figure out what format to make the new file.
<inputFileN> is the name of an existing font file.
<CharSpecN> is the keyword CHARS (or CHAR), followed by a list of (Cedar-style) characters or subranges of characters; the keyword DEFAULT may be used to specify the default character.
Commas, spaces, or tabs may be used to separate items in the command line.
The semicolons are optional, unless needed to prevent a remote file name from looking like a subrange. The keyword FONT may be used in place of the semicolon (in command files, for example).
Example: FontMerge new.ks ← one.strike CHARS ['a..'z]; FONT two.strike CHARS ['0..'1], ['A..'Z], '\003 three.strike CHAR '?; four.ks CHAR DEFAULT;
FontWidthsCopy output ← input
copies the widths from the input to the output. (ks, strike, or ac)
SDtoSF output ← input
Converts an SD format file to an SF (spline text) format file.
MakeRasterFont output ← fontName size [rotation] [bitsPerInch]
Converts an Imager font to a raster font.
fontName is the full hierarchical name (i.e., Xerox/Pressfonts/Timesroman-MRR)
size is in pixels
rotation is in degrees
bitsPerInch is only used for AC fonts
output file format is derived from the output name
StippleEdit foo.ais
will make a tool to edit the named AIS file, which must be a bitmap.
The user interface is unsatisfactory for large bitmaps, i.e., bigger than about 800 square.
FontEdit Tool Description:
Menu Items:
Undo — Undo the edits to the current character.
GetLoad the file named in the current selection.
StoreStore the file named in the current selection.
The file format (ac, ks or strike) is deduced from the file name. Storing a strike font may cause the origins and/or widths of some characters to change in order to avoid kerning. Storing a ks or strike font sets the y components of the widths to zero, and rounds the x components to integers.
SaveStore the current file.
CharEdit the character named in the current selection.
Next/PrevLeft (right) click to move to the next (previous) character in collating sequence.
TextSets the sample text to either the current selection (left click), a default string, (middle click), or consecutive characters starting 2 before the current character (right click).
Current text display:
Shows some sample text in the font being edited. Left click here to select a new character to edit. Shift-Left click to copy a character to the current buffer.
Current character display:
Shows a big version of the character being edited. Edits are reflected in the text display.
Left button paints black.
Right button paints white.
Control-left moves the origin (reference point).
Control-right controls the width vector.
The width vector can only be changed to take on integral values. Non-integer widths will be preserved if left unedited.
StippleEdit Tool Description:
Menu Items:
Reset — Get the bits from the file again.
GetLoad the bits from the AIS file named by the selection.
StoreStore the bits into the AIS file named by the selection.
SaveSave the bits into the AIS file named by the caption.
BoundsSet the boundaries according to the crosshairs.
FillFill the rectangle selected by the crosshairs with black/invert/white, depending on the mouse button.
TileTile the rectangle selected by the crosshairs with the stipple from the AIS file named by the selection. The tile will be painted in replace/xor/or mode, depending on the mouse button.
RotateRotates the bitmap 90 degrees.
FlipFlips the bitmap horizontally.
Bitmap display:
Shows a big version of the bitmap being edited.
Left button paints black.
Right button paints white.
Control-left moves the origin crosshair (the bigger one).
Control-right controls the width vector (the smaller one).