The Great Dimensions Debate

I’ve seen a number of posts talking about 20x12 artboards vs. 5:3 artboard aspect ratios and how the GFUI deals with them. I’ve also seen discussions about differences in Inkscape DPI resolutions, and assumptions that GFUI defaults to 96 DPI. Yet I’d noticed during my experiments with Illustrator that using the Glowforge-endorsed “Save As…” methods, the SVG dimensions default to points (1/72nd inch).

So I decided to experiment with different options and see how they are interpreted by the Glowforge.

Inkscape

All of the Inkscape discussion is based on “Save As…” using plain SVG output as recommended by Glowforge. I am using Inkscape version 0.92.2, Windows, 64-bit.

Sizing In Real-World Units

As far as I can tell, Inkscape always includes a Viewbox attribute along with width and height values. At first I did not see how it was possible to get an Inkscape-produced file that would be interpreted incorrectly. Then I found the one document setting that would cause this.

In File->Document Properties, there are two units selectors with the following selections:

  • mm = millimeters
  • pc = picas (12 points = 1/6") Note: this is the graphic arts definition of pica vs. the typewriter definition meaning 10 characters per inch.
  • pt = points (1/72")
  • in = inches
  • cm = centimeters
  • px = Pixels

The selectors affect different aspects of Inkscape:

  • Display units changes the units to show in the Inkscape user interface
  • Custom Size Units affects how the document width and height are defined.

If the Document’s Custom Size is specified in pixels (px), then it assumes 96DPI by default. According to this WIKI http://wiki.inkscape.org/wiki/index.php/Units_In_Inkscape, the default was 90DPI in pre-0.91 versions.

Because of this conflict, SVG files saved by early versions of Inkscape using Pixel dimensions will cause their images to load at 90/96 or 93.75% of the size they were designed at.

Note: the internal units in the Inkscape engine is always 1/90" per unit–but that has no relevance to any UI or exported values.

Aspect Ratio

The behavior of the GFUI did not change between using a standard sizing like 8.5" x 11" vs 5:3 aspect ratio document sizes. I tried 5"x3" and 20"x12" with size specified in inches and pixels. Everything loaded with positions relative to the top-left corner of the document placed relative to the top-left corner of the printable area displayed in the GFUI.

Version Differences in Inkscape

I think one area that will continue to plague people is the use of SVGs created by Inkscape prior to Version 0.91 and sized in Pixel units. These will be sized using the then-default 90DPI.

The easiest way to “fix” these files is to recompute the width, height, and Viewbox values so that the User Values in the file are set to 90 units per inch. (See SVG User Units at the end of this post)

Adobe Illustrator

Adobe Illustrator CC version 22.0.1, 64-bit Windows

Save As… Sizes in Points

Using the Glowforge-recommended Save As… in Illustrator with the correct options set in the SVG output (Not responsive, in particular) saves the SVG using width and height values expressed in pixels (px) just like Inkscape does if you specify the document size in pixels. However, these pixels are mapped to 72DPI instead of 96DPI. I have not found an option that will result in width and height being stored in inches in the SVG using Save As.

However, just as the Inkscape documents loaded correctly into the GFUI at 96DPI, so do the Illustrator files load correctly with 72DPI. They’re both SVGs. Why the difference, you may ask?

The Illustrator-created file has this comment immediately before the opening <SVG> tag:

<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->

Removing that comment from the SVG file causes it to be interpreted at 96DPI instead. So detecting this comment is a workaround that Glowforge has implemented in their parsing of Illustrator files.

5:3 Ratio Ineffective

Changing the artboard to 5"x3" had no effect on how the file loaded. If the file had the comment in place, it loaded correctly, interpreted as 72DPI. If I removed the comment, it loaded at 96DPI, thus at 75% of the created size.

20" x 12" Artboard Ineffective

Likewise, setting the artboard size to 20"x12" had no effect.

Export

Glowforge does not recommend using the Export function of Illustrator. Prior experiments with it did indicate that the size was correctly set in physical units, so I wanted to explore it here.

NOTE: This is a very cursory test and there may well be things that do not work properly with the Glowforge using this method. This is only exploring the sizing of a simple rectangle.

Crops to Minimum Bounds

Export As… computes the minimum bounding rectangle for the objects on the artboard and then uses that minimal bounding rectangle as the width and height. It does use the units requested for specifying those dimensions.

It also uses the Viewbox attribute to map the User Units to points. Thus, all of the object sizes and positions are expressed in points (1/72").

Because it determines this minimal bounding rectangle as the document size, this format loses placement accuracy that all of the other methods above provide. In order to get accurate placement in this manner, it is necessary to place a no-fill, no-stroke rectangle encompasing the entire artboard (positioned at 0,0 and having width and height equal to the artboard desired–or at least extending past all other objects). Such a bounding rectangle with no stroke or fill will not show up in the GFUI, but it does provide the positioning origin for the other objects.

Because of the loss of positioning without going through extra work, I concur with the Glowforge recommendation to not use Export As from Illustrator. However, it does appear that the relative sizes will be correctly interpreted.

SVG User Units

Most coordinates in the SVG files are specified in User Units. These are arbitrary dimensions created from the ratio of the width and height dimensions in relation to the Viewbox dimensions.

The User Units for Inkscape V0.91+ files is 96 units per inch. For earlier Inkscape versions it is 90 units per inch. For Illustrator, the User Units are 72 units per inch.

Therefore, the simplest way of achieving this is to simply define a 1" square with the appropriate viewbox. The viewbox does not constrain the drawing, so it doesn’t matter that the design is larger than 1" square. Simply replace the width, height, and viewBox attributes of the <svg> element with these values:

  • Illustrator: width=“1in” height=“1in” viewBox=“0 0 72 72”
  • Early Inkscape: width=“1in” height=“1in” viewBox=“0 0 90 90”
  • Inkscape V0.91+: width=“1in” height=“1in” viewBox=“0 0 96 96”
19 Likes

Excellent write up. Definitely filled in some gaps for me.

Nice work. I think it’s valuable to have a feel for what’s happening under the hood, and I wish GF would just tell us some of this information. Dan did mention they detect the Illustrator “Save As” comment once, which cleared up some of the confusion I had around why they were recommending it. The other issue I’m aware of is that Export had a tendency to create files with questionable Lovecraftian geometry (e.g. zero-radius arcs) that crashed the GF renderer and unleashed ancient horrors upon the land. Newer versions appear to lack this feature.

This is not entirely accurate. You can choose to export the artboard(s) or just the objects on it. I’m not near a computer now so I don’t have the exact names of the options in front of me, but’s something like All vs Document in the export dialog. If I remember correctly, there’s also a “use artboards” checkbox somewhere, perhaps in Save As, that affects the results. There are so many different options in this programs, it’s not surprising that people are seeing different behavior.

Personally I’m ok with Export because I don’t usually want to have my SVG files positioned on an artboard. I load them into the GFUI and position them visually based on whatever bits of material I have available. But there’s at least the option for special occasions.

Also, regarding the 20x12/5:3 situation: I was playing with this the other day because someone mentioned the software EazyDraw. I discovered that it is very picky about triggering the workaround. I have another post on the forum with an example SVG that does it. In this case, I had to edit the file to set the width and height attributes to “100%”, and then it suddenly snapped to 20x12. So I think this is less of a general-purpose feature than a workaround for Affinity Designer.

7 Likes

This is a great resource you’ve created. Thank you!

I wonder what part of that opening comment is important to the GF parser. Apparently, I can use an earlier version of Illustrator (CS6) and it still works. My SVG file says:

< !-- Generator: Adobe Illustrator 16.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) – >

Maybe it only needs to see “Generator: Adobe Illustrator.”

Using “Export As” it’s important to check the “Use Artboards” box on the bottom of the dialog.

If you’re using Export for Screens (which I use almost exclusively since I can output multiple artboards to individual SVGs), you’ll want to use the Artboards tab (which it defaults to) rather than the Assets tab.

2 Likes

It probably uses a subset. If different versions behaved sufficiently differently, they could parse the version and deal with those differences—but I doubt they need to do that.

I checked on this at the office: some time ago (I don’t know when), we started putting ALL artboards in the top-left, not just 20x12 artboards. So the old advice about 20x12 being a magic artboard size is no longer correct, as you observe in your post.

Thank you for the great writeup!

Snortle.

1 Like