Tooling and housekeeping
- Modernized type annotations across
src/svglib/andtests/to use PEP
585 builtin generics (list[...],dict[...],tuple[...],set[...])
instead oftyping.List/Dict/Tuple/Set, and simplified a few
emptiness/membership checks (not pointsinstead oflen(points) == 0,
a set literal instead of a list forinchecks). No behavior change. - Silenced a
UserWarningfromtest_convert_pdf_pngthat came from
ReportLab's ownrenderPM.drawImage, not from svglib: it reopens a
<image>file referenced by path and converts it straight to RGB without
normalizing palette-with-transparency PNGs first, unlike svglib's own
handling of base64-embedded images. The referenced PNG (a dedicated
tRNS-chunk test fixture) still renders correctly; there was nothing to fix
in svglib's output.
Fixed
font-sizeno longer hasPX_TO_PTapplied twice. The viewport group
already carries the conversion, butString.fontSizeand the advance widths
used to position text fragments were converted to points as well. Text
therefore rendered at 0.75x the size of the geometry in the same document,
and multi-tspanruns were laid out in the wrong unit (issue #502). Both now
stay in user units, like every other coordinate below the transform.
String.fontSizein the shape tree is in user units accordingly; multiply by
the enclosing group's transform to get the rendered size.