Created attachment 189370 [details] sample file Steps to reproduce: 1. Open attached document -> No space between the words Reproduced in Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: d8dbf35c48698e49c527d740853ce4edc4f1afa9 CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3 Locale: es-ES (es_ES.UTF-8); UI: en-US Calc: threaded
Regression introduced by: author Xisco Fauli <xiscofauli@libreoffice.org> 2022-09-21 17:25:17 +0200 committer Xisco Fauli <xiscofauli@libreoffice.org> 2022-09-21 21:04:40 +0200 commit a42f5faac7c6d4590e632cf40e3ba9eb618e6f56 (patch) tree 6f59bb79a87930d51797101669afe9b442a86ccf parent 5468a58c3244cf98341945c17db040b067c825f7 (diff) tdf#103888: Do not add a gap at the end of each text portion Bisected with: bibisect-linux64-7.5 Adding Cc: to Xisco Fauli
Created attachment 189371 [details] sample file
The space is only added when each tspan is in a different line in the svg file
This actually not a regression. The behaviour changed in the commit mentioned in comment 1
Reproduced Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 676e0527d2f31556eccae314fbb12ce204f02ec7 CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded
Created attachment 193741 [details] Some tests for spaces The attachment shows some specifics of SVG space handling. == Line 1 == <text y="1em"> <tspan xml:space="preserve" style="font-size:0.5em"> ← spaces xml:space="preserve", spaces → </tspan> </text> It has two space leading text, then a tspan of a smaller size, with xml:space="preserve", having two leading and two trailing space; and then two space trailing text. It is meant to show, how the leading/trailing space is collapsed into nothing, but the spaces in the preserved case are kept (this was already OK). The changing size of the text allows to see which spaces are used, when you select the text in browser. == Line 2 == <text y="2em"> Spaces → <tspan xml:space="preserve" style="font-size:0.5em"> ← spaces xml:space="preserve", spaces → </tspan> ← spaces</text> In this case, the leading/trailing spaces are dropped; but the spaces before/after the "preserve" span are collapsed to a *single space* (not removed!), even though the "preserve" span itself has leading/trailing spaces. == Line 3 == <text y="3em"> No space test:<tspan>span1</tspan><tspan>span2</tspan>test end </text> Here, no spaces must be inserted (this was already OK). == Line 4 == <text y="4em"> Multiline test: <tspan>span1</tspan> <tspan>span2</tspan> test end</text> This one is confusing. According to the spec [1], it must remove all whitespace characters - so in the absence of other whitespace between tspans, the expected result is identical to Line 3. However, both Chrome and FF show spaces... The patch below follows the spec, but likely, it could be changed later. == Line 5 == <text y="5em"> Line shift test: <tspan x="0" dy="1em" style="font-size:0.5em"> span1 </tspan> <tspan x="0" dy="1em" style="font-size:0.5em"> span2 </tspan> test end </text> This shows, that changing line does *not* cancel the spaces between the elements. Selecting the text "Line shift test: span1 " shows, that the space after "Line shift test:" is kept, that belongs to the first (larger) part of text, not from "span1"; the space after "span1" is small, and so on. https://gerrit.libreoffice.org/c/core/+/166239 [1] https://www.w3.org/TR/SVG11/text.html#WhiteSpace
(In reply to Mike Kaganski from comment #6) > == Line 4 == > > ... > > This one is confusing. According to the spec [1], it must remove all > whitespace characters Sorry, I meant "it must remove all *newline* characters"
FTR: relevant commits are: * a42f5faac7c6d4590e632cf40e3ba9eb618e6f56 tdf#103888: Do not add a gap at the end of each text portion (2022-09-21) * 5079e7937ef471a44dcf119dc6ae0a334d9c6adc tdf#156251: Add gap between text elements when needed (2023-07-12) * 4f656a057e2a92e2107f7820fc563498c801d7d3 svgio: handle addGap internally inside SvgCharacterNode (2023-08-10)
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6e6081b3401de3a4799953edb5cccbeadcce6a2c tdf#157103: fix SVG whitespace handling It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Verified in Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: e902fe1b8bf03f9c3747685314f4d443bcea9333 CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3 Locale: es-ES (es_ES.UTF-8); UI: en-US Calc: threaded @Mike, thanks for fixing this issue!!
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-24-2": https://git.libreoffice.org/core/commit/44b6b90080e7585e46250fb4076b210619e10bb3 tdf#157103: fix SVG whitespace handling It will be available in 24.2.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Created attachment 194590 [details] tdf#157103 SVG no space between tspan elements LO7.6.5 vs LO24.2.4.png Version: 24.2.4.2 (X86_64) / LibreOffice Community Build ID: 51a6219feb6075d9a4c46691dcfe0cd9c4fff3c2 CPU threads: 8; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win Locale: pl-PL (pl_PL); UI: en-US Calc: threaded Confirm: it's fixed.