Text rendering order is reversed (overlap) (pdf output different)
Migrated from https://bugs.launchpad.net/inkscape/+bug/1604654 (after the fact
Steps to reproduce:
- open Inkscape
- enable SVG2 text (not necessary, but easier to explain steps)
- create two words, one on each line
- color them different colors
- set line-spacing to 0.3 lines or some small number so they overlap
- export to pdf
What happened?
the order of overlap is reversed on export to pdf.
Testfile from launchpad (correct rendering should have dark grey text with a white glow):
What should have happened?
Order should be consistent. It looks like the pdf output is the correct version (based on comparison to other svg renderers, the spec, and the reporter from launchpad)
Relevant specs: https://www.w3.org/TR/SVG/text.html#TextRenderingOrder
A ‘text’ element is rendered in one or more chunks. Each chunk (as produced by the text layout algorithm) is rendered, one after the other, in document order. Each rendered chunk, which consists of one or more glyphs, is filled and stroked as if it were a single path.
xviewer, chromium and firefox both display the svg in the same way as the pdf
Note this affects all text chunks, not tspans
An independent block of text in which all characters are positioned together. Each new absolute positioning adjustment (due to an ‘x’ or ‘y’ attribute, or forced line break) creates a new text chunk. Ligature substitution and bidi-reordering only occur within a text chunk. Text chunks are only relevant to pre-formatted text.
First noticed #602 (comment 263101061)
Inkscape Version and Operating System:
Inkscape 1.1-dev (31dae0dc, 2019-12-18), Linux Mint 19.1
Inkscape 0.92.4 (36965ca6, 2019-12-05), Linux Mint 19.1
Inkscape 0.48.5, 0.91 and trunk rev. 15028, Windows XP
development version 15002 on Windows 7