Making RSVG properly display text with a fractional size

674 Views Asked by At

I'm using librsvg 2.39.0 to render the following SVG file to PNG. Inkscape and Firefox render it without any issues:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="200" viewBox="0 0 20 10" version="1.1">
  <rect width="100%" height="100%" fill="#ffffff" />
  <text style="font-family: Helvetica;" stroke="none" x="7" y="5" font-size="1.6" fill="black">
    This is some text
  </text>
</svg>

However, it looks like, with librsvg, the text characters get aligned to the user coordinate grid, and the kerning is completely broken:

enter image description here

The issue can be replicated in the console by installing the librsvg2-tools package and running rsvg-convert < input.svg > output.png.

Is there something wrong with the file? The W3C validator shows it as valid. How do I teach librsvg to accept a fractional font-size in user coordinates?

1

There are 1 best solutions below

0
On

This works fine now with rsvg-convert 2.40.20