XFIG User Manual - FAQ

# FAQ

## General Questions

1. Where can I get xfig/TransFig?

2. Do I need to convert old Fig files to the new version?
   (Also, can xfig and fig2dev read older Fig files?)

3. Can I edit PostScript files with xfig?

4. I can't seem to control the drawing order of objects

5. My splines are being changed somehow from version 3.1 of xfig

6. How can I install xfig in a personal directory?

## Problems when running xfig or TransFig (fig2dev)

1. I don't get any color in xfig's buttons

2. Icons in the side and bottom panels appear then disappear

3. A warning about some action not found occurs, like ``Warning: Actions not found: ModeOpenCompound''

4. An X error occurs with `X_SetClipRectangles` as the Request code, or thick line shows through arrowhead in certain orientations

5. When using LaTeX fonts in xfig I always end up with PostScript fonts

6. Arc-boxes don't appear correctly when viewing an exported PostScript file with GhostScript

7. OpenWindows sometimes loses track of xfig's icon

8. On HP machines, the capitalization of some letters in the edit text window are wrong

9. I get a ridiculous %%BoundingBox in my exported PostScript file

10. Patterns are coming out all black when viewing the exported PostScript file with ghostscript 5.50

11. I am exporting to the MetaFont format and the generated file refers to the ``grafbase.mf'' file which I don't have

## Problems when compiling xfig

1. On a DEC Alpha the compiler may complain about something like ``.mask must have pcreg from .frame set if any bits are set in .mask or .fmask'' in the file `u_bound.c`

2. `XPointer` is undefined or unknown when I compile xfig

3. On Sun machines the linker may give erroneous error messages about `_get_applicationShellWidgetClass` and `_get_wmShellWidgetClass` are undefined

4. On some HP computers, the compiler dies with bus error in the file `u_undo.c`

5. On some HP computers using native `cc` compiler there is a problem with +O3 optimization

6. On Linux, you may get errors such as ``undefined reference to `jpeg_write_scanlines' ''

## General Questions

### Where can I get xfig/TransFig?

xfig and TransFig are freeware and you can get them from several sites. See Installing xfig about this.

### Do I need to convert old Fig files to the new version?

No. Every version of xfig and TransFig (fig2dev) can read Fig files of any older version. When you load one into xfig it converts it to the latest version. When you save it again it is saved in that version.

### Can I edit PostScript files with xfig?

No, but you can ``paint'' over them with Fig objects to add annotation or other objects. Or you can convert the PostScript file into the Fig format using pstoedit and then edit the Fig file using xfig in the usual way.

### I can't seem to control the drawing order of objects

When you have two or more objects that overlap and the drawing order is important, you must set the depth of each object to guarantee the drawing order.

### My splines are being changed somehow from version 3.1 of xfig

xfig 3.2 uses a new type of spline called an X-Spline. X-splines allow the user to mix interpolation and approximation points in the same curve. More precisely, it means that an X-spline curve is neither an interpolated spline nor an approximated one, it is BOTH (the behaviour of each point is controlled by one single parameter called "shape factor").

Caveat: Because spline models of previous versions (quadratic B-splines and Bezier with hidden points) are no longer supported, curves that are present in version 3.1 and older files are automatically converted to X-splines. This translation is only an approximation process. It means that the converted curves are not exactly the same as the original ones. Though the translation usually provides almost identical curves, some hand-fitting may be needed in some pathological cases.

### How can I install xfig in a personal directory?

There are several files that you need:

`xfig`, `fig2dev`
  These files should be put in your command search path.
`CompKeyDB`
  Set the `XFIGLIBDIR` variable in the `Imakefile` to the directory you want this file to go into, or specify the file with resource ```Fig*keyFile: your_lib_area/CompKeyDB`''.
`Fig` and `Fig-color` (from the `Fig.ad` and `Fig-color.ad` files)
  Set the shell environment variable `XAPPLRESDIR` to the directory where you want these files to go.
`Doc/html`
  You must copy this whole directory (and its sub-directory) to the directory where `XFIGLIBDIR` in the Imakefile points (use `cp -r`).
`Doc/xfig-howto.pdf` and `Doc/xfig.pdf`
  You must copy these two files to to the directory where `XFIGLIBDIR` in the Imakefile points.

## Problems when running xfig or TransFig (fig2dev)

### I don't get any color in xfig's buttons

POSSIBLE CAUSE:
  You didn't install the app-defaults files correctly and/or you don't have the customization resource set.

SOLUTION:
  You should install the app-defaults files `Fig` and `Fig-color` (`Fig.ad` and `Fig-color.ad` in xfig source distribution) into the appropriate directory. You should also put the string ```*customization: -color`'' in a global resource file that gets loaded into the X server resources (`.Xdefaults`), and then restart the X server.

  Explanation: Since X11R5, there has been a general resource `*customization` which can be set to the string `-color` which tells the system to look for an app-default file with the suffix `-color` (e.g. `Fig-color`) and read that instead of the usual (`Fig`). Inside `Fig-color` is an `#include` statement to read the normal `Fig` app-default file to get everything else not pertaining to color.

