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