Added
<textPath>is now supported: text follows the<path>named by itshref
orxlink:href, withstartOffset(a length or a percentage) and
text-anchor, and styled<tspan>children. ReportLab can't draw text along
a path, so each glyph is placed and rotated individually, at the point of the
path under its midpoint; glyphs beyond the end of the path are dropped. Only
paths of the same document can be followed, andside,method,spacing
and per-glyphdx/dy/rotateare not supported (#298, #532).- The plain
opacityproperty is now supported, as a presentation attribute,
instyleattributes and in<style>rules, including percentages. Opacity
composes down the tree, so a shape at 0.5 inside a group at 0.5 is drawn at
0.25. It is applied per shape, so overlapping shapes inside a translucent
group show through each other, and images are not affected (#109, #525,
thanks to @Pharex38). - The CSS
fontshorthand is now expanded intofont-style,font-weight,
font-sizeandfont-family, instyleattributes and in<style>rules.
Invalid shorthands are ignored (#343, #526, thanks to @Pharex38).
Removed
- Dropped support for Python 3.9 (and PyPy 3.9). pip 26.2.2, the new
minimum safe version, requires Python 3.10 or newer.requires-pythonis now
>=3.10, the 3.9 classifier is gone, and CI no longer tests 3.9 or PyPy 3.9.
Tooling and housekeeping
- CI now fails if a locked or installed dependency, or the uv binary, is below
its minimum safe version (scripts/check_min_versions.py). - CI runs the lowest supported Python, 3.10, next to 3.13, 3.15 and PyPy 3.11.
Python 3.15 is declared supported (classifier and tox). make installinstalls the dev dependency group (it used thedevextra,
which doesn't exist),make uninstallno longer passes an option that
uv pipdoesn't know, andmake test-distworks:scripts/test-dist.sh
builds the wheel and tests it in a clean virtual environment. New:
make check-versions.tests/test_basic.pyis split into modules by topic (test_paths.py,
test_text.py,test_text_path.py,test_use.py,test_gradients.py, ...).
The tests that download files carry the pytest markernetwork, so
pytest -m "not network"(ormake test-fast) skips them.tests/test_public_api.pyrecords the names, signatures and class members
ofsvglib,svglib.svglib,svglib.utilsandsvglib.fontsin
tests/public_api.json, so that restructuring the modules can't silently
change what user code can import.- The READMEs and notes in
demos/andtests/are Markdown now, and the
testing instructions describe the current uv and Makefile based workflow.
Fixed
- A
styleattribute or<style>rule whose value contains a colon or a
semicolon, such ascursor: url(http://example.com/c.cur), autoor a data
URL, no longer makessvg2rlg()fail withValueErroror truncates the
value. Declarations are now parsed withtinycss2, malformed ones are
skipped, and!importantand comments are no longer part of the value
(#527, thanks to @Pharex38). baseline-shifton text is now also read fromstyleattributes and
<style>rules, and a percentage is taken relative to the font size instead
of being used as a length in user units. A value on an enclosing<g>does
not affect the text, as the property is not inherited (#528, thanks to
@Pharex38).stroke-dasharrayvalues that SVG calls invalid (any negative length, or a
list that sums to zero) no longer produce an invalid PDF dash pattern and
raiseValueErrorwhile rendering; they give a solid line.noneno longer
relies on a swallowed exception, and an odd number of values is repeated once
to make it even, as the specification requires (#529, thanks to @Pharex38).