|
|
BSD 4.3tahoe
FED(1) UNIX Programmer's Manual FED(1)
NAME
fed - font editor
SYNOPSIS
fed [ -i ] [ -q ] name
DESCRIPTION
_F_e_d is an editor for font files. It is display oriented and
must be used on an HP 2648 graphics terminal. Fed does the
necessary handshaking to work at 9600 baud on the 2648.
The -i flag requests _i_n_v_e_r_s_e _v_i_d_e_o _m_o_d_e, where all dots are
dark and the background is bright. This provides a setting
similar to the hardcopy output of the plotter, and is useful
for fonts such as the shadow font where shading is impor-
tant.
The -q flag requests _q_u_i_e_t _m_o_d_e, where all graphic output is
suppressed. This mode is useful on terminals other than the
HP 2648 (assuming you are editing blindly) and for opera-
tions such as the # and A commands, since these operations
do not make essential use of graphics, and since suppression
of the graphic output speeds of _f_e_d considerably.
FONTS
A font is a collection of up to 256 _g_l_y_p_h_s, each of which is
some pattern or design. Glyphs are represented on Unix as a
rectangular array of dots, each of which is either dark or
blank. Each location in the array is called a _p_i_x_e_l. There
are 200 pixels per inch due to the hardware of the Versatec
and Varian plotters.
Each glyph has, in addition to its bit pattern, a _b_a_s_e and a
_w_i_d_t_h. The base is a point, typically near the lower left
of the array, that represents the logical lower left point
of the glyph. The base is not restricted to be within the
array, in fact, it is usually a few locations to the left of
the edge. The vertical position of the base defines the
_b_a_s_e_l_i_n_e, which is held constant for all glyphs when a line
is typeset. Letters with descenders, such as ``g'', go
below the baseline. Other glyphs typically rest on the
baseline.
The width is used by _t_r_o_f_f(_1) to determine where to place
the next glyph. It need not be the same as the width of the
array, although it is usually about the same.
The size of the array, location of the base, and the width
can vary among glyphs in a font. Fonts where all glyphs
have the same width are called _f_i_x_e_d _w_i_d_t_h _f_o_n_t_s, others are
_v_a_r_i_a_b_l_e _w_i_d_t_h _f_o_n_t_s.
Printed 7/26/87 4/29/85 1
FED(1) UNIX Programmer's Manual FED(1)
Attributes which do not vary among glyphs include the _f_o_n_t
_n_a_m_e, which can be up to 11 alphabetic characters, and the
_p_o_i_n_t _s_i_z_e, which is a positive integer indicating the
overall size of the font. A point is 1/72 inch. The point
size of a font is the distance, in points, from the top of
the tallest glyph to the bottom of the lowest. The software
of troff currently restricts point sizes to 6, 7, 8, 9, 10,
11, 12, 14, 16, 18, 20, 22, 24, 28, and 36 point. Normal
text is usually 10 point.
Font files conventionally have names of the form
name.pointsize
for example, ``bocklin.14'' to indicate 14 point bocklin.
Fed will look for such a file in both the current directory
and /usr/lib/vfont. Vtroff will only look in
/usr/lib/vfont.
There is a correspondence between _g_l_y_p_h_s and _c_h_a_r_a_c_t_e_r_s in a
font. For a given font, each glyph has an ASCII character
associated with it. The glyph is obtained in troff by typ-
ing the associated character, and in fed glyphs are also
referred to by their character. However, it is not required
for all characters to have a glyph, fonts never have more
than 128 glyphs and usually have fewer.
There is usually a natural correspondence between glyphs and
characters. For example, the glyph which is a roman lower
case `a' will generally have the ascii character `a' as its
corresponding character. In the special font, the Greek
lower case alpha has `a' as it's corresponding character,
upper case delta has 'D' as it's corresponding character,
etc. However, special fonts such as the chess font have
glyphs that do not appear to be related to their correspond-
ing characters.
It is easy to confuse glyphs and characters. Note, however,
that the three glyphs roman a, bold a, and italic _a, are all
different, yet all three correspond to the character `a'.
When this is multiplied by the large number of font styles
and point sizes, there are many glyphs that match a single
character, (but only one in a particular font).
FED ORGANIZATION
Fed organizes the screen into 21 _w_i_n_d_o_w_s in a 3 by 7 array.
Each window is 100 by 100 pixels, meaning that the maximum
height and width of a glyph is 100 pixels. Since the HP
2648 has a resolution of 100 dots per inch, glyphs displayed
on the screen and printer will be double the actual height
and width, even when fully zoomed out. There is a _c_u_r_r_e_n_t
_w_i_n_d_o_w, which will be marked with a square border. There
are two _p_e_n_s, called _f_i_n_e and _b_o_l_d. The fine pen is one
pixel wide, the bold pen can range from two pixels to ten
Printed 7/26/87 4/29/85 2
FED(1) UNIX Programmer's Manual FED(1)
pixels in diameter. The default width of the bold pen is
taken from the point size implied by the file name. The
point size is not otherwise used. There are also fine and
bold _e_r_a_s_e_r_s.
There are two locations in the window, called the _c_u_r_s_o_r and
the _m_a_r_k. These tools are used to draw on glyphs.
Sometimes the cursor is on, in which case it is indicated by
the hardware graphics cursor of the terminal, a cross. The
cursor is considered to be located at the center of the
cross. Sometimes the _r_u_b_b_e_r _b_a_n_d _l_i_n_e is turned on, showing
the path a line drawn would traverse. This line runs from
the mark to the cursor, and is the only way the mark is
graphically visible.
COMMANDS
Commands to fed are single characters, sometimes followed by
any needed arguments. The commands used by fed were chosen
to be as similar to _v_i(1) commands as was reasonable.
Another distinction is that certain commands are in upper
case. These commands were deliberately made hard to type
because they cause a large change in the state of the editor
and should not be done by accident. In a few cases there
are both upper and lower case commands with the same letter.
_A_l_p_h_a_n_u_m_e_r_i_c _K_e_y_p_a_d: Note that this is the keypad on the far
right. The graphics keypad on the near right will not work.
These keys are each synonyms for other commands. They are
arranged in a manner that causes the five arrow keys to
behave sensibly, but the others need to be memorized or
stickers placed on the keys. They are provided for conveni-
ence only, and the user can avoid memorization simply by
using the mnemonic letter keys instead.
The layout is as follows:
undo (u) rezoom ( )fillin (f)
move (m) up (k) draw (d)
left (h) base (b) right (l)
setdot (.) down (j)cleardot (>)
The arrow keys move the cursor one pixel in the indicated
direction. The cursor is turned on if it was off. Note
that the alphanumeric keys (far right) must be used. The
graphics keys (near right) will appear to move the cursor
but it will not be moved internally. The cursor cannot be
moved outside the current window.
^_L: Redraw the screen. This is useful if an I/O error or
background process has caused the screen to get messed up.
Printed 7/26/87 4/29/85 3
FED(1) UNIX Programmer's Manual FED(1)
_b: Move the cursor to the base of the window. This is the
default location of the cursor.
_c: If the cursor is on, turn it off. Otherwise, turn it on.
_d: Draw a line from the mark to the cursor. The currently
selected tool (fine pen, bold pen, fine eraser, bold eraser)
is used. The cursor is turned off. The mark is moved to
the location of the cursor.
_f: Fill in the current hole. The cursor must be in a com-
pletely enclosed empty (white) area. The area is set to
black. If this command is invoked on the outside or there
are any leaks to the outside, the entire outside will be
filled in. (Undo is useful in this case.) Filling in cannot
jump diagonals, but can rather only spread in the four
orthogonal directions.
_g <_x>: Get a glyph. X can be any character. The glyph
corresponding to x is put in a window, and this window is
made the current window. The glyph is centered horizontally
in the window. The baseline is located at row 70 from the
top of the window. The pen and cursor are placed at the
base, and the cursor is turned off. The glyph must exist.
_h, _j, _k, and _l are accepted to mean left, down, up, and
right, respectively. They are synonymous with the
alphanumeric arrow keys. They have the same meanings as in
_v_i(_1).
_m: Move the mark to the current location of the cursor. The
cursor is turned on.
_n <_x>: New glyph. This is similar to _g, except that the
glyph must _n_o_t exist. It is used to create a new glyph. A
blank window is created, centered at (50, 70) as in g.
_p: Print the contents of the screen. An HP 2631 printer
must be connected to the terminal. The screen is copied to
the printer. If in inverse video mode, the screen is
changed to normal video mode before the print, and then
changed back after the print.
_r: If the rubber band line is on, turn it off. Otherwise,
turn it on.
_s <_w_h_a_t> [<_w_h_e_r_e>]: Set <what> to <where>. What and where
are single characters. The possibilities are:
_s_p_f: Set pen fine. (`l' for light is also accepted.)
Printed 7/26/87 4/29/85 4
FED(1) UNIX Programmer's Manual FED(1)
_s_p_b: set pen bold. (`h' for heavy is also accepted.)
_s_d: Set draw. The pen is used instead of the eraser.
_s_e: Set erase. The eraser is used instead of the pen.
_s_s<_n>: Set size of bold pen. <n> is a digit from 1 to
9. The size of the bold pen is set accordingly. This
also affects the bold eraser.
_u: Undo. The previous change to the current window is
undone. Note that undo is on a window by window basis, so
that commands that affect characters or more than one window
cannot be undone.
_z <_n>: Zoom to level n. The screen is blown up by a factor
of n. This only affects the appearance of the screen to
make it easy to see the individual dots, and does not affect
the size of the glyph or the result of a print command.
Zooming to 1 shows the entire screen, a level of 3 or 4 is
probably good for editing glyphs. When a message is printed
on the screen, fed automatically zooms out to level 1 so you
can read the message. Hitting space will zoom back. z fol-
lowed by <return> zooms out without changing the previous
zoom.
_s_p_a_c_e: Zoom back to the level most recently requested by the
z command.
_A <_i/_e/_r> <_f_i_r_s_t> <_l_a_s_t> [<_o_l_d_p_s> <_n_e_w_p_s>]:
Artificially italicize/embolden/resize a range of glyphs in
the current font. Enter i for italicize, e for embolden, or
r for resize, and the first and last character in the range
desired. If you are resizing you will also have to enter
the old and new point size, each terminated by a return.
Each glyph is gotten and changed on the screen visibly.
Glyphs are italicized by slanting them to the right at a
slope of 1/5. They are emboldened by smearing them to the
right a number if pixels equal to the current heavy pen
size. They are resized with an algorithm which translates
all on bits to the new position. These operations will be
considerably faster if the -q option is in effect, since
much overhead is involved in the graphic display.
_B: Move the base to the cursor. The cursor is turned on.
_C <_f_r_o_m> <_t_o>: Copy the glyph in character <from> to charac-
ter <to>. If <from> has a window on the screen, that window
is given to <to>.
_D <_f_r_o_m> <_t_h_r_o_u_g_h>: Delete a range of characters in the
font, from <from> through <through> inclusive. To delete a
Printed 7/26/87 4/29/85 5
FED(1) UNIX Programmer's Manual FED(1)
single character type it twice.
_E <_f_i_l_e>: Edit the named file. If changes have been made to
the current file, confirmation will be requested. (Either
'y' or 'E' is accepted.) The file name is terminated with
return.
_F <_f_i_r_s_t> <_l_a_s_t>: Show the font on the screen. The charac-
ters in the specified range are shown. The width values are
used to get natural spacing. The display will remain until
another command is typed, at which time the previous display
will be redrawn and the new command will be executed. As a
special case, a ``p'' command will print the results of the
``F'' command instead of the previous display.
_I <_h/_v>: Invert the current glyph about a horizontal or
vertical axis, as indicated by _h or _v. The axis runs up the
center of the window. The base can be subsequently posi-
tioned with the _B command.
_K: Kill the current glyph. All dots are set to blank. The
glyph is not removed from the font. This is used for
redrawing a glyph from scratch or replacing it with another
glyph.
_M <_f_r_o_m> <_t_o>: Move a glyph from <from> to <to>. This is
just like the copy command but the original is deleted.
_N <_f_i_l_e>: Write out the current file, if necessary, and edit
the new file specified. The file name is terminated with
return.
_P <_f_i_r_s_t> <_l_a_s_t> <_f_i_l_e>: Partial read from a file. A file
and the first and last characters in the range are prompted
for. Characters not in the range are left unmodified, char-
acters in the range are handled as in the R command.
_Q: Quit the editor, without saving any work. If changes
have been made confirmation will be required (either `Q' or
'y' is taken as `yes'.)
_R <_f_i_l_e>: Read in the named file on top of the current file.
Glyphs are merged wherever possible. If there is a con-
flict, you will be asked whether fed should take the glyph
from the file (f) or buffer (b). Responding with F or B
will lock in that mode for the remainder of the read. The
file name is terminated with a return.
_T <_t_e_x_t>:
Typeset the line of text on the terminal. This is similar
to the F command except that the given text is arranged on
Printed 7/26/87 4/29/85 6
FED(1) UNIX Programmer's Manual FED(1)
the screen, so you can see how some particular combination
of characters would look.
_V: Toggle whether editing is being done in inverse video
mode.
_W <_f_i_l_e>: Write the buffer out onto the named file, which is
terminated by return. A null file name means the current
file name.
_Z_Z: Exit fed. A write is done, if necessary, followed by a
quit. This is the normal way to leave fed. The Z must be
doubled for compatibility with _v_i.
.: Turn on the dot under the cursor. The cursor is turned
off.
>: Turn off the dot under the cursor. The cursor is turned
off.
# <_c_h_a_r> <_f_i_e_l_d> <_v_a_l_u_e>: Edit a numerical field. This only
makes sense if the glyph has not been gotten (_g or _n) yet,
since otherwise the values are taken from window specific
things such as the base. Fed does not do any sanity check-
ing, but just substitutes the value input. Fields are the
first letter of any field from the dispatch structure (see
vfont(5)), specifically, these fields are _a_d_d_r, _n_b_y_t_e_s,
_l_e_f_t, _r_i_g_h_t, _u_p, _d_o_w_n, and _w_i_d_t_h. The number, which may be
signed, is terminated by a newline.
FILES
/usr/lib/vfont/*.*
SEE ALSO
vfont(5), vfontinfo(1), vtroff(1), vwidth(1)
AUTHOR
Mark Horton
BUGS
Attempting to use the second 128 characters would be folly.
Fed has never been tested on such fonts, and at a bare
minimum there would be problems trying to input 8 bit char-
acters.
The character DEL is interpreted by the tty driver to mean
interrupt. Hence the corresponding glyph cannot be
accessed. The _s_t_a_r_t, _s_t_o_p, and _q_u_i_t characters are turned
off, but other characters used by the new tty driver must be
quoted with ^V.
Printed 7/26/87 4/29/85 7
FED(1) UNIX Programmer's Manual FED(1)
Changed widths are not copied to the width table used by
troff. This only matters if logical widths are changed, or
if glyphs are moved around. For these cases, _v_w_i_d_t_h(_1) must
be used.
The artificial operations don't do a very good job. The
quality possible from blowing a font up is in general poor.
Italicizing tends to make edges that were previously slanted
very ragged. However, these operations are better than
nothing at all and are a reasonable first approximation for
hand fixing.
The HP 2648 Terminal on which this runs has been stolen.
Printed 7/26/87 4/29/85 8
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.