Comment 8 for bug 1084612

Revision history for this message
David Mathog (mathog) wrote :

The "line-height" property is described here:

http://www.w3.org/TR/SVG/text.html

in part with:

  The ‘line-height’ property has no effect on text layout in SVG.

That seems to be the case for all of the tested browsers and LO Draw. However line-height definitely has an effect on text layout in inkscape, as demonstrated in the attached svg file. Dump.svg was made to be read into inkscape and be editable once inside - which works as desired. (Load it into inkscape and then edit one of the paragraphs. The red text under the black shows the positions of the separate text elements from which the black text was reassembled.) But it looks absolutely horrible in browsers. It isn't obvious here, but the the line-height property between two successive lines of inkscape text (in <tspan>'s within the same <text> is

  (baseline[i+1] - baseline[i])/ font_size * (descender[i]/max_font_size_in_line(i) + ascender[i+1]/max_font_size_in_line(i+1))

When the largest font in each line is the same the denominator simplifies to just "font_size". In the attached example line-height controls line spacing, in inkscape, but that works not at all elsewhere.

This all came up in the context of text reassembly from EMF files. The text reassembly part is working well, but the SVG that Inkscape wants to see isn't what anything else wants to see, apparently. I really need to know an SVG syntax that inkscape will be able to edit properly, which other programs can also display as intended!