# Getting and Installing Xfig and Fig2dev

You need the fig2dev program in addition to xfig to be complete. Xfig saves figures in its own, proprietary .fig format. The fig2dev program allows you to print and export figures. Fig2dev translates the .fig files to various languages and formats such as PostScript, png, jpeg, pstricks, tikz, etc.

Xfig and Fig2dev

- Getting Xfig and Fig2dev
- Installing Xfig
- Installing Fig2dev
- Xfig On Microsoft Windows
- Xfig On the MacIntosh
- Installing Other Software
- Installing Ghostscript's Type 1 fonts under X

Related Software

- Libraries
- Applications

## Getting Xfig and Fig2dev

You can get the sources for xfig and fig2dev from https://sourceforge.net/projects/mcj. The file xfig-full-3.2.6a.tar.xz contains the sources for both programs, xfig and fig2dev. The files xfig-3.2.6a.tar.xz and fig2dev-3.2.6a.tar.xz contain the sources for either one of xfig or fig2dev, respectively.

To unxz and untar the files, do

- `tar xJf xfig-full-3.2.6a.tar.xz`
  or
- `unxz -c xfig-full-3.2.6a.tar.xz | tar -xf -`

## Installing Xfig

This is the installation procedure of xfig. See the `README` file for more details. For information about how to use internationalization facility of xfig, see also Internationalization.

After getting the source of xfig, navigate to the directory xfig-3.2.6a.

Type `./configure; make -j; make install-strip`

The above command builds the program (-j … parallel build, compile with as many threads as possible) and installs it (install-strip … strip the debugging symbols) below `/usr/local`.

## Installing Fig2dev

Here is the installation procedure for Fig2dev. See the `README` file for details. For information about how to use internationalization facility of fig2dev, see also Internationalization.

After getting the source of fig2dev, navigate to the directory fig2dev-3.2.6a.

Type `./configure; make -j; make install-strip`

The above command builds the program (-j … parallel build, compile with as many threads as possible) and installs it (install-strip … strip the debugging symbols) below `/usr/local`.

## Xfig On Microsoft Windows

There is a version of xfig ported to run under Microsoft Windows using the Cygnus X server. See Wayne Wang's xfig for Windows, then click on "Software Tools" then "Install xfig on Windows".

