Skip to content

Broken text on the generated PNG badge on Linux #184

@itymchyshyn-sc

Description

@itymchyshyn-sc

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
Kozea/CairoSVG#434

The simple workaround has been suggested in Kozea/CairoSVG#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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds triageIssue needs triaging

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions