Menu

#110 1200 dpi != 450 dots per cm

xfig
wont-fix
nobody
None
2020-11-25
2020-11-24
No

Internally, Xfig uses Fig units. The documentation shows that there are 1200 fig units in an inch, i.e. 2.54 cm. That corresponds to 472.441 fig units/cm. Xfig can be configured to use the metric (cm) system, and writes the data using fig units. However, in this configuration, Xfig uses 450 fig units/cm.

This has the result that a line piece of 2.54 cm is written to file with a length of 1143 fig units, where it should be 1200.

I am using Xfig 3.2.7b.

Discussion

  • tkl

    tkl - 2020-11-24

    That was a design decision, long ago, to keep an integer resolution in metric mode, and scale the resulting figure to make up for the difference. See the specification in doc/FORMAT3.2 of the fig format, quoted further below. Third party programs, unfortunately, usually do not get this scaling right. This is the reason I would recommend to always use imperial mode.

    Note about metric units: To preserve a regular grid on the canvas the
    centimeter is defined to be 450 Fig units and not 472.4 (1200/2.54).
    For drawings done in metric units, fig2dev magnifies the output when
    exporting or printing to compensate for the difference (472.4/450).
    Also, if you make a drawing in one unit scale and switch to the other
    units in xfig, the drawing will be rescaled on the screen by xfig to
    remain consistent.

     
  • tkl

    tkl - 2020-11-24
    • status: open --> wont-fix
     
  • Marten Jan de Ruiter

    Thanks! Shows that the behaviour is as intended, and even documented.
    I have found the quotation in the documentation in the source.

    Also, the xfig online documentation, http://mcj.sourceforge.net/frm_miscellaneous.html, and the html documentation installed lack this paragraph. There, I found the 1200 dpi, hence why I did not find it before. I read that xfig writes 1200 dpi only. Tinkering around showed that it respects the resolution while reading :-)

    Using the format, I found a work-around to convert a metric fig file to imperial:

    • Change the fourth line from "Metric" to "Inches"
    • Change the ninth line from "1200 2" to "1143 3"
      since 2.54 * 450 = 1143.
    • Open the file using xfig.

    There is still an offset of 15 coming from somewhere, but at least a line of 25.4 cm becomes 10 inches, as I intended ;-)

     

Log in to post a comment.