Both need an X server (e.g. Hummingbird Exceed, or Cygwin/X to run. See: http://www.cygwin.com/xfree/)

## Xfig On the MacIntosh

There is a version of xfig ported to run on the MacIntosh under MacPorts. See: http:macports.org

## Installing Other Software

In addition to xfig and transfig (fig2dev). you will also need to install GhostScript and netpbm,

- xfig invokes GhostScript (the `gs` command) when displaying PostScript images, and exporting in bitmap formats (e.g. JPEG, XPM, etc).

  GhostScript must be compiled with pbmraw, ppmraw, pcx256, jpeg, and tiff24nc driver.

  GhostScript can be found at ftp://prep.ai.mit.edu/pub/gnu and its mirror sites, or at ftp.cs.wisc.edu/ghost/aladdin.

- fig2dev invokes commands in the netpbm package when exporting in some formats.

  Commands that may actually be used are: pbmtoxbm, pgmtopbm, pnmdepth, pnmscale, pnmtopng, pnmtotiff, ppmquant, ppmtoacad, ppmtogif, ppmtopcx, ppmtopgm, ppmtojpeg and ppmtoxpm.

  netpbm can be found at http://download.sourceforge.net/netpbm/ or ftp://ftp.x.org/contrib/graphics or its mirror sites in `/contrib/graphics`.
  Be sure that it includes ppmtojpeg. This may be found only in the newer releases, such as 9.0 and 9.1

## Installing Ghostscript's Type 1 fonts under X

You can use Ghostscript's high quality Type 1 fonts on your X server (and therefore in xfig). Copy the necessary files from Ghostscript's fonts directory to /usr/X11R6/lib/X11/fonts/Type1/ (or wherever your X server Type 1 fonts are).

    $ cp /usr/share/ghostscript/fonts/*l.pfb /usr/X11R6/lib/X11/fonts/Type1

Append the file `/usr/share/ghostscript/fonts/fonts.scale` to `Type1/fonts.scale`. The first line in the latter file contains is the number of fonts listed in that file. Change that number to include the additional fonts.

Now run `mkfontdir(1)` to update the font database:

    $ mkfontdir

If your operating system has the `chkfontpath` command, alternative is to add the Ghostscript font directory to the X server font path:

    chkfontpath -a /usr/share/ghostscript/fonts/fonts/

In either case, if your X-server is running already you have to tell it to reread the font databases with `xset(1)`:

    $ xset fp rehash

## Related Software

### Libraries

Xaw3d (Three-D Athena Widget) library
  If Xaw3d is used instead of normal Xaw, widgets such as buttons will have 3-D appearance. It is available from ftp://ftp.x.org/contrib/widgets and its mirror sites in `/contrib/widgets`.
XPM3 package
  This package provides facilities to handle images in XPM format. It is available from ftp://ftp.x.org/contrib/libraries and its mirror sites in `/contrib/libraries`.
JPEG library
  This package provides facilities to handle images in JPEG format. The official distribution site is ftp://ftp.uu.net/graphics/jpeg. It is also available from ftp://ftp.x.org/contrib/libraries and its mirror sites in `/contrib/libraries`.

### Related Applications

Here is a list of related applications. See also Scientific Applications on Linux (SAL) for more applications for Linux (many of them may also work on other UNIX-compatible platforms) and http://homepage.usask.ca/~ijm451/fig/ which a site maintained by Ian MacPhedran that has some other links for FIG-related applications. Also, http://www.hologuard.com/useful-resources/learning-centre/21 lists some FIG-related applications.

fig2dev (TransFig)
  fig2dev provides the facility to convert figures created with xfig into various formats. You must have fig2dev because xfig invokes it when Exporting or Printing. fig2dev is part of the TransFig package.
GhostScript
  xfig will invoke GhostScript (the `gs` command) when displaying an imported PostScript image. GhostScript is copyrighted by Aladdin Enterprises, but it is (at least older versions are) distributed under GPL, and it is available from ftp://prep.ai.mit.edu/pub/gnu and its mirror sites, or ftp.cs.wisc.edu/ghost/aladdin.
AutoTrace
  Converts bitmap to vector graphics - has a Fig file output driver. Available from http://autotrace.sourceforge.net. Written by Martin Weber.
cdraw2fig
  Converts `Cheap Draw' format to Fig format. Cheap Draw 2.0 was written by Bob Pratt and is available from the UNIXPC archives at osu-cis.
chemtool
  A chemical structure editor for X11 available from http://ruby.chemie.uni-freiburg.de/~martin/chemtool/chemtool.html that writes Fig output (and relies on transfig for anything more fancy than xbm)
figbuild
  figbuild reads xfig files (Version 3.x, tested with 3.1, 3.2) plus its own config file for heights, and generates a Radiance input file. Written by Peter Apian-Bennewitz at Fraunhofer ISE, Germany. See: http://www.ise.fhg.de/radiance/pabs-toolbox/figbuild/figbuild.html
GIMP
  A comprehensive image manipulation program, GIMP (Gnu Image Manipulation Program) is freely available from http://www.gimp.org/.
gnuplot
  gnuplot is a plotting package which can output in Fig and other formats. The official distribution site is http://www.gnuplot.info/.
grass2fig
  The GRASS GIS (Geographic Resources Analysis Support System) is an open source Geographical Information System (GIS) with raster, topological vector, image processing, and graphics production functionality that operates on various platforms through a graphical user interface and shell in the X Window System. It is released under GNU General Public License (GPL). See http://grass.itc.it/. The grass2fig program will convert a GRASS binary vector map to a Fig file.
gzip (gunzip)
  xfig will invoke gunzip when reading gzipped files. gzip (gunzip) is a product of the Free Software Foundation, and is available from ftp://prep.ai.mit.edu and its mirror sites.
hp2xx
  hp2xx can convert HP-GL files into other formats such as PostScript, LaTeX or Fig. It is available from ftp://ftp.gnu.org/gnu/hp2xx.
jfig
  jfig is a Java-based drawing program that is based on xfig. See http://tech-www.informatik.uni-hamburg.de/applets/javafig/applet.html
mifXfig
  mifXfig will convert files between MIF format (of Framemaker(TM)) and Fig format. See http://www.ida.liu.se/~vaden/teaching/m2f/ for details.
Msphinx
  A friendly package to handle satellite images.
  Main features:
    Msphinx includes two types of analysis and processing functions:
    - Functions to process the basic data geometry and projection planes.
    - Functions to manipulate and modify the graphic display and print.
  Communication capabilities:
    - Data writes from external user programs (C or Fortran) into the memory planes.
    - User-to-user data exchange (text or images).
    - User image data base visualisation.
    - Direct links to other packages:
      - Mgraph (2d and contouring plotting)
      - HDFLook (HDF read write files)
      - Xfig (Facility for Interactive Generation of figures)
      - mpeg_encode (mpeg format nimations)
  Find it at: http://loasys.univ-lille1.fr/Msphinx/Msphinx_gb.html
netpbm
  fig2dev will invoke the appropriate command from the netpbm package when exporting figures to bitmap formats. netpbm is available from ftp://ftp.x.org/contrib/applications/drawing_tools/xfig and its mirror sites or from ftp://ftp.cdrom.com/pub/X11/contrib/utilities.
pic2fig
  Convertes PIC format (used with troff, ditroff, etc) to Fig format. It is available from ftp://ftp.cs.orst.edu/localsrc/graphics or ftp://ftp.x.org/contrib/utilities and its mirror sites in `/contrib/utilities`.
plot2fig
  Converts UNIX plot format to Fig format. Available from any GNU site.
plotutils (GNU)
  includes an application for XY plotting (graph), a plot filter (plot), a Tektronix translator (tek2plot), a program for displaying font character maps (plotfont), and a library for drawing 2-D vector graphics (libplot), all of which produce output in xfig format. by Robert S. Maier <rsm@math.arizona.edu>. See: http://www.gnu.org/software/plotutils/plotutils.html
pstoedit
  pstoedit can convert PostScript files into Fig format. It is available from http://www.pstoedit.net/pstoedit.
xfigbar and xfigpie
  Two C programs to produce bar and pie charts as Fig files. Written by John Conover <john@johncon.johncon.com>, these programs are available at: http://www.johncon.com/john/archive/xfigutilities.shar.gz
xgraph
  xgraph is a plotting package which runs in X11. The version on ftp://iworks.ecn.uiowa.edu in `comp.hp` can output Fig files.
xpaint
  xpaint is a painting program which runs under X11. It is available from http://www.danbbs.dk/~torsten/xpaint and any SunSite machines such as ftp://sunsite.unc.edu/pub/Linux/apps/graphics/draw/.
xv
  xv can be used to display images in various formats and allows some editing of those images (cropping, color editing scaling/rotating etc). By default, xfig will invoke xv when the Edit Image button is pressed in the edit PICTURE object panel. xv is shareware and is available via anonymous ftp from ftp://ftp.cis.upenn.edu/pub/xv.

[ Contents | Introduction | Credits ]