rvg
rvg copied to clipboard
Text width / inaccurate justification in SVG
This is probably not fixable, but since text is rendered in
This isn't a big problem for left-justified or even center-justified text, but right-justified text can go quite wrong. In my case, I'm trying to combine a chart label with a line callout connecting it to the data, and the label can overlap the callout as a result, e.g. (where the rectangle is the calculated bounding box)
And correctly in PNG:
This seems to be a limitation on the amount of fine control SVG gives over text rendering. One solution would be to use SVG's own text-anchor attribute - then widths would still be calculated incorrectly but at least justification would be correct. But from scanning the source it seems like the justification is already dealt with before it reaches this package - although if there is some way around this, that would be great!
In the meantime I guess the workaround, in my case, is use callouts from the left-hand side of text labels, which is calculated reliably.
Thanks
I don't have time right now but I will invest that later.
David