TGIF(1) — USER COMMANDS
NAME
tgif − Xlib based 2-D drawing facility under X11. Supports hierarchical construction of drawings and easy navigation between sets of drawings.
SYNOPSIS
tgif [-display displayname] [-geometry geom] [=geom] [file]
DESCRIPTION
Tgif is an interactive drawing tool that allows the user to draw and manipulate objects in the X Window System. The command line argument file specifies a file of objects to be initially edited by tgif. Tgif is purely based on Xlib. It is tested under X11-R4, and it requires a 3 button mouse.
Primitive objects supported by tgif are rectanges, ovals, rounded-corner rectangles, arcs, polylines, polygons, open-splines, closed-splines, X11 bitmaps, text, and some specific forms of X11 pixmaps. Objects can be grouped together to form a grouped object. A primitive or grouped object can be made into an icon object or a symbol object through user commands.
Tgif objects are stored in two types of files. A file with a .obj extension (refered to as an object file) is a file of objects, and a file with a .sym extension (refered to as a symbol file) specifies a “building-block” object. A teleport mechanism is provided to travel among the .obj files. A building-block object consists of the representation part and the definition part of the object. Tgif supports the “bottom-up” construction of hierarchical drawings by providing the capability to “instantiate” a building-block object in a drawing. Tgif also supports the “top-down” specification of drawings by allowing the user to make any object the representation of an un-specified subsystem. Both types of files are stored in the form of Prolog facts. Prolog code can be written to interpret the drawings! (It is left to the user to produce this code. See tgif.pl for hints.) Prolog engines will be refered to as drivers in the sections follows.
Attributes can be attached to any non-text objects. Attributes specified in the representation part of a building-block object are non-detachable, when such an object is instantiated. See ATTRIBUTES section for details.
Tgif can generate outputs in four different format. By default, the output is in PostScript(TM) format (color PostScript is supported), and it is generated in to a file named /tmp/Tgifa∗ (produced by mktemp() calls) where ∗ is a number and this file is piped to lpr. This takes place when the laser-printer icon is displayed in the Choice Window (see below for the naming of tgif windows). This output can be redirected to a file with a .ps extension. This takes place when the PS icon is displayed. When the LaTeX icon is display, the output generated with the .eps extension, and the file is in the encapsulated PostScript format. This file can be included in a LaTeX document with the psfig or epsf construct; this will be discussed later. When the x11bm (X11 bitmap) icon is displayed in the Choice Window and color output is not selected, tgif generates the output with the .xbm extension, and the output is in the X11 bitmap format. However, if the x11bm icon is displayed in the Choice Window and color output is selected (through the ^#K keyboard command), tgif generates the output with the .xpm extension, and the output is in the X11 pixmap format (the version of this XPM format depends on the settings of the XPmOutputVersion X default). An X11 bitmap file and some specific forms of X11 pixmap file (such as the one generated by tgif; see the section on X11 PIXMAP for details) can be imported into tgif and be represented as an tgif primitive object.
Tgif drawings are supposed to be printed on letter size paper (8.5in by 11in). Both landscape and portrait page styles are supported by tgif. Reduction (or magnification) can be controlled by the #% keyboard command to set the reduction/magnification. If the compiler flag -DA4PAPER is defined (in Imakefile or Makefile.noimake), then the output is supposed to be printed on A4 papers (which have the dimension about 8.25in by 11.7in).
GRAPHICAL OBJECTS
An object in an object (.obj) file can be a primitive object, a grouped object, or an icon object. A symbol (.sym) file can have any number of objects allowed in an object file and exactly one symbol object. (Recall that a symbol file specifies a building-block object.) The symbol object in a symbol file is the representation part of the building-block object, and the rest of the symbol file is the definition part of the building-block object. The symbol object is highlighted with a dashed outline to distinguished it from the rest of the objects. When a building-block object is instantiated, the symbol part of the file is copied into the graphics editor and becomes the icon for the building-block object.
All objects in tgif can be moved, duplicated, deleted, rotated, and flipped. (However, flipping text objects horizontally will cause the text justification to change, and flipping text objects vertically will usually cause the text object to move.) All objects except text, bitmap, pixmap, and icon objects can be stretched (scaled).
Tgif supports 32 fill patterns, 32 pen patterns, 7 line widths, 4 line styles (plain, head arrow, tail arrow, double arrows) for polyline and open-splines, 8 dash patterns, 3 types of text justifications, 4 text styles (roman, itatlic, bold, bold-italic), 12 text sizes (8, 10, 12, 14, 18, and 24 for the 75dpi fonts and 11, 14, 17, 20, 25, and 34 for the 100dpi fonts), 5 fonts (Times, Courier, Helvetica, New-Century-Schoolbook, Symbol), and 10 default colors (magenta, red, green, blue, yellow, pink, cyan, cadet-blue, white, dark-slate-gray). Only right-angle rotations are supported. Most commands in tgif can either be activated by a pop-up menu or by typing an appropriate non-alphanumeric key.
TGIF SUBWINDOWS
The tgif windows are described below.
Top Window
Displays the current domain and the name of the file tgif is looking at. Mouse clicks and key presses have no effect.
Message Window
This is right under the top window on the left. It displays tgif messages. Clicking the left mouse button in this window scrolls the messages towards the bottom, clicking the right mouse button scrolls towards the top, and clicking hte middle mouse button scrolls to the location in the message history depending on where the mouse is clicked.
Panel (Choice) Window
This is the window to the right of the message window. It displays the current choice (in top/bottom, left/right order) of the drawing mode, color, horizontal alignment (L C R -), vertical alignment (T M B -), text justification, font, text vertical spacing, point size, text rotation, special (see below), line width, line style, poly or spline, dash pattern, edit (see below), constrained/unconstrained move (and stretch) mode, print mode, file (see below), fill pattern, and pen pattern. Key presses have no effect in this window.
The “special”, “edit”, and “file” mentioned above are dummy icons that allow the “special”, “edit”, and “file” menus to be accesses in the Choice Window.
Left mouse button advances a particular choice; right mouse button advances in the reverse direction, and the middle button generates a pop-up menu to set a particular choice (except for the text vertical spacing item where dragging the mouse left or up decreases the vertical spacing and dragging it right or down increases the vertical spacing). If there are objects selected in the canvas window, then the action of the mouse will cause the selected objects to change to the newly selected choice; note that in this case, the current choice won’t change if the middle button is used. However, these operations do not apply to icon objects because icon objects should be thought of as “bitmaps” (except in the case where one wishes to change the color of an object; if the icon is single-colored, then one can change its color).
The settings of the horizontal and vertical alignments determine how objects align with each other when the ^L keyboard command is issued, they determine how each individual object aligns with the grids when the ^T keyboard command is issued, and they determine how each icon replaces the old icion when the ^#U keyboard comand is issued. The horizontal alignments are left (L), center (C), right (R), and ignore (-). The vertical alignments are top (T), middle (M), bottom (B), and ignore (-). The best way to understand them is to try them out.
The text vertical spacing determines the vertical distance to advance when a carriage return is pressed during text editing. If the user tries to set the value too negatively such that the next line is exactly at the same position as the current line, then such setting is not allowed (this distance depends on the current font and point size).
Canvas Window
This is the drawing area. Left mouse button selects, moves, stretches, and reshapes objects. Holding down the shift key and clicking the left mouse on an object which is not currently selected will add the object to the list of already selected objects. The same action applied to an object which is already selected will cause it to be de-selected. When stretching objects (not reshaping poly-type objects), if the shift key is held down after stretching is initiated, then proportional stretching is activated (basically, a scale operation is being performed). Text, bitmap, pixmap, and icon objects can not be stretched or scaled. Clicking the middle mouse button generates the menu to change the drawing mode. In non-text edit mode, clicking the middle mouse button while the shift key is held down will activate the teleport (or travel) mechanism. See the section on TELEPORT for details.
If the current move/stretch mode is of the constrained type (activated and deactivated by the #@ command), top-level polylines will have the following behavior. In a move operation, if both endpoints of a polyline lie inside the objects being moved, then the whole polyline is moved; otherwise, if only one endpoint falls inside the objects being moved, then that endpoint is moved. In a stretch (not reshape) operation, if an endpoint of a polyline lies inside the objects being moved, that endpoint will be moved.
When the drawing mode is set to text (a verticle-bar cursor is shown), clicking left mouse button causes selected text to go into edit mode. Clicking the middle mouse button highlights sub-strings of the text. In edit mode, key presses are treated as text strings being inputed and arrow keys are used to move the current input position. If a key press is preceeded by an <ESC> key, then the character’s bit 7 is turned on. This allows non-ASCII characters to be entered. There are some characters that are supported by X11 but not by PostScript; these characters are not accepted by tgif.
If the drawing mode is set to draw polygons (not closed-splines) and if the shift key is held down, the rubber-banded polygon will be self-closing.
Right mouse button always generates the main tgif pop-up menu. Holding down the shift key and clicking the right mouse button will change the drawing mode to select. Key presses with the <Control> or <Meta> key held down (will be refered as non-alphanumeric key presses since they can also generate control characters) are treated as commands, and their bindings are summarized in the next section. Users can also define single key commands to emulate the non-alphanumeric key commands. The SHORTCUTS section will describe the details.
Scrollbars
Only the left mouse button has effect in the scrollbar windows. Clicking the left mouse button in the arrow portion of a scrollbar window causes the canvas window to scroll a small distance on the page, and clicking with the shift key held down will scroll a window full. Clicking in the main area of the scrollbar window causes the page to scroll to the specified location from the top or the left of the page.
Rulers
They track the mouse location. Mouse clicks and key presses have no effect.
NON-ALPHANUMERIC KEY BINDINGS
“^” denotes the <Control> key and “#” denotes the <Meta> key in the following description.
^Aselect all
^Bsend selected objects to the back
^Cchange domain
^Dduplicate selected objects
^Esave/restore drawing mode
^Fsend selected objects to the front
^Ggroup selected objects (the grouped object will be brought to the front)
^Iinstantiate a building-block object
^Kpop back to (or return to) a higher level and close the symbol file (reverse of ^V)
^Lalign selected objects according to the current alignment
^Nopen a new un-named object file
^Oopen an object file to edit
^Pprint the current page
^Qquit tgif
^Rredraw the page
^Ssave the current object or symbol file
^Talign selected objects to the grid according to the current alignment
^Uungroup selected objects
^Vpush into (or edit) the definition part of a building-block object (selected object must be an icon object)
^Wchange the drawing mode to text
^Xdelete all selected objects
^Ycopy selected object to cut buffer
^Zescape to driver
^,scroll left
^.scroll right
^-print the current page with a specified command
#Aattach selected text objects to a selected non-text object as attributes
#Bescape to driver
#Crotate selected objects counter-clockwise
#Ddecrement grid size
#Esend a token on a selected polyline
#Fflash the selected polyline
#Gshow/un-show grid points
#Hflip the selected object horizontally
#Iincrement the grid size
#Jhide attribute names of the selected objects
#Kchange the drawing mode to select
#Mmove the attributes of a selected object
#Nshow all attribute names of the selected objects
#Ozoom out
#Pimport a .obj file into the current file
#Qchange the drawing mode to polyline/open-spline
#Rchange the drawing mode to rectangle
#Sescapt to driver
#Tdetach the attributes of the selected objects
#Uundo the previous delete operation
#Vflip the selected object vertically
#Wrotate the selected objects clockwise
#Xescape to driver
#Yescape to driver
#Zzoom in
#9create a user-specified arc (12 o’clock position is 0 degree)
#,scroll up
#.scroll down
#-show all attributes of the selected objects
#[align objects at the left
#=align objects at the center (horizontally)
#]align objects at the right
#{align objects at the top
#+align objects at the middle (vertically)
#}align objects at the bottom
#"make selected polygons regular (fit the original bounding box)
#%set the percent print reduction (if < 100%) or magnification (if > 100%)
#:go to default zoom
#‘zoom out all the way so that the whole page is visible
#~saved selected objects into a new file
#;cut selected bitmap/pixmap
#_abut objects horizontally
#|abut objects vertically
##break up text objects into single character text objects
#^scroll to the left top corner of the page
#@toggle between constrained and unconstrained move (stretch) modes
^#Aadd points to the selected poly or spline
^#Bchange the text style to bold
^#Cchange the text justification to center justified
^#Ddelete points from the selected poly or spline
^#Echange the drawing mode to rounded-corner rectangles
^#Finvert selected bitmap objects
^#Gtoggle snapping to the grid points
^#Hhide all attributes of the selected objects
^#Imake the selected object iconic
^#Jmake the selected icon object a grouped object
^#Kselect color or black-and-white output
^#Lchange the text justification to left justified
^#Mmake the selected object symbolic
^#Nmake the selected symbolic object a grouped object
^#Ochange the text style to roman
^#Pchange the text style to bold-italic
^#Qchange the drawing mode to polygon/closed-spline
^#Rchange the text justification to right justified
^#Ssave the file under a new name
^#Tchange the text style to italic
^#Uupdate iconic representations of selected objects
^#Vchange the drawing mode to oval
^#Wtoggle between poly and spline
^#Xcycle among the various output file formats
^#Ypaste from the cut buffer
^#Zchange the drawing mode to arcs
^#.import a X11 bitmap file
^#,import a X11 pixmap file
^#-toggle between English and Metric grid systems
SHORTCUTS
Use can define single character shortcut keys to emulate the non-alphanumeric key presses to activate commands. This is done through the use of the Tgif∗ShortCuts X defaults. (Please note that these shortcut keys are only active when the drawing mode is not set to the text mode.) The Tgif∗ShortCuts consists of a list of items, each of which specifies the bindings between a key (may be case sensitive) and a command. The items are seperated by blanks, and each item is interpreted as follows. It consists of two parts, KEY and COMMAND, which are concatenated together with a ’:’ character. The format of the KEY part is either :<Key>x, !<Key>x, or <Key>x (here the character ’x’ is used as an example; furthermore, the substring <Key> must be spelled exactly the way it is appeared here). The first 2 formats are equivalent, they specify the lower case x; the 3rd format specifies both the characters ’x’ and ’X’. The COMMAND part is a string that matches strings in tgif’s popup menus (excepted noted in the paragraph below). This is illustrated by the following example. In the Edit menu, there is an entry
"SelectAll ^A"
which means that <Control>A activates the SelectAll() command. Therefore, SelectAll() is a valid name for the COMMAND part of the shortcut specification. To complete the example, :<Key>a:SelectAll() will allow the lower case ’a’ to execute the SelectAll() command. Please note that only commands executable through a non-alphanumeric key command can be emulated by a shortcut. Therefore, if a menu entry doesn’t contain a <Control> or <Meta> key binding (such as any the entries in the Font menu), it is not possible to bind it with a shortcut. For more example, please see the tgif.Xdefaults sample X defaults file included in the tgif distribution.
Here is a list of exceptions where the COMMAND does not match a command name in a menu entry. The left entry is a proper COMMAND name, and the right is a list of strings that’s shown in popup menus which the COMMAND would correspond to.
CyclePrintFormat()Printer LaTeXFig RawPSFile XBitmap
ToggleBW/ColorPS()BlkWhtPS ColorPS
ToggleGridSystem()EnglishGrid MetricGrid
ToggleLineType()(toggles between straight and curved shapes)
ToggleMoveMode()ConstMove UnConstMove
In addition to the above list, the following are also valid COMMAND names (having obvious meanings): ScrollLeft(), ScrollRight(), ScrollUp(), ScrollDown(), SelectMode(), DrawText(), DrawBox(), DrawOval(), DrawPoly(), DrawPolygon(), DrawRCBox(), and DrawArc().
ATTRIBUTES
Attributes are text strings of the form name=value or value which are attached to any non-text objects. Attributes can be attached and detached from these objects except in the following case:
Attributes appeared in the symbol object in a building-block object file can not be detached when the building-block object is instantiated. These attributes are considered to be the “inherited” attributes of the icon object.
The user has control over which part of an attribute is displayed. An entire attribute can be made invisible, or only its name can be made invisible (accomplished through the commands under the special menu, such as #M, #N, #J, etc).
TELEPORT
Tgif provides the mechanism to travel between .obj files. When the middle mouse button is clicked on an object when the shift key is held down, tgif looks for an attribute named warp_to (by default) of that object. If such an attribute is found, the value part of the attribute is interpreted as the name of a .obj file to travel to. If the current file is modified, the user is prompted to save the file before traveling to the next file. If there are multiple warp_to attributes on the object, but are in different colors, tgif will use the one that has the same color as the color appeared in the Choice Window. If the value part of the warp_to attribute starts with the ’/’ character, the value is treated as an absolute file name; otherwise, it is treated as a relative file name.
DOMAINS
A domain is a collection of library symbols suitable for instantiations. A library is implemented as a directoy of .sym files, and therefore, a domain is implemented as a search path. If there are symbols with the same file names but reside in different directories specified in the search path, then the one closer to the front of the search path will be made available for the user to instantiate.
The number of domains is specified by the MaxDomains X default, and the names of the domains are specified by the Domain# X default. The library search paths are specified by csh environment variables. See the section on X DEFAULTS and ENVIRONMENT VARIABLES for more details.
SELECTING A NAME FROM A POPUP WINDOW
When selecting a file name, a symbol name, or a domain name, tgif pops up a window with appropriate names for the user to choose from. The user can use mouse clicks to select an entry. Key strokes can also be used to specify the desired name; however, tgif attempts to match the key strokes with names in the selection on the fly. If a match can not be found, the key strokes are ignored. ^N, ^J, or the DownArrow key advances the selection down by 1 entry; ^P, ^K, or the UpArrow key advances the selection up by 1 entry. ^F or ^D advances the selection 10 entries down; ^B or ^U advances the selection 10 entries up. ’$’ will select the last entry while ’^’ will select the first entry. ^W or ^Y un-select the selected entry.
The current selection is displayed near the top of the popup window. Back-space should be used with caution because it might change directory to the parent directory.
HOW TO MAKE A BUILDING-BLOCK OBJECT (SYMBOL FILE)
Here are the steps for defining a building-block object, to be used in a hierarchical design.
1)Draw the representation part of the building-block object. Group everything together. Select this grouped object.
2)Pop-up the main menu with the right mouse button; select “Special”. Select “MakeSymbolic” from the next pop-up menu. The selected object becomes a symbol and gets a dashed boundary.
3)Type in attributes as individual text strings. Select the symbol object and all the text strgings to be attached to the symbol. Type #A (for Attach) to attach attributes to the symbol.
4)Build the definition part of the building-block object. Look at the “flip-flop.sym” file for an example. To look at that file, first, instantiate a “flip-flop” by typing ^I (for Instantialte). Select the flip-flop from the pop-up window; place the flip-flop; select the flip-flop and type ^V (for Push) to see the symbol file.
5)Save and name the file.
X11 PIXMAP (XPM) FORMATS
Tgif can only import X11 pixmaps that satisfy the constraints described here. The format of the X11 pixmap must be either 1 (XPM1) or 3 (XPM3). Only a subset of the XPM3 format is supported, namely, the key field for the color specification must be ’c’ (for color visuals). Tools that generate XPM1 format files are (they might have been upgraded to support XPM3), pbmplus, which is a set of bitmap and pixmap conversion freeware (together with xv, the bitmap/pixmap can be stretched, scaled, etc), and xgrabsc, another freeware; also, xloadimage can display XPM1 files. Tools that can generate XPM3 format files are, for example, xsnap and sxpm. For each color specified in the color string, a color cell is allocated. If the allocation fails, the current color will be used for that color string. If the first color character is a back-quote (‘) or a space, then the corresponding color is substituted with the background color of the tgif window if the GuessXPmBgColor X default is set to “true”. (This design choice is made because the pixmap will then look “right” on both regular and reverse video.) The following is an example of a very small pixmap file (in XPM1 format).
#define arrow_format 1
#define arrow_width 5
#define arrow_height 3
#define arrow_ncolors 3
#define arrow_chars_per_pixel 1
static char ∗arrow_colors[] = {
"‘", "Black",
"a", "red",
"b", "yellow"
};
static char ∗arrow_pixels[] = {
"‘a",
"aabbb",
"‘a"
};
LATEX FIGURE FORMATS
Here we show how to make a figure for a LaTeX file, first with the psfig (or epsf) special construct, then with the psfile special construct. (The author does not recommand the psfile construct.) An example of both can be found in “example.tex” included with this distribution.
To print a tgif file to be included in a LaTeX document with the psfig or epsf special construct (files generated will be in the encapsulated PostScript format), first select LaTeX format in the panel window (click the left mouse button on the laser printer icon), then type ^P to generate the encapsulated PostScript file. If the file name is “an-sr-flip-flop.obj”, then the LaTeX figure file generated will be named “an-sr-flip-flop.eps”. This file can be included in a LaTeX document as follows,
\begin{figure∗}[htb]
\input{psfig}
\centerline{\psfig{figure=an-sr-flip-flop.eps}}
\caption{An SR flip-flop. \label{fig:an-sr-flip-flop}}
\end{figure∗}
An alternative way is to use the epsf construct as follows,
\begin{figure∗}[htb]
\input{epsf}
\centerline{\epsffile{an-sr-flip-flop.eps}}
\caption{An SR flip-flop. \label{fig:an-sr-flip-flop}}
\end{figure∗}
The \centerline command above centers the picture. If you have multiple tgif figures in your LaTeX document, you only have to include the psfig macro (\input{psfig} or \input{epsf}) once right after \begin{document}. Then within each figure environment, you wouldn’t need the \input{psfig} (or \input{epsf} line.
If encapsulated PostScript is not desired, the psfile special construct can be used as described here. First, center the picture on the page (e.g., the width of a portrait style page is 7.5 inch, so the center of the page is at the 3.75 inch mark), and make the top object on the page as close to the top of the page as possible. Select LaTeX format in the panel window, then print in the LaTeX format. Same as with the psfig construct, a file with the .eps extention will be generated. This file can be included in a LaTeX document as follows,
\begin{figure∗}[htb]
\special{psfile="an-sr-flip-flop.eps" hoffset=-40}
\rule{0in}{1.1in}
\caption{An SR flip-flop. \label{fig:an-sr-flip-flop}}
\end{figure∗}
The \rule{0in}{1.1in} above specifies an invisible box of 1.1 inches high, which is the total height of the picture in an-sr-flip-flop.
X DEFAULTS
Tgif∗Geometry: WIDTHxHEIGHT+X+Y
Tgif∗IconGeometry: +X+Y
Tgif∗Foreground: COLORSTRING
Tgif∗Background: COLORSTRING
Tgif∗BorderColor: COLORSTRING
If not specified, the foreground color will be used.
Tgif∗ReverseVideo: [on,off]
For black and white terminal, reverse video “on” means the background is black. For color terminal, reverse video “on” means the background is specified by the Tgif∗Foreground color.
Tgif∗InitialFont: [Times,Courier,Helvetica,NewCentury,Symbol]
This specified the initial font. The default is Courier.
Tgif∗InitialFontStyle: [Roman,Bold,Italic,BoldItalic]
This specified the initial font style. The default is Roman.
Tgif∗InitialFontJust: [Left,Center,Right]
This specified the initial font justification. The default is Left.
Tgif∗InitialFontDPI: [75,100]
This specified the initial font DPI (dots-per-inch). The default is 75.
Tgif∗InitialFontSizeIndex: [0,1,2,3,4,5]
This specified the initial size index of the start-up font. For the 75dpi font, the indices correspond to point sizes 8, 10, 12, 14, 18, and 24. For the 100dpi font, the indices correspond to point sizes 11, 14, 17, 20, 25, 34. The default is 4 (18 points) for the 75dpi font and 2 (17 points) for the 100dpi font.
Tgif∗MsgFontSizeIndex: [0,1,2,3,4,5]
This specified the size index of the font used for messages and popup windows. The meaning of the indices is the same as for Tgif∗InitialFontSizeIndex. The default is 4 (18 points) for the 75dpi font and 2 (17 points) for the 100dpi font.
Tgif∗DefaultCursor: [x_cursor,arrow,...]
This specified the select cursor. Entries in <X11/cursorfont.h> (without the XC_ prefix) are valid names of the cursor. The default is arrow.
Tgif∗DrawCursor: [x_cursor,arrow,...]
This specified the cursor used when drawing objects. Entries in <X11/cursorfont.h> (without the XC_ prefix) are valid names of the cursor. The default is the same as Tgif∗DefaultCursor.
Tgif∗DragCursor: [x_cursor,arrow,...]
This specified the cursor used when dragging. Entries in <X11/cursorfont.h> (without the XC_ prefix) are valid names of the cursor. The default is hand2.
Tgif∗RubberBandColor: COLORSTRING
This specified color used for rubber-banding (XORing). The default color is the same as the foreground color.
Tgif∗PrintCommand: COMMAND
This specified the print command used for printing the PostScript file. The default is lpr (without any quotes). An example would be lpr -h -Pprintername.
Tgif∗WhereToPrint: [Printer,EPS,PS,Bitmap]
This specified the initial print destination/format. The default is EPS.
Tgif∗PrintDirectory: PATH
This specified the print directory when the output destination is not the printer. The default is a null string, which means that the output goes into the directory where the current file is.
Tgif∗NoTgifIcon: [true,false]
If set to “true”, tgif will not use its own icon window. The default is false.
Tgif∗DontShowVersion: [true,false]
If set to “true”, tgif version will not be displayed on the top. The default is false.
Tgif∗XBmReverseVideo: [true,false]
If set to “true”, a invert bitmap operation will be performed when importing a X Bitmap file. The default is false.
Tgif∗AskForXBmSpec: [true,false]
If set to “true”, the user will be asked to specify magnification and geometry for a X Bitmap file being imported. Format of the specification is MAG=WxH+X+Y, where MAG is the magnification, W and H specifies the width and height, and the location specification can be +X+Y, +X-Y, -X+Y, and -X-Y. The ’=’ is mandatory if any of the geometry information is specified. The default is false.
Tgif∗AskForXPmSpec: [true,false]
If set to “true”, the user will be asked to specify magnification and geometry for a X Pixmap file being imported. Format of the specification is the same as for AskForXBmSpec. The default is false.
Tgif∗GuessXPmBgColor: [true,false]
If set to “true”, when tgif is importing an X Pixmap file and if the first color string is ’ ’ or ’‘’, the first color will be treated as a background color. This means that the specified color in the X Pixmap file will be changed into the current background color. The default is false. (Please note that this default was true before patch 2 of tgif-2.7.)
Tgif∗XPmOutputVersion: NUMBER
This specifies the XPM version number when outputing in the X11 pixmap format. NUMBER can take on values 1 or 3. The default is 1.
Tgif∗ConstrainedMove: [true,false]
When set to true, moving an object will cause the endpoint(s) of all polylines, whose endpoint(s) falls within the object, to be moved. The default value is false.
Tgif∗GridSystem: [English,Metric]
This sets the initial grid system. The default is English.
Tgif∗InitialGrid: NUMBER
This specifies the initial grid size. For the English grid system, NUMBER can be -2, -1, 0, +1, or +2 for grid size of 1/32, 1/16, 1/8, 1/4, and 1/2 inch. For the Metric grid system, NUMBER can be -1, 0, +1, or +2 for grid size of 1mm, 2mm, 5mm, and 1cm. The default value is 0.
Tgif∗DropObsIconAttrWhenUpdate: [true,false]
If set to “true”, obsolete icon attributes will be dropped without confirmation when the UpdateSymbols command is executed. If set to “false”, a popup window will prompt the user to specify what to do with the obsoleted icon attributes. The default is false.
Tgif∗UseRecentDupDistance: [true,false]
If set to “true”, the most recent change in position produced by a combination of a duplicate and a move command will be used for the new duplicate command. Otherwise, some default distance will be used to position the duplicate. The default is true.
Tgif∗SplineTolerance: NUMBER
This specifies the tolerance of spline drawing. The smaller the number, the smoother the spline. The default is 9 (min is 3 and max is 13).
Tgif∗SplineRubberband: [true,false]
If set to “true”, splines will be used to rubberband open and closed splines in drawing and stretching them. (This might not be desirable if the spline contains too many vertices.) The default is true.
Tgif∗Synchronize: [on,off]
XSynchronize is called if this default is set to on. Default is off.
Tgif∗DoubleClickUnIconify: [true,false]
If set to true, double mouse clicks are used to un-iconify the icon window (in this mode, the icon window ignores single mouse clicks and drags). The default is false.
Tgif∗MainMenuPinDistance: NUMBER
This specified the horizontal distance (in pixels) the user needs to drag the main popup menu before the main menu is to be pinned down. The default is 80. (If pinned main menu is no desired, then this should be set to a value greater than the screen width.) Dragging the right button can be used to move the pinned main menu; clicking the middle button in the main menu will remove it.
Tgif∗DoubleClickInterval: NUMBER
This specifies the maximum interval (in milli-seconds) between two clicked to be recognized as one double-click. The default is 300.
Tgif∗SaveTmpOnReturn: [true,false]
If set to true, a tmpmodel file will be saved automatically before returning to the driver. Otherwise, no files will be saved automatically. The default is true.
Tgif∗ImportFromLibrary: [true,false]
If set to true, the library directories specified by the current domain are searched for xbitmap/xpixmap files to import. Otherwise, the current import directory will be used. The default is false.
Tgif∗WarpToWinCenter: [true,false]
If set to true, the pointer is warped to the center of popup windows. Otherwise, the pointer is left alone. The default is true.
Tgif∗MaxColors: NUMBER
This specified the maximum number of colors. Color0 through ColorMax, where Max is NUMBER-1, must all exist in X defaults.
Tgif∗Color#: COLORSTRING
This specified the correspondance between the color number and a color.
Tgif∗DefaultColorIndex: NUMBER
This specified the default color index if certain color can not be found. The default is 0.
Tgif∗ShortCuts: ITEM1 ITEM2 ...
The ITEM specified the correspondance between a key (may be case sensitive) and a non-alphanumeric key command. Please read the SHORTCUTS section for details.
Tgif∗MaxLineWidths: NUMBER
This specifies the maximum number of line widths. LineWidth0 through LineWidthMax, ArrowWidth0 through ArrowWidthMax, and ArrowHeight0 through ArrowHeightMax, where Max is NUMBER-1, all must exist in X defaults. If any of them is not specified in the X defaults, some default values will be used.
Tgif∗DefaultLineWidth: NUMBER
This specifies the initial line width index. The default is 0.
Tgif∗LineWidth#: NUMBER
This specifies the line width.
Tgif∗ArrowWidth#: NUMBER
This specifies the width (when the arrow is pointing horizontally) of the arrow head for arc and open-spline objects.
Tgif∗ArrowHeight#: NUMBER
This specifies half the height (when the arrow is also pointing horizontally) of the arrow head for arc and open-spline objects.
Tgif∗MaxDomains: NUMBER
This specified the maximum number of domains. Domain0 through DomainMax, where Max is NUMBER-1, all must exist in X defaults.
Tgif∗Domain#: DOMAINSTRING
This specified the correspondance between the domain number and a domain name. See the ENVIRONMENT VARIABLE section to see how to specify a path associated with a domain.
Tgif∗DefaultDomain: NUMBER
This specified the default domain when tgif starts up. The default is 0 if not specified.
ENVIRONMENT VARIABLE
TGIFPATH
This environment variable should be set such that the files, mentioned in the FILES section below, can be found.
TGIFICON
This environment variable should be set to the name of the object file to be displayed when tgif is iconified. By default, it is set to “tgificon”. If it starts with a / character, absolute path is used; otherwise, the icon file is assumed to be $TGIFPATH/$TGIFICON.
TGIF_[Domain]
For each Domain name defined in the X defaults, TGIF_Domain specifies a search path for the symbol files. Each search path should have the same format as the PATH csh environment variable. (There is one exception. If the Domain name is Examples, then the environment variable TGIF_Examples do not have to be set. In this case, the compile flag TGIF_PATH will be used to take on the value for TGIF_Examples.) For example, to specify the symbol path for domain DEFAULT to look for symbol files in the library directory /tmp/tgif/symbols then in the current directory, the following command should be executed in csh.
setenv TGIF_DEFAULT /tmp/tgif/symbols:.
FILES
$TGIFPATH/tgificon.obj contains the default tgif icon.
$TGIFPATH/tgifmacro.ps contains tgif PostScript macros.
SEE ALSO
latex(1L), lpr(1), env(1), X(1), dvips(1), csh(1), pbmplus(1), bitmap(1), XPM(1), xgrabsc(1), xloadimage(1), xsnap(1), sxpm(1), xv(1)
IDIOSYNCHRASIES
When any of the “escape to driver” commands are (accidentally) executed, the current content of the drawing is saved into “tmpmodel.obj” if the drawing indicates that it is an .obj file. Then tgif escapes to the driver and returns right away. If the drawing indicates that it is a .sym file, then the content is saved into “tmpmodel.sym” but tgif does not return to the driver.
The paste operation works on a cut buffer generated by tgif or by non-tgif tools (such as xterm). If the cut buffer is not generated by tgif, its content is treated as ASCII character strings, which is inserted into the current drawing as a text object (current settings for text objects are used to create the text object). If the cut buffer is generated by tgif, then all the current settings are ignored.
In generating PostScript printouts, each X11 pixmap object can be thought of as having a solid background fill (unlike an X11 bitmap object whose fill can be controlled interactively). When generating black-and-white PostScript output, each pixel will be painted black if the pixel does not correspond to the background pixel. Therefore, if a pixmap object does not have a background color (the first color character is not a back-quote or a space) or none of the pixels matches the background pixel, then the black-and-white PostScript output will show a solid black black box where the pixmap object is.
Because the characters, in the range 128 to 255 (or \200 to \377), supported by X11 and PostScript are different, some of these characters supported by X11 are not accepted by tgif. Furthermore, in order to print the supported subset or these characters, character codes are re-encoded. Therefore, if one would like to hack tgif to support other personalized fonts, one should be careful about the re-encoding mechanism.
The grids are not absolute; it is specified as screen pixels, and it scales with the current zoom. For example, if the grid is set at 16 pixels at maximum zoom and if the user zooms out once, objects will fall at 16 screen pixel increments, but this corresponds to 32 pixels in the real coordinate system.
If the vertical text spacing is set to negative values, highlighted text will look look a little strange due to XOR operations. If the vertical text spacing is set to be greater than 100 or less than -100, the panel window will not be cleared properly; to clear the panel window, the user may have to close the tgif window and then open it again.
As described in the TGIF SUBWINDOWS section, in constrained move mode, if both endpoints of a not-selected polyline lies inside the object being moved, then the whole polyline is moved. This may look strange sometimes because, for example, if you starts with a line segment pointing to an object, just moving the object will caused the line segment to be “stretched”; however, if you eventually move the object so that the other endpoint is also inside the object, any future movement of the object will cause the whole line segment to move (instead of just moving the original endpoint). At this point, you should switch to the unconstrained move mode.
Another idiosynchrasy with constrained move is that right after duplicating an object, the constrained move is disabled temporarily because it is assumed that right after a duplicate operation, the user would want to move the new object to a desirable position and only after this new object is “settled down”, the constrained move will be re-enabled. Settling down is signified by clicking doing something other than moving the new object.
BUGS
There seems to be a problem printing Courier fonts with a non-solid pen on the Apple LaserWriter. (Printing single character works fine, usualy.) As pointed out by the PostScript reference manual, Courier is a “stroked font”, and it is usually “difficult” to construct character paths for such type of fonts. However, Courier fonts work fine with ghostscript and dxpsview. It’s not clear how this problem can be fixed. The author recommands avoiding Courier fonts when printing in color if non-solid pen is desired.
Arcs with arrow tips don’t look very sharp (the tip is not pointed as in open-splines with arrow tips).
At high magnifications, stretching arcs may cause anomalous behavior due to round off errors.
COPYRIGHT
Please see the “Copyright” file for details on the copyrights.
AUTHOR
William Chia-Wei Cheng (william@cs.ucla.edu)
Amiga Unix — Last change: Version 2.11 and Above