Line Spacing as pixels

Post questions on how to use or achieve an effect in Inkscape.
foomarks
Posts: 4
Joined: Sat Dec 18, 2010 11:25 am

Line Spacing as pixels

Postby foomarks » Sat Dec 18, 2010 11:27 am

I am doing web layouts and use pixel heights to define my line-spacing (line-height) for text. Right now in Inkscape 0.48, I see that there is only a way to define this as percentages.

Is there a method/hack to define this as pixels instead?

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Line Spacing as pixels

Postby ~suv » Sat Dec 18, 2010 8:01 pm

foomarks wrote:I am doing web layouts and use pixel heights to define my line-spacing (line-height) for text. Right now in Inkscape 0.48, I see that there is only a way to define this as percentages.
Font sizes in Inkscape are defined in pixel values [1], for example:
    default font size 40, with default line spacing 125%:
    resulting line spacing = 40 px * 1.25 = 50 px
foomarks wrote:Is there a method/hack to define this as pixels instead?
AFAIK there is no hack to use absolute values (the unit is px anyway).

A possibility might be to externally edit the SVG file (using a plain-text editor) and remove the attribute 'sodipodi:linespacing' of the parent <text> object and manually adjust the y values for each <tspan>.
  • Note I: untested if this is kept if the text object is edited in Inkscape later on: initially at least Inkscape renders it correctly with the modified y-positions).
  • Note II: the y coordinates refer to the SVG origin in the upper left corner, not to Inkscape's origin as used for the GUI (rulers, controls bar).

[1] many users demand to be able to define font sizes in points (pt), but this has not been implemented (yet)

foomarks
Posts: 4
Joined: Sat Dec 18, 2010 11:25 am

Re: Line Spacing as pixels

Postby foomarks » Tue Dec 21, 2010 3:56 am

Ah ok, thanks!


Return to “Help with using Inkscape”