Hacker News new | ask | show | jobs
Xfig (mcj.sourceforge.net)
85 points by jabajabadu 1519 days ago
11 comments

I used to often reach for xfig for a quick tech diagram (boxes, circles, lines, etc). The "fig" file format, being text, is easy to drop into source control. It's fast and gets the job done. The feeling I get from peers, especially those who've never understood that unix/linux on desktop has long been a thing or really lived that far out of the Win32/MacOS ecosystem, look at you sideways when the file extension isn't .docx, or .ppt or whatever. Maybe SVG supplants fig in all the ways, but I still hope tools like xfig keep their place for quite some time.
> The "fig" file format, being text, is easy to drop into source control.

Yes, and using transfig it can be transformed into whatever format you need. So, for instance, you can have a complete LaTeX document with .fig figures (and a Makefile to "compile" everything) in a repository.

By the way, like Ipe mentioned in another comment, it is possible to use TeX formatting in xfig and the .fig format (using the "special" attribute) to produce some especially nice figures for scientific documents.

As someone who used xfig a lot, I have to say that Inkscape is a good successor, so I only look back for nostalgic reasons such as now.
The simple text format also makes it somewhat scriptable, so you could make more complex figures than you could make with a mouse, without learning Postscript.
What are fig advantages over SVG though?
SVG wasn't an option at the time. Now, support for TeX labels might still be an advantage. These days I just use PGF/TikZ.
Then there's Dia with more focus on the tech diagrams.
I guess xfig could be considered modern when twm was young, and I was playing with IBM X Windows thin clients on our university lab.
Well, xfig does its job well without getting in the way (like for example the new MS Visio). And twm was looking old some 20 years ago. Now, compared with Windows 10, it looks modern.
I can't wait for skeuomorphism to come back
Really awesome tool, especially "back in the days". Another great tool that I used for similar tasks, with a similarly appealing user interface and also a website that most likely works best in Netscape Navigator, is tgif: http://bourbon.usc.edu/tgif/index.html

TIL: tgif files are Prolog

I just used Xfig to make a diagram yesterday. There are other things out there but it was easy to learn and seems to work well enough. I just export to SVG when I am done.
I used xfig back in the day, but it always felt more like the tool I had than the one I wanted. It’s been a long while since I tried inkscape - I remember it more as a took for artists than for technical drawings.

These days my go to tool for technical diagrams is draw.io (aka diagrams.net). I tend to use the standalone version but appreciate that it’s available online with low friction and as a confluence plugin. Perhaps my favorite part is that you can create png files that are viewable anywhere but are also editable due to the source file being embedded in the png.

It looked vintage even in the nineties
Even in 1990. :) But, on Unix workstations in 1990, you'd still occasionally run an Xaw program, and Xfig was obviously a step or two above that. Xfig looked opinionated in a really advanced 1980s way.

I still occasionally used Xfig, over the years, when I needed to draw a diagram, and the other options readily available on whatever Unix/Linux box were garbage. Xfig somehow kept working.

And this not exaggerated :)

It always looked like running on open/blackbox with no further dependencies installed.

So here is my figure drawing exercise: draw a ruler. This is easy to do with xfig. On many tools, it's hopeless, open office draw comes to mind.
It is much easier to draw in Inkscape. As an example, you can draw a curve and add the "Ruler" Live Path Effect.
Even without that effect it's easy with Inkscape. It has working grid, snap to grid and text alignments.
That won't be useful for arbitrary curves (non straight lines)
Agreed, but just try even a linear ruler in most drawing tools to see how hopeless they are.
With macOS making it harder and harder to run X11 programs—I don't even know how, these days—is there anything that allows you to run an Xfig-alike on macOS? (I've seen recommendations for Inkscape, and I'll give it a try, but I was really practiced with Xfig and would like to be able to draw on that muscle memory if possible.)
XQuartz still exists and is still being updated, and you can either download and install it via an installer or install it via a package manager like MacPorts or Homebrew. It works just fine.

Things aren’t any harder now than they were when X11 was first unbundled and became XQuartz.

