# 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?

7. Is there a mailing list or newsgroup specifically for xfig?

## Problems when running xfig or TransFig (fig2dev)

1. When I pull up a menu, xfig crashes

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. Pattern fills 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

12. My pulldown menus don't work under CDE

13. I am getting get "mn" in my LaTeX text

14. Pattern fills are going beyond the bounds of the polygons when I export to EPS, GIF, etc., although they look fine on the screen

15. xfig says: "Warning: Representation size 4 must match superclass's to override underline"

16. fig2dev says: "can't open file: /usr/X11R6/lib/X11/fig2dev/en_US.ps" (or some other xx_xx.ps file)

17. xfig won't find the app-defaults file in my personal directory even though I have set the XAPPLRESDIR environment variable

18. I can't enter special characters such as a-umlaute in the popup editor for text objects.

19. When I enter values in the "spinner" widgets, the digits are entered in reverse order.

20. LaTeX asks for missing macro \k or the ogonek diacritic mark isn't visible.

21. Text is positioned differently when exported than it is on the screen

22. I cannot type anything into the popup dialogs in xfig when I use the fvwm window manager

23. When I start xfig I get the message: "Warning: Actions not found: StartScroll"

## 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. I'm getting errors such as:

   > Unresolved:
   > jpeg_std_error
   > jpeg_create_decompress
   > jpeg_destroy_decompress
   > jpeg_stdio_src
   > and others.

7. I am getting these errors when I am compiling xfig:

   > w_menuentry.c: In function `Redisplay':
   > w_menuentry.c:129: structure has no member named `fontset'
   > w_menuentry.c:143: structure has no member named `international'

## General Questions

1. ### Where can I get xfig/TransFig?

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

2. ### 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.

3. ### 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.

4. ### 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.

5. ### 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.

6. ### 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`".
   `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.

7. ### Is there a mailing list or newsgroup specifically for xfig?

   There are no mailing lists for xfig, but you may send email to bvsmith@lbl.gov or post questions about it to comp.windows.x, comp.windows.x.apps, comp.os.linux.x, comp.os.linux, or comp.os.linux.misc. Questions about TransFig or fig2dev may also be posted to comp.text.tex.

## Problems when running xfig or TransFig (fig2dev)

1. ### When I pull up a menu, xfig crashes

   POSSIBLE CAUSE:
     Your version of the 3D Athena Widget Set may be incompatible

   SOLUTION:
     If your vendor has installed the Xaw3D1.5E verison of the 3D Athena Widget set but has called it Xaw3D, then it is incompatible with xfig's menu widget. Fix this by uncommenting the #define XAW3D1_5E line in the Imakefile and recompiling xfig. Be sure to do:
       xmkmf
       make clean
       make install

2. ### 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.

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

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

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

4. ### 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;
           	    }

5. ### 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.

6. ### 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.

7. ### 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`.

8. ### 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.

9. ### 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.

10. ### 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.

11. ### 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/

12. ### My pulldown menus don't work under CDE

    POSSIBLE CAUSE AND SOLUTION:
      Under CDE you must turn off the Num Lock and Caps Lock keys for the pulldown menus to work.

13. ### I am getting get "mn" in my LaTeX text

    POSSIBLE CAUSE AND SOLUTION:
      The problem is in the \smash part of a command that was generated in the latex part of the export. If the `\mddefault` and `\updefault` are not set up properly on your system you need to define them to do nothing.

