AffinitySvgPatcher
Patches Matplotlib-generated svg to be able to open them properly in Affinity Designer.
It can be yours simply though
pip install AffinitySvgPatcher
Usage
From python
from AffinitySvgPatcher import AffinitySvgPatcher
patcher = AffinitySvgPatcher('path/to/file.svg')
patcher.patch_svg(save = True, save_dir = 'dir/to/save', postfix = '-patched')
From command line
AffinitySvgPatcher path/to/file.svg --postfix patched --dir .
Patches
For now I have discovered the following tricks:
- in
textelements, replacefontattributes withfont-sizeandfont-family(fontis apparently ignored by AD), - in
xlink:href(which are deprecated) replacexandyattributes withtransform=translate(x y)(AD seems to ignorexoryattributes).
If more issues become known, PRs or GH issues are welcome! :)
Metadata
Release files for AffinitySvgPatcher 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| affinitysvgpatcher-1.0.0.tar.gz | 40.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| AffinitySvgPatcher-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 70.2 kB
Release files / affinitysvgpatcher-1.0.0.tar.gz
| Download URL | affinitysvgpatcher-1.0.0.tar.gz |
|---|---|
| Size | 40.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b029317621e1df89c9d609640aca2244546851e191cf619f28575d62de6cccba
|
|
BLAKE2b-256 checksum How to use checksums |
e8e20dd66d22dc2df073320f06451b8062be91420c0863490f5465f853bfb57f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / AffinitySvgPatcher-1.0.0-py3-none-any.whl
| Download URL | AffinitySvgPatcher-1.0.0-py3-none-any.whl |
|---|---|
| Size | 29.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab1de9fcf753b261e650a66f2231b197f74f6036c3b03f5b0a2a3b2f166522de
|
|
BLAKE2b-256 checksum How to use checksums |
1c2f23ccc64b0536f42bea4884bf18e3fd99d72e22a3c38d1e4c624a90532fa7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|