I have read and tried several threads, but I was unable to solve this problem.
I have a simple SVG file:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 289 144.94">
<defs>
<style type="text/css">
@import url('https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700');
</style>
<style type="text/css">
@import url('https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700');
</style>
<style type="text/css">.cls-11{font-size:53.58px;}
</style>
</defs>
<text class="cls-11" textLength="110" lengthAdjust="spacingAndGlyphs" transform="translate(160.98 45.54)">M2/1</text>
</svg>
But I'm unable to generate a PNG output for this SVG in Python. I have tried cairosvg, pyvips, wandpy, but all had some sort of issues. Mainly the 2 problem:
- The imported font is not loaded/not recognized.
- The lenghtAdjust parameter seems to be ignored by most of them.
It would be also acceptable for me to generate another pixel-based format from this or use another programming language/library.