BSD 4_1c_2 release
[unix-history] / usr / man / man1 / fed.1
CommitLineData
4cb4277e
C
1.TH FED 1 9/21/80
2.UC 4
3.SH NAME
4fed \- font editor
5.SH SYNOPSIS
6.B fed
7[
8.B \-i
9]
10[
11.B \-q
12]
13name
14.SH DESCRIPTION
15.I Fed
16is an editor for font files.
17It is display oriented and must be used on an HP 2648 graphics terminal.
18Fed does the necessary handshaking to work at 9600 baud on the 2648.
19.PP
20The
21.B \-i
22flag requests
23.IR "inverse video mode" ,
24where all dots are dark and the background is bright.
25This provides a setting similar to the hardcopy output of
26the plotter, and is useful for fonts such as the shadow
27font where shading is important.
28.PP
29The
30.B \-q
31flag requests
32.IR "quiet mode" ,
33where all graphic output is suppressed.
34This mode is useful on terminals other than the HP 2648
35(assuming you are editing blindly) and for operations
36such as the # and A commands, since
37these operations do not make essential use of graphics,
38and since suppression
39of the graphic output speeds of
40.I fed
41considerably.
42.SH FONTS
43.PP
44A font is a collection of up to 256
45.IR glyphs ,
46each of which is some pattern or design.
47Glyphs are represented on Unix as a rectangular array
48of dots, each of which is either dark or blank.
49Each location in the array is called a
50.IR pixel .
51There are 200 pixels per inch due to the hardware of the
52Versatec and Varian plotters.
53.PP
54Each glyph has, in addition to its bit pattern, a
55.I base
56and a
57.IR width .
58The base is a point, typically near the lower left of the array,
59that represents the logical lower left point of the glyph.
60The base is not restricted to be within the array, in fact, it is usually
61a few locations to the left of the edge.
62The vertical position of the base defines the
63.IR baseline ,
64which is held constant for all glyphs when a line is typeset.
65Letters with descenders, such as ``g'', go below the baseline.
66Other glyphs typically rest on the baseline.
67.PP
68The width is used by
69.I troff(1)
70to determine where to place the next glyph.
71It need not be the same as the width of the array, although it is usually
72about the same.
73.PP
74The size of the array, location of the base, and the width can vary among
75glyphs in a font.
76Fonts where all glyphs have the same width are called
77.IR "fixed width fonts" ,
78others are
79.IR "variable width fonts" .
80.PP
81Attributes which do not vary among glyphs include the
82.IR "font name" ,
83which can be up to 11 alphabetic characters, and the
84.IR "point size" ,
85which is a positive integer indicating the overall size of the font.
86A point is 1/72 inch.
87The point size of a font is the distance, in points, from the top of
88the tallest glyph to the bottom of the lowest.
89The software of troff currently restricts point sizes to
906, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, and 36 point.
91Normal text is usually 10 point.
92.PP
93Font files conventionally have names of the form
94.br
95 name.pointsize
96.br
97for example, ``bocklin.14'' to indicate 14 point bocklin.
98Fed will look for such a file in both the current directory
99and /usr/lib/vfont.
100Vtroff will only look in /usr/lib/vfont.
101.PP
102There is a correspondence between
103.I glyphs
104and
105.I characters
106in a font.
107For a given font, each glyph has an ASCII character associated with it.
108The glyph is obtained in troff by typing the assocated character,
109and in fed glyphs are also referred to by their character.
110However, it is not required for all characters to have a glyph,
111fonts never have more than 128 glyphs and usually have fewer.
112.PP
113There is usually a natural correspondence between glyphs and characters.
114For example, the glyph which is a roman lower case `a' will generally
115have the ascii character `a' as its corresponding character.
116In the special font, the Greek lower case alpha has `a' as it's corresponding
117character, upper case delta has 'D' as it's corresponding character, etc.
118However, special fonts such as the chess font have glyphs that do not
119appear to be related to their corresponding characters.
120.PP
121It is easy to confuse glyphs and characters.
122Note, however, that the three glyphs
123roman a, bold
124.BR a ,
125and italic
126.IR a ,
127are all different, yet all three correspond to the character `a'.
128When this is multiplied by the large number of font styles and point
129sizes, there are many glyphs that match a single character,
130(but only one in a particular font).
131.SH "FED ORGANIZATION"
132.PP
133Fed organizes the screen into 21
134.I windows
135in a 3 by 7 array.
136Each window is 100 by 100 pixels,
137meaning that the maximum height and width of a glyph is 100 pixels.
138Since the HP 2648 has a resolution of 100 dots per inch, glyphs
139displayed on the screen and printer will be double the actual
140height and width, even when fully zoomed out.
141There is a
142.IR "current window" ,
143which will be marked with a square border.
144There are two
145.IR pens ,
146called
147.I fine
148and
149.IR bold .
150The fine pen is one pixel wide,
151the bold pen can range from two pixels to ten pixels in diameter.
152The default width of the bold pen is taken from the point size
153implied by the file name.
154The point size is not otherwise used.
155There are also fine and bold
156.IR erasers .
157.PP
158There are two locations in the window, called the
159.I cursor
160and the
161.IR mark .
162These tools are used to draw on glyphs.
163.PP
164Sometimes the cursor is on, in which case it is indicated by the
165hardware graphics cursor of the terminal, a cross. The cursor is
166considered to be located at the center of the cross.
167Sometimes the
168.I "rubber band line"
169is turned on, showing the path a line drawn would traverse.
170This line runs from the mark to the cursor, and is the only
171way the mark is graphically visible.
172.SH COMMANDS
173Commands to fed are single characters, sometimes followed by any
174needed arguments.
175The commands used by fed were chosen to be as similar to
176.IR vi (1)
177commands as was reasonable.
178Another distinction is that certain commands are in upper case.
179These commands were deliberately made hard to type because they
180cause a large change in the state of the editor and should not
181be done by accident.
182In a few cases there are both upper and lower case commands with
183the same letter.
184.PP
185.IR "Alphanumeric Keypad" :
186Note that this is the keypad on the far right.
187The graphics keypad on the near right will not work.
188These keys are each synonyms for other commands.
189They are arranged in a manner that causes the five
190arrow keys to behave sensibly,
191but the others need to be memorized or stickers
192placed on the keys.
193They are provided for convenience only,
194and the user can avoid memorization simply
195by using the mnemonic letter keys instead.
196.PP
197The layout is as follows:
198.ta 1i 2i 3i
199.nf
200 undo (u) rezoom ( ) fillin (f)
201 move (m) up (k) draw (d)
202 left (h) base (b) right (l)
203 setdot (.) down (j) cleardot (>)
204.fi
205.DT
206.PP
207The arrow keys move the cursor one pixel in the indicated direction.
208The cursor is turned on if it was off.
209Note that the alphanumeric keys (far right) must be used.
210The graphics keys (near right) will appear to move the cursor but
211it will not be moved internally.
212The cursor cannot be moved outside the current window.
213.PP
214.IR "^L" :
215Redraw the screen. This is useful if an I/O error or background
216process has caused the screen to get messed up.
217.PP
218.IR b :
219Move the cursor to the base of the window.
220This is the default location of the cursor.
221.PP
222.IR c :
223If the cursor is on, turn it off.
224Otherwise, turn it on.
225.PP
226.IR d :
227Draw a line from the mark to the cursor.
228The currently selected tool (fine pen, bold pen, fine eraser, bold eraser)
229is used.
230The cursor is turned off.
231The mark is moved to the location of the cursor.
232.PP
233.IR f :
234Fill in the current hole.
235The cursor must be in a completely enclosed empty (white) area.
236The area is set to black.
237If this command is invoked on the outside or there are any leaks
238to the outside, the entire outside will be filled in.
239(Undo is useful in this case.)
240Filling in cannot jump diagonals,
241but can rather only spread in the four orthogonal directions.
242.PP
243.IR "g <x>" :
244Get a glyph.
245X can be any character.
246The glyph corresponding to x is put in a window, and this
247window is made the current window.
248The glyph is centered horizontally in the window.
249The baseline is located at row 70 from the top of the window.
250The pen and cursor are placed at the base,
251and the cursor is turned off.
252The glyph must exist.
253.PP
254.IR h ,
255.IR j ,
256.IR k ,
257and
258.I l
259are accepted to mean
260left, down, up, and right, respectively.
261They are synonomous with the alphanumeric arrow keys.
262They have the same meanings as in
263.IR vi(1) .
264.PP
265.IR "m" :
266Move the mark to the current location of the cursor.
267The cursor is turned on.
268.PP
269.IR "n <x>" :
270New glyph.
271This is similar to
272.IR g ,
273except that the glyph must
274.I not
275exist.
276It is used to create a new glyph.
277A blank window is created, centered at (50, 70) as in g.
278.PP
279.IR p :
280Print the contents of the screen.
281An HP 2631 printer must be connected to the terminal.
282The screen is copied to the printer.
283If in inverse video mode,
284the screen is changed to normal video mode before the print,
285and then changed back after the print.
286.PP
287.IR r :
288If the rubber band line is on, turn it off.
289Otherwise, turn it on.
290.PP
291.IR "s <what> [<where>]" :
292Set <what> to <where>.
293What and where are single characters.
294The possibilities are:
295.RS
296.PP
297.IR spf :
298Set pen fine.
299(`l' for light is also accepted.)
300.PP
301.IR spb :
302set pen bold.
303(`h' for heavy is also accepted.)
304.PP
305.IR sd :
306Set draw.
307The pen is used instead of the eraser.
308.PP
309.IR se :
310Set erase.
311The eraser is used instead of the pen.
312.PP
313.IR ss<n> :
314Set size of bold pen.
315<n> is a digit from 1 to 9.
316The size of the bold pen is set accordingly.
317This also affects the bold eraser.
318.RE
319.PP
320.IR u :
321Undo. The previous change to the current window is undone.
322Note that undo is on a window by window basis, so that
323commands that affect characters or more than one window cannot be undone.
324.PP
325.IR "z <n>" :
326Zoom to level n.
327The screen is blown up by a factor of n.
328This only affects the appearance of the screen
329to make it easy to see the individual dots,
330and does not affect the size of the glyph or
331the result of a print command.
332Zooming to 1 shows the entire screen, a level of 3 or 4
333is probably good for editing glyphs.
334When a message is printed on the screen, fed automatically
335zooms out to level 1 so you can read the message.
336Hitting space will zoom back.
337z followed by <return> zooms out without changing the previous zoom.
338.PP
339.IR space :
340Zoom back to the level most recently requested by the z command.
341.PP
342.IR "A <i/e/r> <first> <last> [<oldps> <newps>]" :
343.br
344Artificially italicize/embolden/resize a range of glyphs in the current font.
345Enter i for italicize, e for embolden, or r for resize,
346and the first and last character in the range desired.
347If you are resizing you will also have to enter the old and new point
348size, each terminated by a return.
349Each glyph is gotten and changed on the screen visibly.
350Glyphs are italicized by slanting them to the right at a slope of 1/5.
351They are emboldened by smearing them to the right a number if pixels
352equal to the current heavy pen size.
353They are resized with an algorithm which translates all on bits
354to the new position.
355These operations will be considerably faster if the
356.B \-q
357option is in effect,
358since much overhead is involved in the graphic display.
359.PP
360.IR B :
361Move the base to the cursor.
362The cursor is turned on.
363.PP
364.IR "C <from> <to>" :
365Copy the glyph in character <from> to character <to>.
366If <from> has a window on the screen, that window is
367given to <to>.
368.PP
369.IR "D <from> <through>" :
370Delete a range of characters in the font, from <from> through <through>
371inclusive. To delete a single character type it twice.
372.PP
373.IR "E <file>" :
374Edit the named file.
375If changes have been made to the current file,
376confirmation will be requested.
377(Either 'y' or 'E' is accepted.)
378The file name is terminated with return.
379.PP
380.IR "F <first> <last>" :
381Show the font on the screen.
382The characters in the specified range are shown.
383The width values are used to get natural spacing.
384The display will remain until another command is typed,
385at which time the previous display will be redrawn and
386the new command will be executed.
387As a special case, a ``p'' command will print the results
388of the ``F'' command instead of the previous display.
389.PP
390.IR "I <h/v>" :
391Invert the current glyph about a horizontal or vertical axis,
392as indicated by
393.I h
394or
395.IR v .
396The axis runs up the center of the window.
397The base can be subseqently positioned with the
398.I B
399command.
400.PP
401.IR K :
402Kill the current glyph.
403All dots are set to blank.
404The glyph is not removed from the font.
405This is used for redrawing a glyph from scratch or
406replacing it with another glyph.
407.PP
408.IR "M <from> <to>" :
409Move a glyph from <from> to <to>.
410This is just like the copy command but the original is deleted.
411.PP
412.IR "N <file>" :
413Write out the current file, if necessary, and edit the new file specified.
414The file name is terminated with return.
415.PP
416.IR "P <first> <last> <file>" :
417Partial read from a file.
418A file and the first and last characters in the range are prompted for.
419Characters not in the range are left unmodified,
420characters in the range are handled as in the R command.
421.PP
422.IR Q :
423Quit the editor, without saving any work.
424If changes have been made confirmation will be required
425(either `Q' or 'y' is taken as `yes'.)
426.PP
427.IR "R <file>" :
428Read in the named file on top of the current file.
429Glyphs are merged wherever possible.
430If there is a conflict, you will be asked whether fed should
431take the glyph from the file (f) or buffer (b).
432Responding with F or B will lock in that mode for the remainder of the read.
433The file name is terminated with a return.
434.PP
435.IR "T <text>" :
436.PP
437Typeset the line of text on the terminal.
438This is similar to the F command except that
439the given text is arranged on the screen, so
440you can see how some particular combination of characters would look.
441.PP
442.IR V :
443Toggle whether editing is being done in inverse video mode.
444.PP
445.IR "W <file>" :
446Write the buffer out onto the named file,
447which is terminated by return.
448A null file name means the current file name.
449.PP
450.IR "ZZ" :
451Exit fed.
452A write is done, if necessary,
453followed by a quit.
454This is the normal way to leave fed.
455The Z must be doubled for compatibility with
456.IR vi .
457.PP
458.IR "." :
459Turn on the dot under the cursor.
460The cursor is turned off.
461.PP
462.IR ">" :
463Turn off the dot under the cursor.
464The cursor is turned off.
465.PP
466.IR "# <char> <field> <value>" :
467Edit a numerical field.
468This only makes sense if the glyph has not been gotten
469.RI ( g
470or
471.IR n )
472yet,
473since otherwise the values are taken from window specific things
474such as the base.
475Fed does not do any sanity checking, but just substitutes the value input.
476Fields are the first letter of any field from the dispatch structure
477(see vfont(5)), specifically, these fields are
478.IR addr ,
479.IR nbytes ,
480.IR left ,
481.IR right ,
482.IR up ,
483.IR down ,
484and
485.IR width .
486The number, which may be signed, is terminated by a newline.
487.SH FILES
488/usr/lib/vfont/*.*
489.SH SEE ALSO
490vfont(5), vfontinfo(1), vtroff(1), vwidth(1), rotate(1)
491.SH AUTHOR
492Mark Horton
493.SH BUGS
494Attempting to use the second 128 characters would be folly.
495Fed has never been tested on such fonts, and at a bare minimum
496there would be problems trying to input 8 bit characters.
497.PP
498The character DEL is interpreted by the tty driver to mean interrupt.
499Hence the corresponding glyph cannot be accessed.
500The
501.IR start ,
502.IR stop ,
503and
504.I quit
505characters are turned off, but other characters used by the
506new tty driver must be quoted with ^V.
507.PP
508Changed widths are not copied to the width table used by troff.
509This only matters if logical widths are changed, or if
510glyphs are moved around.
511For these cases,
512.I vwidth(1)
513must be used.
514.PP
515The artificial operations don't do a very good job.
516The quality possible from blowing a font up is in general poor.
517Italicizing tends to make edges that were previously slanted very ragged.
518However, these operations are better than nothing at all and are
519a reasonable first approximation for hand fixing.
520.PP
521The HP 2648 Terminal on which this runs has been stolen.