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 Units In Inkscape - Inkscape Wiki, 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”