https://bugs.documentfoundation.org/show_bug.cgi?id=157103

Mike Kaganski <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|[email protected] |[email protected]
                   |desktop.org                 |
             Status|NEW                         |ASSIGNED

--- Comment #6 from Mike Kaganski <[email protected]> ---
Created attachment 193741
  --> https://bugs.documentfoundation.org/attachment.cgi?id=193741&action=edit
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

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to