econchick / econchick/interrogate
Broken text on the generated PNG badge on Linux
- Dominant language
- Python
- Stars
- 676
- Forks
- 55
- PR merge metrics
- No merged PRs in 30d
Description
### Environment
- `interrogate` version(s): 1.7.0
- Operating System(s): Ubuntu 24.04
- Python version(s): 3.10.14
### Description of the bug
When generating a badge on Linux, text is broken.
### What you expected to happen
Text should be not broken.
### How to reproduce (as minimally and precisely as possible)
Run interrogate with PNG badge generation on Linux.
### Anything else we need to know?
It's a Cairo bug that hasn't been fixed for 8 years and maybe it will have never been fixed, see
https://gitlab.freedesktop.org/cairo/cairo/-/issues/152
https://github.com/Kozea/CairoSVG/issues/434
The simple workaround has been suggested in https://github.com/Kozea/CairoSVG/issues/434 , which was working for me: deleting `text-rendering="geometricPrecision"` substring from SVG before converting it to PNG helps to fix CairoSVG.
I propose to automate this workaround here. When generating PNG badge, the following steps can be conducted:
1. Generate SVG badge
2. Delete the `text-rendering="geometricPrecision"` substring from the generated SVG
3. Convert SVG to PNG
Contributor guide
Assessment
This issue has not been assessed yet.