XFIG(1) — UNIX Programmer’s Manual
NAME
xfig − Facility for Interactive Generation of figures under X11
SYNOPSIS
xfig [ -ri[ght] ] [ -le[ft] ] [ -L[andscape] ] [ -P[ortrait] ] [ -pw[idth] units ] [ -ph[eight] units ] [ -not[rack] ] [ -tr[ack] ] [ -inc[hes] ] [ -me[tric] ] [ -inv[erse] ] [ -de[bug] ] [ file ] [ -normal[Font] font ] [ -bold[Font] font ]
DESCRIPTION
Xfig is a menu-driven tool that allows the user to draw and manipulate objects interactively in an X window. It runs under X version 11 and requires a three-button mouse. File specifies the name of a file to be edited. The description of objects in the file will be read at the start of xfig.
The output from xfig can be printed in several ways:
Postscript - f2ps (xfig to postscript translator) is used to produce postscript from an xfig file. This can be sent directly to a postscript printer or a file.
Troff - f2p (xfig to pic(1) translator, also known by its previous name f2fp(1L)) is used to translate xfig files into pic(1) language. The resulting output may then be processed in the same manner as any other pic file. Note that area fill is not supported by f2p.
Note: The f2p and f2ps translators will be eventually phased out because the TransFig package from Micah Beck is a more general purpose translator for more graphics languages. The TransFig package can be used as a back-end processor to xfig to produce various types of output:
LaTeX -fig2dev -L latex translates xfig to LaTeX picture environment commands which can be processed along with other LaTeX commands.
Postscript -fig2dev -L ps produces a postscript output.
Pic -fig2dev -L pic produces a pic output.
PiCTeX -fig2dev -L pictex produces PiCTeX output. This contains macros that can be used with the PiCTeX environment under TeX or LaTeX.
Others -fig2dev has options for these other languages: box, epic, eepic, and eepicemu.
The TransFig package is available from svax.cs.cornell.edu (directory /pub/fig) and from sun.soe.clarkson.edu (directory /pub/transfig) via anonymous ftp. It is also available by mail from the Clarkson archive server. To find out about using the server, send the one-line message "help" to archive-server@sun.soe.clarkson.edu.
OPTIONS
−ri Change the position of the side panel window to the right of the canvas window (default: left).
−le Change the position of the side panel window to the left of the canvas window.
−L Make xfig come up in landscape mode (10" x 7.5"). This is the default.
−P Make xfig come up in portrait mode (7.5" x 10").
-pw units
Make xfig come up units wide (where units are either cm or in).
-ph units
Make xfig come up units high (where units are either cm or in).
-tr Turn on cursor (mouse) tracking arrows.
-no Turn off cursor (mouse) tracking arrows.
-inc Make inches the unit of choice (default).
-me Make centimeters the unit of choice.
-inv Use inverse video (white on black).
-de Turn on debugging mode.
-normal font
Cause the font used for questions to be font. This font is also used on the canvas when the selected font is not available in an X11 font.
-bold font
Cause the font used for displaying messages to be font.
GRAPHICAL OBJECTS
The objects in xfig are divided into primitive objects and compound object. The primitive objects are: ARC, CIRCLE, CLOSED SPLINE, ELLIPSE, POLYLINE, POLYGON, SPLINE, and TEXT. A primitive can be moved, rotated, flipped, copied or erased. The TEXT primitive cannot be rotated or flipped. A compound object is composed of primitive objects. The primitive objects that constitute a compound can not be individually modified, but they can be manipulated as an entity; a compound can be moved, rotated, flipped, copied or erased. An extra function that can be applied to a compound object is scaling, which is not available for primitive objects.
DISPLAY WINDOWS
Nine windows comprise the display area of xfig: the top ruler, the side ruler, two panel windows, the message window, three indicator windows showing current line thickness, area-fill gray color and rounded box corner radius, and the canvas window. The main panel window can be placed to the left or right of the the canvas window (default: left), and the second panel window is always below the message window. It contains buttons for quick access to some of the pop-up menu commands.
POP-UP MENU
The pop-up menu appears when the right mouse button is pressed with the cursor positioned within the canvas window. Positioning the cursor over the desired menu entry and releasing the button selects a menu entry.
There are a number of file accessing functions in the pop-up menu. Most of the time when one of these functions is selected, the user will be asked for a file name. If the specified file can be located and the access permission are granted, xfig will carry out the function. However in case things go wrong, xfig will abort the function and printed the causes on the message window. Most of the functions in the pop-up menu can be directly access with the lower button panel.
Undo Undo the last object creation or modification.
Redisplay
Redraw the canvas.
Remove all
Remove all objects on the canvas window (can be undone).
Edit file ...
The current contents of the canvas are cleared and the figure is read from the specified file. The user will be asked for a file name. This file will become the current file.
Save Save the current contents of the canvas in the current file. If no file is being edited, the user will be asked for a file name as in the "Save in ..." function.
Read file ...
Read figure from the specified file and merge it with the figure already shown on the canvas. (The user will be asked for a file name.)
Save in ...
Save the figure on the screen into a file specified by the user. (The user will be asked for a file name.) If there is no current file name, it will be set to the name specified in the save.
Status Show the name of the current file and directory.
Change Directory
Change the working directory. Any file name without a full path name will employ the current working directory.
Save & Quit
Save the figure in the current file and exit from xfig. If there is no current file, the user will be asked for a file name. No confirmation will be asked.
Save as Bitmap
Create an X11 bitmap from the figure the size of which is determined by the enclosing rectangle of all the figure plus a small border.
Quit Exit from xfig, discarding the figure. The user will be asked to confirm the action, by clicking the left button.
BOTTOM PANEL COMMAND FUNCTIONS
Most of the buttons in the bottom panel are counterparts to the pop-up menu functions. However, there are additional buttons for selecting font, font size, print orientation (landscape or portrait) and the printer device itself.
BOTTOM PANEL WINDOW COMMAND DESCRIPTIONS
FONT SELECT
This button pops up a menu of 35 fonts available for most Apple Postscript printers. The name of the font is printed in the font itself so that one may see what that font looks like. If a corresponding X11 font exists, new text is created on the canvas using that font. xfig uses the size of X11 font closest to that selected by the font size button. If the X11 font doesn’t exist, xfig uses the font selected by the "-normal" option. To abort selection of a font, click on the title of the menu.
FONT SIZE
The left button decreases the point size of font used on the canvas and printer. The right button increases the point size.
LANDSCAPE/PORTRAIT
Select landscape or portrait mode of printing. The default setting is that of the xfig canvas.
PRINTER SELECT
Toggle through a list of printers available for printing the figure. At present this list must be compiled into xfig.
TEXT JUSTIFICATION
Clicking this button cycles through selection of left, center and right justification of text.
SIDE PANEL WINDOW MANIPULATION FUNCTIONS
Icons in the side panel window represent object manipulation functions, modes and other drawing or modification aids. Manipulation functions are selected by positioning the cursor over it and clicking the left mouse button. The selected icon is highlighted, and a message describing its function appears in the message window.
The left and middle buttons are used to create and modify objects in the canvas window. Most actions start with clicking of the left button and end with clicking of the middle button. There is no need to hold down a button while positioning the cursor.
SIDE PANEL WINDOW COMMAND DESCRIPTIONS
Entries in the side panel window can be classified into two categories: object creation/modification/removal commands (only one of which may be active at any one time), and drawing aids (which act as toggle switches or settings). There are two ways for drawing circles, two for ellipses, two for splines and two for closed splines. There are two basic splines. One is the interpolated spline in which the spline pass thorough the entered points (knots). The other is the normal spline in which on control points are passed by the spline (except for the two end points in the open spline).
OBJECT CREATION/MODIFICATION/REMOVAL
Multiple commands are grouped thematically in the following descriptions (which is listed alphabetically).
AREA-FILL ON/OFF
Turn on or off area-fill mode. This will affect any arcs, boxes, polygons, circles, closed splines or ellipses created subsequently.
ADD/DELETE ARROWS
Add or delete arrow heads for POLYLINE, POLYGON, SPLINE or CLOSED SPLINE objects (points of a BOX can not be added or deleted).
ADD/DELETE POINTS
Add or delete points for POLYLINE, POLYGON, SPLINE or CLOSED SPLINE objects (points of a BOX can not be added or deleted).
ARC Create an arc. Specify three points using the left button.
BOX Create rectangular boxes. Start with the left button and terminate with the middle button.
ROUNDED-CORNER BOX
Create rectangular boxes with rounded corners. Start with the left button and terminate with the middle button. The radius of the corners is selected by the INCREASE/DECREASE RADIUS button.
BREAK COMPOUND
Break a compound object to allow manipulation of its component parts. Click the left button on the bounding box of the compound object.
CHANGE OBJECT
Change settings for an existing object. Click the left button on the object and a pop-up menu will appear showing existing settings for the object. Some of the menu entries may be changed by typing new values in the appropriate windows. These allow cut and paste. Others pop up a sub-menu of multiple choices when pressed and held. Press the "done" button to apply the changes to the object and finish. Press the "apply" button to apply the changes but keep the menu up for further changes. Press the "cancel" button to cancel the changes and pop down the menu.
CIRCLE
Create circles by specifying their radii or diameters. Click the left button on the canvas window, move the cursor until the desired radius or diameter is reached, then click the middle button to terminate. The circle will be drawn after the pressing of the middle button.
CLOSED INTERPOLATED SPLINE
Create closed or periodic splines. The function is similar to POLYGON except that a closed interpolated spline is drawn. The spline will pass through the points (knots).
CLOSED SPLINE
Create closed or periodic spline objects. The function is similar to POLYGON except that a closed spline will be drawn instead of polygon. The entered points are just control points; i.e., the spline will not pass any of these points.
COPY Copy object. Click the left button over part of the object to be copied (for CIRCLE and ELLIPSE objects, position on their circumferences). Drag the object to the desired position and click the middle button. This function as well as the following three functions (MOVE, MOVE POINT, REMOVE) will cause point markers (manipulation aids) to be shown on the canvas window. There are no markers for CIRCLE or ELLIPSE objects.
DARKEN/LIGHTEN AREA-FILL COLOR
The left button lightens the area-fill color (black to white through 20 gray levels). The right button darkens it. The (approximate) current area fill color is shown in the right-most indicator window.
ELLIPSE
Create ellipses using the same procedure as for the drawing of circles.
FLIP Invert the object (middle button) or produce a mirror-image copy of an object (left button). Point to part of the object ("the handle"), click the appropriate button.
GLUE Glue the objects within a bounding box into a compound object (the bounding box itself is not part of the figure; it is a visual aid for manipulating the compound).
INCREASE/DECREASE LINE THICKNESS
The left button decreases the line thickness by one pixel, the right button increases it by one pixel. The current line thickness is shown in the left-most indicator window.
INCREASE/DECREASE RADIUS OF ROUNDED BOX CORNERS
The left button decreases the radius used in the corners of rounded boxes, the right button increases it. The current radius is shown in the middle indicator window.
INTERPOLATED SPLINE
Create (cubic spline) spline objects. Enter control vectors in the same way as for creation of a POLYLINE object. At least three points (two control vectors) must be entered. The spline will pass through the entered points.
MOVE
Move objects in the same way as in COPY.
MOVE POINT
Modify the position of points of POLYLINE, BOX, POLYGON, ELLIPSE, ARC and SPLINE objects. Click the left button over the desired point, reposition the point, and click the middle button. Note that BOX, ROUNDED-CORNER BOX and POLYGON objects are internally stored as POLYLINE objects, and therefore moving certain points may open these objects.
POLYGON
Same as POLYLINE except that a line segment is drawn connecting the first and last points entered.
POLYLINE
Create polylines (line segments connecting a sequence of points). Enter points by clicking the left button at the desired positions on the canvas window. Click the middle button to terminate.
REMOVE
Remove (or delete) objects.
ROTATE
Rotate the object (middle button) or copy (left button) +90 degrees.
SCALE COMPOUND
Only compound objects can be scaled. Click the left button on a corner of the bounding box, stretch the bounding box to the desired size, and click the middle button. Or click the left button on a side of the bounding box, stretch that side to the desired size, and click the middle button.
SPLINE
Create (quadratic spline) spline objects. Enter control vectors in the same way as for creation of a POLYLINE object. At least three points (two control vectors) must be entered. The spline will pass only the two end points.
TEXT Create text strings. Click the left button at the desired position on the canvas window, then enter text from the keyboard. Text is drawn using the current font, font size and justification settings. A DEL or ^H (backspace) will delete a character, while a ^U will kill the entire line. Terminate by clicking the middle button or typing the return key. To edit text, click on an existing text string with the left button. Insertion of characters will take place at that point.
TURN Turn POLYGON into a CLOSED INTERPOLATED SPLINE object, or turn POLYLINE into a INTERPOLATED SPLINE object.
DRAWING AIDS
Drawing aids act as toggle switches. More than one can be selected at a time (except for GRID and the line drawing modes).
AUTO FORWARD/BACKWARD ARROW
Automatically add forward/backward arrow heads to POLYLINE, SPLINE or ARC objects.
MAGNET
Round points to the nearest 1/16 of an inch. This affects every function, and is provided as an alignment aid.
UNRESTRICTED
Allow lines to be drawn with any slope.
LATEX LINE
Allow lines to be drawn only at slopes which can be handled by LaTeX picture environment lines: slope = x/y, where x,y are integers in the range [-6,6].
LATEX VECTOR
Allow lines to be drawn only at slopes which can be handled by LaTeX picture environment vectors: slope = x/y, where x,y are integers in the range [-4,4].
MANHATTAN
Enforce drawing of lines in the horizontal and vertical direction only. Both MANHATTAN and MOUNTAIN can be turned on simultaneously. The creations of POLYGON, POLYLINE and SPLINE objects are affected by these two modes.
MOUNTAIN
Enforce drawing of only diagonal lines. Both MANHATTAN and MOUNTAIN can be turned on simultaneously. The creations of POLYGON, POLYLINE and SPLINE objects are affected by these two modes.
MANHATTAN MOUNTAIN
Allow lines to be drawn at any slope allowed when in MOUNTAIN or MANHATTAN modes.
GRID Display either the quarter- or half-inch grids (left button).
SOLID/DASHED/DOTTED LINE STYLE
Toggle between solid, dashed and dotted line styles. The dash length is fixed at 0.05 inch.
X DEFAULTS
The overall widget name(Class) is xfig.fig(Fig.TopLevelShell). This set of resources correspond to the command line arguments:
justify (boolean:false) -right (true) and -left (false) arguments
landscape (boolean:true) -Landscape and -Portrait arguments
pwidth (integer:7.5 or 10 inches) -pwidth argument
pheight (integer:10 or 7.5 inches) -pheight argument
trackCursor (boolean:on) -track and -notrack arguments
inches (boolean:true) -inches and -metric arguments
reverseVideo (boolean:off) -inverse argument
debug (boolean:off) -debug argument
normalFont (string:fixed) -normal argument
boldFont (string:8x13bold) -bold argument
These arguments correspond to the widgets which make up xfig.
overall window form(Form)
side panel form.side_panel(Form.Box)
bottom panel form.bottom_panel(Form.Box)
buttons form.side_panel.button(Form.Box.Command) form.bottom_panel.button(Form.Box.Command)
top ruler form.truler(Form.Label)
side ruler form.sruler(Form.Label)
canvas form.canvas(Form.Label)
message window form.message(Form.Command)
command menu form.popup_menu.menu(Form.OverrideShell.Box)
command menu title
form.popup_menu.menu.title(Form.OverrideShell.Box.Label)
command menu items
form.popup_menu.menu.pane(Form.OverrideShell.Box.Command)
font menu form.font_menu.menu(Form.OverrideShell.Box)
change menu change.form(TransientShell.Form)
indicator panel form.indicator(Form.Box)
font indicator window
form.font_indicator(Form.Label)
For example, to set the background of the side panel to blue and the indicator panel background to green the resources would be:
xfig∗form.panel.background: blue
xfig∗form.indicator.background: blue
BUGS
Creating a text object is not "Undoable".
Area fill doesn’t show on the canvas for closed splines, but are filled when printed. This has to do with the way the splines are generated on the screen.
Undoing the creation of a compound object deletes the objects outside the compound object. Undoing the undo doesn’t bring them back.
Ellipses which are too narrow are not drawn correctly.
SEE ALSO
Brian W. Kernighan PIC - A Graphics Language for Typesetting User Manual
f2ps(1) f2p(1)
ACKNOWLEDGEMENT
Many thanks goes to Professor Donald E. Fussell who inspired the creation of this tool.
AUTHORS
Original author:
Supoj Sutanthavibul
University of Texas at Austin
(supoj@sally.utexas.edu) Manual page modified by:
R. P. C. Rodgers
UCSF School of Pharmacy
San Francisco, CA 94118 The LaTeX line drawing modes were contributed by:
Frank Schmuck
Cornell University X11 port by:
Ken Yap
Rochester
(ken@cs.rochester.edu) Variable window sizes, cleanup of X11 port, right hand side panel under X11, X11 manual page provided by:
Dana Chee
Bellcore
(dana@bellcore.com) Cleanup of color port to X11 by:
John T. Kohl
MIT
(jtkohl@athena.mit.edu) Area fill, multiple line thicknesses, multiple fonts and font sizes, bottom panel, line style/thickness modification of objects by: Brian V. Smith
Lawrence Berkeley Laboratory
(standard disclaimer applies)
(bvsmith@lbl.gov) Popup change-object menu by:
Jon Tombs (jon%robots.oxford.ac.uk@nsfnet-relay.ac.uk)
and
Frank Schmuck
(schmuck@svax.cs.cornell.edu)
7th Edition — Release 2.0 (Protocol 1.4X)