### Icons in side and bottom panels appear then disappear

POSSIBLE CAUSE:
  On Linux (2.0.29 at least), the libNextaw version of the Athena Widget set (libXaw) seem to cause this problem.

SOLUTION:
  Relink with vanilla libXaw or libXaw3d.

### A warning about some action not found occurs, like ``Warning: Actions not found: ModeOpenCompound''

POSSIBLE CAUSE:
  You didn't install the current app-defaults files.

SOLUTION:
  Install the app-default files (`Fig.ad` and `Fig-color.ad`) which comes with the xfig.
  This is most easily done with ```make install`''.

### X error occurs with `X_SetClipRectangles` as the Request code, or thick line shows through arrowhead in certain orientations

POSSIBLE CAUSE:
  In X11R5 Xlib, there was a bug in the clipping algorithm.

SOLUTION:
  Switch to X11R6 or apply the following patch to `mit/lib/X/XPolyReg.c` in the X11R5 library:

      *** XPolyReg.c.orig	Tue Dec 15 12:01:22 1992
      --- XPolyReg.c	Wed Nov 15 09:41:13 1995
      ***************
      *** 402,408 ****
        	    if (numRects && pts->x == rects->x1 && pts->y == rects->y2 &&
        		pts[1].x == rects->x2 &&
        		(numRects == 1 || rects[-1].y1 != rects->y1) &&
      ! 		(!i || pts[2].y > pts[1].y)) {
        		rects->y2 = pts[1].y + 1;
        		continue;
        	    }
      --- 402,409 ----
        	    if (numRects && pts->x == rects->x1 && pts->y == rects->y2 &&
        		pts[1].x == rects->x2 &&
        		(numRects == 1 || rects[-1].y1 != rects->y1) &&
      ! 		/* Fixed version from X11 R6 */
      ! 		(i && pts[2].y > pts[1].y)) {
        		rects->y2 = pts[1].y + 1;
        		continue;
        	    }

### When using LaTeX fonts in xfig I always end up with PostScript fonts

POSSIBLE CAUSE AND SOLUTION:
  To put fonts under the control of LaTeX when generating PostScript output, you must tag the text object as ``special'' and then use Combined PostScript/LaTeX (pstex) output mode. This mode forces special text objects to be passed through to LaTeX, allowing the use of Math mode and Computer Modern fonts among other things.

### Arc-boxes don't appear correctly when viewing an exported PostScript file with GhostScript

POSSIBLE CAUSE:
  Ghostscript version 4.01 has a bug with the `arcto` operators.

SOLUTION:
  Get Ghostscript 4.03 or newer.

### OpenWindows sometimes loses track of xfig's icon

POSSIBLE CAUSE:
  Cause unknown.

SOLUTION:
  Here is a temporary kludge. Place the line:

        Fig*iconPixmap:  your_lib_area/fig.icon.X

  in your `.Xdefaults` file and copy the file `fig.icon.X` into directory `your_lib_area`.

### On HP machines, the capitalization of some letters in the edit text window are wrong

POSSIBLE CAUSE AND SOLUTION:
  Make sure that the `CompKeyDB` file has the lowercase letter definitions before the uppercase definitions. This should be the case for the `CompKeyDB` file shipped with xfig 2.1.5 and later.