14. ### Pattern fills are going beyond the bounds of the polygons when I export to EPS, GIF, etc., although they look fine on the screen

    POSSIBLE CAUSE AND SOLUTION:
      Ghostscript versions 7.00 has a bug (#418928) which causes this to happen.
      Get a newer version of Ghostscript.

15. ### xfig says: "Warning: Representation size 4 must match superclass's to override underline"

    POSSIBLE CAUSE AND SOLUTION:
      The 3D menu widget (smeBSBObject) was used instead of the 2D version or vice versa (check -DXAW3D in Imakefile/Makefile)
      Don't mix the 2D and 3D widget libraries (Xaw and Xaw3d) and header files.

16. ### fig2dev says: "can't open file: /usr/X11R6/lib/X11/fig2dev/en_US.ps" (or some other xx_xx.ps file)

    POSSIBLE CAUSE AND SOLUTION:
      This seems to happen only on RedHat systems. I believe that they have enabled internationalization even when it shouldn't be, and it is looking for a non-existent font encoding file.
      Download newer versions of xfig and transfig RPMs from RedHat.

17. ### xfig won't find the app-defaults file in my personal directory even though I have set the XAPPLRESDIR environment variable

    POSSIBLE CAUSE AND SOLUTION:
      If you are using Sun's Openwindows X server you need to set a different environment variable, XUSERFILESEARCHPATH to point to your personal app-defaults directory, and append a "%N" to the path, e.g.

      > `setenv XUSERFILESEARCHPATH $HOME/app-defaults/%N`

18. ### I can't enter special characters such as a-umlaute in the popup editor for text objects.

    POSSIBLE CAUSES AND SOLUTIONS:
      1. The CompKeyDB file may not be installed. This is the file that tells xfig how to handle the multi-key sequences to produce the Latin-1 characters such as (a-umlaute), (c-cedilla), etc. You should do a `make install` to fully install xfig and its support files.
      2. Your keyboard doesn't have a "Multi_key" key. On some systems (e.g. Sun Sparcstations), there is a compose key or "Multi_key" which handles these sequences. If your keyboard doesn't have such a key you can remap another key (e.g. the "Windows" keys, known to the X server as Super_L and Super_R to the Multi_key using the xmodmap program:

         `xmodmap -e "keysym Super_L = Multi_key"
         xmodmap -e "keysym Super_R = Multi_key"`

19. ### When I enter values in the "spinner" widgets, the digits are entered in reverse order.

    POSSIBLE CAUSE AND SOLUTION:
      There is a bug in the RedHat Xaw Athena widget set. Any of the Xaw3d (3-D) Athena widget sets will work properly. Uncomment the "#define XAW3D" line in the Imakefile and recompile xfig according to the instructions in the `README` file.

20. ### LaTeX asks for missing macro \k or the ogonek diacritic mark isn't visible.

    POSSIBLE CAUSE AND SOLUTION:
      Define the macro `\def\k#1{\c{#1}}` before the `\begin{document}` directive in your LaTeX document.

21. ### Text is positioned differently when exported than it is on the screen

    POSSIBLE CAUSE AND SOLUTION:
      Your X server (screen) fonts may not be the same as the PostScript fonts that fig2dev uses when exporting. If you use the ghostscript fonts in your X server things will improve. To do this, see Installing Ghostscript's Type1 fonts under X.

22. ### I cannot type anything into the popup dialogs in xfig when I use the fvwm window manager

    POSSIBLE CAUSE AND SOLUTION:
      There have been reports of this problem when using the fvwm window manager, possibly under Cygwin. Try mwm or twm or KDE.

23. ### When I start xfig I get the message: "Warning: Actions not found: StartScroll"

    POSSIBLE CAUSE AND SOLUTION:
      When the Xaw or Xaw3d Athena widget sets are compiled with the ARROW_SCROLLBAR style of scrollbars there is no StartScroll action and you won't be able to scroll using the wheel on the mouse. If you want to be able to scroll using the wheel, you must recompile the Xaw library from sources, disabling the ARROW_SCROLLBAR option.
      From xfig version 3.2.5 on, it checks if this action exists and doesn't give the warning.

## Problems when compiling xfig

1. ### 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.

2. ### `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.

3. ### 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.

4. ### 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);

5. ### 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.

6. ### I'm getting errors such as

   Unresolved:
   jpeg_std_error
   jpeg_create_decompress
   jpeg_destroy_decompress
   jpeg_stdio_src
   and others.
   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`).

7. ### I am getting these errors when I am compiling xfig:

   > w_menuentry.c: In function `Redisplay':
   > w_menuentry.c:129: structure has no member named `fontset'
   > w_menuentry.c:143: structure has no member named `international'

   POSSIBLE CAUSE:
     You probably have an old version of the 3D Athena Widget set (Xaw3d) which doesn't have the `fontset` and `international` components, but your Intrinsics library does have those components.

   SOLUTION:
     Either get a newer version of the Xaw3d widgets from ftp://ftp.x.org/contrib/widgets/Xaw3d or use your system's 2D Athena widgets (Xaw). The latter is acheived by:
     1. commenting out the "XAWLIB = -lXaw3d" line in the Imakefile,
     2. doing a "rm w_menuentry.o",
     3. "make Makefile"
     4. "make"

     [ Contents | Introduction | Credits ]