Tgif Home
----
About Tgif
Current Release & Download
FAQ
Copyright Info
A Screendump of Tgif
Release History
Tools That Tgif Uses
Tools That Work with Tgif
Author of Tgif
Miscellaneous Info
----
 
Return to Tgif's Home Page
William Chia-Wei Cheng
(bill.cheng@acm.org)

Tgif FAQ - Export & Print

Export Basics
Tgif does not have an Export command. It uses Print() from the File Menu to export. The 2nd icon in the 2nd row in the window of icons determines the export format. You can click on it with the left or right mouse buttons to cycle through available formats. What's displayed is referred as the current export format.

Certain formats may have color versions. For example, PostScript can be in colors; X11 Pixmap format can be considered to be the color version of X11 Bitmap format. To toggle between the black-and-white and color version of a format, one can select ColorPS() or BlkWhtPS() from the Layout Menu (or type <Meta><Cntrl>k). Holding down the middle mouse button when your mouse is above the 2nd icon in the 2nd row in the window of icons also gets the Layout Menu. When tgif is in the color-printing mode, the 2nd icon in the 2nd row should be the same color as the current color.

I thought the first line of an EPS file should be something like "%!PS-Adobe-3.0 EPSF-3.0". But the EPS file produced by tgif starts with just "%!". What's wrong?
If you are running tgif interactively, please use the following X default:

Tgif.UsePsAdobeString: 3.0/3.0

If you are running tgif with the "-print" command line option, please also use the "-adobe=3.0/3.0" command line option.

If you want to produce EPS file for Windows, please look at the Export Windows EPS File FAQ page.

Export GIF and Tgif.XpmToGif
To export a drawing in the GIF format, first you should set the current export format to GIF/ISMAP. If you then do a Print() from the File Menu, the content will be exported in the GIF format. Since tgif doesn't have a license to generate GIF files, it uses xpmtoppm and ppmtogif from the netpbm toolkit to generate GIF files. You can replace the default mechanism by using the Tgif.XpmToGif X resource. If you don't specify that resource, the default value of Tgif.XpmToGif is:

Tgif.XpmToGif: xpmtoppm %s | ppmtogif

It can be replaced with:

Tgif.XpmToGif: xpmtoppm %s | ppmtogif | giftrans -t gray75

to generate transparent GIFs. Giftrans is available from http://www-genome.wi.mit.edu/WWW/tools/graphics/giftrans/

What does the error message "xpmtoppm: can't open color names database - reconfigure with correct RGBDEF" mean when exporting a GIF file?
You get this error message because the machine on which xpmtoppm was compiled has a different path to rgb.txt than the machine from which you are running xpmtoppm. It's unfortunate that the hardcoded path is compiled into xpmtoppm. Rgb.txt is */lib/X11/rgb.txt under the X directory (which can also be /usr/openwin).

The simplest way to fix this is to login as root and add symbolic links so that rgb.txt can be found in the same path on different machines.

Another way to reconfigure is to recompile and reinstall the netpbm package. You can get the netpbm package from the /R5contrib directory on ftp.x.org. But if you reinstall it, that means that xpmtoppm won't work on the other machine (unless you hardcode the path to point to /usr/openwin/lib/X11/rgb.txt -- then it would work on all SUN machines -- but it may not work on HP machines).

Another way is to see the section on netpbm on tgif's home page and get the modified netpbm (netpbm-15nov1997.tar.gz). If you install that copy, you can set an RGB_DB environment variable to point to where rgb.txt is. The difference between the official netpbm and the new one and installation instructions of the new one are described in ftp://bourbon.cs.umd.edu/pub/tgif/tools/netpbm/README.15nov1997.

SetExportPixelTrim()
Because of the way tgif calculate object sizes, you may get extra pixels around a GIF file. To get rid of the extra pixels, you can use SetExportPixelTrim() from the File Menu before doing the Print(). Setting the trim to "1 2 3 4" removes 1 pixel from the left, 2 pixels form the top, 3 pixels from the right, and 4 pixels from the bottom. The value of "0 0 1 1" is a good one to try (which removes 1 pixel from the right and 1 pixel from the bottom).