### I get a ridiculous %%BoundingBox in my exported PostScript file

POSSIBLE CAUSE AND SOLUTION:
  The Solaris cc compiler version 4.2 has a bug in the optimizer. Recompile fig2dev with only -O2 or -O1 optimization.

### Patterns are coming out all black when viewing the exported PostScript file with ghostscript 5.50

POSSIBLE CAUSE AND SOLUTION:
  Ghostscript versions 5.10-5.50 have a bug which causes this to happen.
  Get a newer version of Ghostscript.

### I am exporting to the MetaFont format and the generated file refers to the ``grafbase.mf'' file which I don't have

POSSIBLE CAUSE AND SOLUTION:
  The grafbase.mf file should be on your system if you have MetaFont, but if you don't have it you can get it from ftp://ctan.tug.org/tex-archive/graphics/fig2mf/

## Problems when compiling xfig

### On a DEC Alpha the compiler may complain about something about something like ``.mask must have pcreg from .frame set if any bits are set in .mask or .fmask'' in the file `u_bound.c`

POSSIBLE CAUSE AND SOLUTION:
  Set the optimization level to `-O1` at least for that file.

### `XPointer` is undefined or unknown when I compile xfig

POSSIBLE CAUSE:
  You are probably trying to compile xfig on an old OpenWindows system which doesn't have the `XPointer` typedef.

SOLUTION:
  You will have to either upgrade to a newer version of OpenWindows or switch to the public X server from the Open Group.

### On Sun machines the linker may give erroneous error messages about `_get_applicationShellWidgetClass` and `_get_wmShellWidgetClass` are undefined

POSSIBLE CAUSE:
  It is a problem with the Sun shared libraries and the way X11 builds the shared Xmu library.

SOLUTION:
  It doesn't affect the operation of xfig and you can ignore it.

  Or you may compile with ```-Bstatic -lXmu -Bdynamic`''.

  To really solve the problem if you are using OpenWindows 3.0 (X11R4-based Xt), please contact your local Sun office and request the following patches:

           Patch i.d.      Description
           100512-02       4.1.x OpenWindows 3.0 libXt Jumbo patch
           100573-03       4.1.x OpenWindows 3.0 undefined symbols when using
      			     shared libXmu

  A source patch for use with the MIT X11R4 libraries was developed by Conrad Kimball (cek@sdc.boeing.com); it retrofits into R4 some fixes made in R5 to get around this problem. The patch is on export in [1/93] `contrib/X11R4_sunos4.1.2_patch_version3.Z`.

  The other option is to use X11R5 or X11R6.

### On some HP computers, the compiler dies with bus error in the file `u_undo.c`

POSSIBLE CAUSE:
  There is a bug in the HP compiler. This problem may occur on some HP computers, including HP 750 running HP-UX 8.05.

SOLUTION:
  Workaround the problem by adding an extra statement between two statements in `u_undo.c`:

  Original:

        undo_glue()
        {
            list_delete_compound(&objects.compounds, saved_objects.compounds);
            tail(&objects, &object_tails);

  New:

        undo_glue()
        {
            list_delete_compound(&objects.compounds, saved_objects.compounds);
        >>>	    /* HP-UX 8.05 compiler bug fix -- don't ask */
        >>>	    last_action = last_action;
            tail(&objects, &object_tails);

### On some HP computers using native `cc` compiler there is a problem with +O3 optimization

SOLUTION:
  Use `+O2` instead of `+O3` or get patch from HP for the compiler; connect to http://support.mayfield.hp.com/ and choose Patch Browsing and Downloading.

### On Linux, you may get errors such as ``undefined reference to `jpeg_write_scanlines' ''

POSSIBLE CAUSE:
  On most Linux machines, there is an old version of the JPEG library already installed, and is incompatible with xfig. xfig can't use a JPEG library older than Version 5b.

SOLUTION:
  Delete its library files (usually `/usr/local/lib/libjpeg.so` and `/usr/local/lib/libjpeg.a`) and the header file (usually `/usr/local/include/jpegdata.h`).

[ Contents | Introduction | Credits ]