Re: possible errata: SVG 1.1/1.2 tspan Element dx Attribute definition

> In my view whether the character data within the 'tspan' element is
> null or space it should be respected.

Space should be respected.

In Jonathan's example, preserving space or not has no effect on the 
outcome (should have no effect).  The space in question is a single 
space inside a tspan.

 > <text x='30' y='30' font-size='18px' text-anchor='middle'>
 >  <tspan x='30' dy='3.5em' font-weight='bold' fill='crimson' 
text-anchor='start'> </tspan>
 >  <tspan x='100'>$ 277</tspan>

The dy='3.5em' should be respected and "$ 277" should start at 
x='100',y='30 + 3.5em'.

'null' character or empty tspan, in this example should be ignored.

The important, and possibly not obvious, point from the dx (dy) 
definition - "If more <length>s are provided than characters, then any 
extra <length>s will have no effect on glyph positioning."

If there are zero characters, then _all_ dx <length>s are extra and have 
no effect on positioning.

 > <text x='30' y='30' font-size='18px' text-anchor='middle'>
 >  <tspan x='30' dy='2.5em' font-weight='bold' fill='crimson' 
text-anchor='start'></tspan>
 >  <tspan x='100'>$ 183</tspan>

The dy='2.5em' is ignored because there is no character which it can be 
assigned to.  The "$ 183" should start at x='100',y='30'.

Ken

On 21/07/2009 7:48 PM, ~:'' ???????????? wrote:
> is there a clear and unambiguous description for the dx Attribute in the 
> case where the XML character data within the 'tspan' element is null or 
> space?  There is currently a difference in rendering between UAs, and no 
> errata found.
> 
> The current description appears to be here:
> http://www.w3.org/TR/SVG11/text.html#TSpanElement
> but afaict this possibility is not described.
> 
> In my view whether the character data within the 'tspan' element is null 
> or space it should be respected.
> 
> the rationale being that whereas in the attached example it is probable 
> that there is a primary key column it is easy to conceive circumstances 
> where a key would not be appropriate, or the key data may currently be 
> unavailable, but one wishes to display the available data.
> 
> please cc my email address when replying.
> 
> regards
> 
> Jonathan Chetwynd
> 
> 
> 
> 
> <svg width='100%' height='100%' xmlns='http://www.w3.org/2000/svg' 
> xmlns:xlink='http://www.w3.org/1999/xlink'>
> 
>    <title>possible errata: SVG 1.1/1.2 tspan Element dx Attribute 
> definition</title>
> 
> <desc>please note that Q2 and Q3 have been replace with null and space 
> respectively</desc>
> 
>    <g id='rowGroup' transform='translate(0, 150)'>
>       <rect x='25' y='40' width='310' height='20' fill='gainsboro'/>
>       <rect x='25' y='76' width='310' height='20' fill='gainsboro'/>
> 
>       <text x='30' y='30' font-size='18px' font-weight='bold' 
> fill='crimson' text-anchor='middle'>
>          <tspan x='100'>Sales</tspan>
>          <tspan x='200'>Expenses</tspan>
>          <tspan x='300'>Net</tspan>
>       </text>
> 
>       <text x='30' y='30' font-size='18px' text-anchor='middle'>
>          <tspan x='30' dy='1.5em' font-weight='bold' fill='crimson' 
> text-anchor='start'>Q1</tspan>
>          <tspan x='100'>$ 223</tspan>
>          <tspan x='200'>$ 195</tspan>
>          <tspan x='300'>$ 28</tspan>
>       </text>
> 
>       <text x='30' y='30' font-size='18px' text-anchor='middle'>
>          <tspan x='30' dy='2.5em' font-weight='bold' fill='crimson' 
> text-anchor='start'></tspan>
>          <tspan x='100'>$ 183</tspan>
>          <tspan x='200'>$ 70</tspan>
>          <tspan x='300'>$ 113</tspan>
>       </text>
> 
>       <text x='30' y='30' font-size='18px' text-anchor='middle'>
>          <tspan x='30' dy='3.5em' font-weight='bold' fill='crimson' 
> text-anchor='start'> </tspan>
>          <tspan x='100'>$ 277</tspan>
>          <tspan x='200'>$ 88</tspan>
>          <tspan x='300'>$ 189</tspan>
>       </text>
> 
>       <text x='30' y='30' font-size='18px' text-anchor='middle'>
>          <tspan x='30' dy='4.5em' font-weight='bold' fill='crimson' 
> text-anchor='start'>Q4</tspan>
>          <tspan x='100'>$ 402</tspan>
>          <tspan x='200'>$ 133</tspan>
>          <tspan x='300'>$ 269</tspan>
>       </text>
>    </g>
> </svg>
> 
> 

Received on Tuesday, 21 July 2009 14:29:54 UTC