I'd love if Inkscape implemented Xfig technical drawing features.
So, I've had inkscape (1.0.2-4 on up to date debian testing) crash on me so many times in the last week, in ways that cost me several minutes of work each time. So I've stopped using it for anything.

I appreciate the exhausting amount of work that goes into something like Inkscape, but holy crap. Segfaulting on me. Or leaving a foregrounded window open with no content in it that I can't close and that blocks the rest of the program until I kill -9 it. Very frustrating when I was trying to get real work done.

You're using an old version. there were 3 release after that (1.1, 1.1.1, and 1.1.2).

The 1.2 release is expected in a few days (and it has many features with a ton of bug fixes).

This is not a reason to crash. Last i looked, fvwm 1.24 runed just fine.
I have tried Inkscape a few times over the years, but the extreme instability kept me from adopting it for regular use.
Nowadays Inkscape is really getting better. I rarely encounter any crashes (on Linux or Windows).
Could you mention some CAD features that are available in Xfig but are missing in Inkscape?
Arc from 3 points, add tangent/normal to a curve on a determined point, measure length of polylines and splines, measure area of polygons arcs and ellipses, measure angles, library of elements, all the 8 snapping modes and indication of what each mouse button will do.
* Arc from 3 points: There is a Live Path Effect for that.

* tangent/normal to a curve: there is an experimental Live Path Effect for tangent (You can get the normal by just rotating the tangent 90 degrees)

* Measure length: Many ways to get that: e.g. the measure tool. or you can use the Measure segments Live Path Effect.

* Measuring the area: There is an extension: Extensions > Visualize Path > Measure Path.

* Measuring angles: again, you can use the measure tool.

* Library of elements: Inkscape has symbols Objects > Symbols. You can also add you own symbols. See also https://github.com/PanderMusubi/inkscape-open-symbols

* Inkscape snapping is way better (See the new smart alignement snapping in version 1.2).

* Inkscape also prints instructions on how to use tools on the status bar

Nice! So, I think the UI must make these features more obvious.

Another thing I miss in inkscape (in case you know): I sometimes did some very interesting interactive live geometric demonstrations with Kig. Had inkscape had the same features, I'd use it.

Sorry, I don't know anything about Kig. It seems that it is similar to GeoGebra?

Anyway. You may find this post interesting: https://castel.dev/post/lecture-notes-2/

I am just curious to know. You need to know how to do that in Inkscape or just for the sake of sharing the link?
Yes, this.

Also, I wrote a small library that lets me programmatically generate SVGs with Python. This lets me create very precise vector images. This fills some of the same needs.

There you go, 2d openscad. I want that.
What I really want: wings2d.
This tool has been very helpful for me in situations where I need to create professional-looking diagrams for papers yet I have no access to OmniGraffle or Visio, especially during my student days when I couldn't afford licenses for those tools.
Awesome that Xfig still around. I used Xfig for the illustrations to my master's thesis back in the day when Inkscape was new, because it felt like Inkscape is trying to make precise alignment difficult on purpose. It still feels the same.
I've used it for things like exactly like you say where you need specific/explicit alignment that you can define in numbers, but like some kind of sweet spot between freehand and cad.

Recently I used it to lay out a cut path for a sheet of material that goes under the keyboard of a vintage computer.

It was just the right amount of quick vs capable for a job like that. The drawing is 90% repetitions of a few objects (like one key shape), and regular alignment of multiple copies of those objects (keys in a row) in array groups (the F keys, the #,Q,A,Z rows, the arrow keys, etc), and regular alignment of groups with other groups (vertical spacing of the rows), with a little bit of arbitrary positioning (horizontal offset of the A row from the Q row, etc).

I don't remember what difficulty I exactly ran into, but I tried inkscape and qcad and somehow neither made it obvious how to attain the result I wanted, but I popped it right out in xfig with only a little fumbling around.

And now that definition is an accessible document. xfig is a small program and of course free & open source, so it's likely always going to be available, but the file is also usable directly if needed, even if it's so far in the future that xfig would require a lot of work to set up some vm just to run it. That must be why I didn't use a 2d sketch in freecad.