Forum How do I...?

Kerning SVG text

fredsmith
Does Prince support kerning for svg?

eg:
<text kerning="-2" font-size="32">This text should have negative kerning</text>

The above displays correctly in Firefox & Chrome, but Prince seems to ignore the kerning attribute :?

Also tried:

<text style="letter-spacing:-2px" font-size="32">This text should have negative kerning</text>

which also has no effect.

Last thing I could think of:

<text dx="-2 -2 -2 -2 -2 -2" font-size="32">This text should have negative kerning</text>

Again this works in the browser, but not in Prince :cry:

The only other option I can think of is to turn each character into a text fragment and position each manually which will result in a horrible bloated document - not to mention that text selection will also be broken.

The default spacing for text is quite ugly - would be a shame if there was no way to bring letters closer together.
mikeday
Well spotted, I'll add all of these to the development roadmap. (The dx attribute on text elements is already supported, but seems we only apply the first value to the first character, not subsequent characters).
fredsmith
Hi,
Just wondering - has there has been any progress with this issue?

Will there be a point release that addresses this issue? Or will we have to wait for the next major version?

I am very much looking forward to kerning in SVG.

Keep up the great work guys :D
mikeday
Yes, we will address this issue in an upcoming maintenance release (eg. Prince 7.1).
fredsmith
Cool :D

Can you give an estimate of when 7.1 will be released?
mikeday
As soon as it's ready! :D

Seriously though, we'll be working on this SVG issue now, and if you need it in a hurry we may be able to provide you with an early build if the release isn't ready fast enough.
fredsmith
As soon as it's ready!


Yes of course - sorry Mike didn't want to sound pushy.

If at all possible I would be more than grateful to get an early build with this functionality included.

I totally understand if early access is not possible in which case i'll eagerly await the official 7.1
mikeday
No worries, we're impatient too! We'll let you know ASAP.
mikeday
Prince 7.1 is now available, with support for the letter-spacing and word-spacing properties in SVG, and multiple values in the dx and dy attributes. Sorry it took so long! :)