You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A unitless SVG width is taken as points when exporting to PDF #9765
An SVG whose width and height have no unit should be read as CSS pixels (1 px = 0.75 pt). VectorCraft sizes the PDF page in points, so the page comes out a third too large.
With width="4in" all three agree (288 x 216 pt). In the other direction, convert of a 300 pt PDF page to SVG writes width="300", which viewers show at 0.75 of the size. Related: #11, #3359.
Found while comparing the Craft apps with other open-source tools on Linux (CachyOS, native package), using synthetic test files only. Drafted with Claude Code; the repro above was re-run on the stated version before posting.
Correction after reading the code: this is by design, not a bug. RootUnits in crates/svg/src/import/layers.rs documents that a pixel and a unitless user unit are a point ("as we export"), with absolute root sizes kept physical and the mixed case handled in #1010. That matches a 72 ppi convention, where rsvg, Inkscape and browsers use CSS pixels at 96 per inch, hence the 4/3 difference I measured. Unless an option for 96 ppi CSS pixels is wanted, please feel free to close this; sorry for the noise.
Activity
stratosjl commentedon Nov 27, 2026
Correction after reading the code: this is by design, not a bug.
RootUnitsincrates/svg/src/import/layers.rsdocuments that a pixel and a unitless user unit are a point ("as we export"), with absolute root sizes kept physical and the mixed case handled in #1010. That matches a 72 ppi convention, where rsvg, Inkscape and browsers use CSS pixels at 96 per inch, hence the 4/3 difference I measured. Unless an option for 96 ppi CSS pixels is wanted, please feel free to close this; sorry for the noise.