.\" Copyright (c) 1983 Regents of the University of California. .\" All rights reserved. The Berkeley software License Agreement .\" specifies the terms and conditions for redistribution. .\" .\" @(#)fed.1 6.1 (Berkeley) 4/29/85 .\" .TH FED 1 "4/29/85" .UC 5 .SH NAME fed \- font editor .SH SYNOPSIS .B fed [ .B \-i ] [ .B \-q ] name .SH DESCRIPTION .I Fed 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. .PP The .B \-i flag requests .IR "inverse video mode" , 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 important. .PP The .B \-q flag requests .IR "quiet mode" , where all graphic output is suppressed. This mode is useful on terminals other than the HP 2648 (assuming you are editing blindly) and for operations 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 .I fed considerably. .SH FONTS .PP A font is a collection of up to 256 .IR glyphs , 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 .IR pixel . There are 200 pixels per inch due to the hardware of the Versatec and Varian plotters. .PP Each glyph has, in addition to its bit pattern, a .I base and a .IR width . 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 .IR baseline , 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. .PP The width is used by .I troff(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. .PP 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 .IR "fixed width fonts" , others are .IR "variable width fonts" . .PP Attributes which do not vary among glyphs include the .IR "font name" , which can be up to 11 alphabetic characters, and the .IR "point size" , 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. .PP Font files conventionally have names of the form .br name.pointsize .br 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. .PP There is a correspondence between .I glyphs and .I characters in a font. For a given font, each glyph has an ASCII character associated with it. The glyph is obtained in troff by typing 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. .PP 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 corresponding characters. .PP It is easy to confuse glyphs and characters. Note, however, that the three glyphs roman a, bold .BR a , and italic .IR 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). .SH "FED ORGANIZATION" .PP Fed organizes the screen into 21 .I windows 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 .IR "current window" , which will be marked with a square border. There are two .IR pens , called .I fine and .IR bold . The fine pen is one pixel wide, the bold pen can range from two pixels to ten 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 .IR erasers . .PP There are two locations in the window, called the .I cursor and the .IR mark . These tools are used to draw on glyphs. .PP 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 .I "rubber band line" 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. .SH 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 .IR vi (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. .PP .IR "Alphanumeric Keypad" : 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 convenience only, and the user can avoid memorization simply by using the mnemonic letter keys instead. .PP The layout is as follows: .ta 1i 2i 3i .nf undo (u) rezoom ( ) fillin (f) move (m) up (k) draw (d) left (h) base (b) right (l) setdot (.) down (j) cleardot (>) .fi .DT .PP 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. .PP .IR "^L" : Redraw the screen. This is useful if an I/O error or background process has caused the screen to get messed up. .PP .IR b : Move the cursor to the base of the window. This is the default location of the cursor. .PP .IR c : If the cursor is on, turn it off. Otherwise, turn it on. .PP .IR 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. .PP .IR f : Fill in the current hole. The cursor must be in a completely 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. .PP .IR "g " : 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. .PP .IR h , .IR j , .IR k , and .I 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 .IR vi(1) . .PP .IR "m" : Move the mark to the current location of the cursor. The cursor is turned on. .PP .IR "n " : New glyph. This is similar to .IR g , except that the glyph must .I not exist. It is used to create a new glyph. A blank window is created, centered at (50, 70) as in g. .PP .IR 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. .PP .IR r : If the rubber band line is on, turn it off. Otherwise, turn it on. .PP .IR "s []" : Set to . What and where are single characters. The possibilities are: .RS .PP .IR spf : Set pen fine. (`l' for light is also accepted.) .PP .IR spb : set pen bold. (`h' for heavy is also accepted.) .PP .IR sd : Set draw. The pen is used instead of the eraser. .PP .IR se : Set erase. The eraser is used instead of the pen. .PP .IR ss : Set size of bold pen. is a digit from 1 to 9. The size of the bold pen is set accordingly. This also affects the bold eraser. .RE .PP .IR 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. .PP .IR "z " : 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 followed by zooms out without changing the previous zoom. .PP .IR space : Zoom back to the level most recently requested by the z command. .PP .IR "A [ ]" : .br 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 .B \-q option is in effect, since much overhead is involved in the graphic display. .PP .IR B : Move the base to the cursor. The cursor is turned on. .PP .IR "C " : Copy the glyph in character to character . If has a window on the screen, that window is given to . .PP .IR "D " : Delete a range of characters in the font, from through inclusive. To delete a single character type it twice. .PP .IR "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. .PP .IR "F " : Show the font on the screen. The characters 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. .PP .IR "I " : Invert the current glyph about a horizontal or vertical axis, as indicated by .I h or .IR v . The axis runs up the center of the window. The base can be subsequently positioned with the .I B command. .PP .IR 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. .PP .IR "M " : Move a glyph from to . This is just like the copy command but the original is deleted. .PP .IR "N " : Write out the current file, if necessary, and edit the new file specified. The file name is terminated with return. .PP .IR "P " : 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, characters in the range are handled as in the R command. .PP .IR 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'.) .PP .IR "R " : Read in the named file on top of the current file. Glyphs are merged wherever possible. If there is a conflict, 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. .PP .IR "T " : .PP Typeset the line of text on the terminal. This is similar to the F command except that the given text is arranged on the screen, so you can see how some particular combination of characters would look. .PP .IR V : Toggle whether editing is being done in inverse video mode. .PP .IR "W " : Write the buffer out onto the named file, which is terminated by return. A null file name means the current file name. .PP .IR "ZZ" : 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 .IR vi . .PP .IR "." : Turn on the dot under the cursor. The cursor is turned off. .PP .IR ">" : Turn off the dot under the cursor. The cursor is turned off. .PP .IR "# " : Edit a numerical field. This only makes sense if the glyph has not been gotten .RI ( g or .IR n ) yet, since otherwise the values are taken from window specific things such as the base. Fed does not do any sanity checking, 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 .IR addr , .IR nbytes , .IR left , .IR right , .IR up , .IR down , and .IR width . The number, which may be signed, is terminated by a newline. .SH FILES /usr/lib/vfont/*.* .SH SEE ALSO vfont(5), vfontinfo(1), vtroff(1), vwidth(1) .SH AUTHOR Mark Horton .SH 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 characters. .PP The character DEL is interpreted by the tty driver to mean interrupt. Hence the corresponding glyph cannot be accessed. The .IR start , .IR stop , and .I quit characters are turned off, but other characters used by the new tty driver must be quoted with ^V. .PP 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, .I vwidth(1) must be used. .PP 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. .PP The HP 2648 Terminal on which this runs has been stolen.