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 fix —
font-size="13"andfont-size="13px"now render identically (#439) preserveAspectRatio—meet,slice,none, and all alignment tokens now honoured (#448)- SVG 2 length units —
rem,vw,vh,vmin,vmax,qadded toconvertLength(#449) remuses root font-size — resolves against the root<svg>font-sizeattribute, falling back to 16 px- Optional bitmap backend —
rlpycairomoved tosvglib[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)