github deeplook/svglib v2.0b1
svglib 2.0b1

pre-release3 hours ago

svglib 2.0b1 (2026-05-26)

⚠️ Breaking change — output sizes will differ from 1.x.

svglib now correctly maps SVG user units to ReportLab points using the standard SVG/CSS conversion factor: 1 px = 0.75 pt (96 dpi). Previous releases treated 1 user unit as 1 pt, which is 33% too large. Any SVG whose width/height or viewBox uses user units or px will produce a PDF that is 75% of its previous linear dimensions (correct physical size).

Migration — to restore 1.x dimensions:

drawing = svg2rlg("file.svg")
factor = 4 / 3   # 1 / 0.75
drawing.width  *= factor
drawing.height *= factor
drawing.scale(factor, factor)

What's new

  • px→pt coordinate fixfont-size="13" and font-size="13px" now render identically (#439)
  • preserveAspectRatiomeet, slice, none, and all alignment tokens now honoured (#448)
  • SVG 2 length unitsrem, vw, vh, vmin, vmax, q added to convertLength (#449)
  • rem uses root font-size — resolves against the root <svg> font-size attribute, falling back to 16 px
  • Optional bitmap backendrlpycairo moved to svglib[bitmaps]; PDF output no longer requires Cairo (#421)
  • Inkscape <0.92 warning — logs a warning when loading legacy 90 dpi Inkscape files (#452)
  • Nested <svg> default size — inner <svg> without explicit width/height now defaults to 100% of parent viewport (SVG 1.1 §5.1.2)

Don't miss a new svglib release

NewReleases is sending notifications on new releases.