Re: SVG12: Text Layout vs Scripting

* Thomas DeWeese wrote:
>> Thus, please change the SVG 1.2 Working Draft such that it is clear that
>> calling forceRedraw() has the desired effect (text layout for all text
>> content elements in the document tree is completed and consequently the
>> text layout depended method calls such as getComputedTextLength() and
>> getBBox() work as expected) 
>
>     Please _don't_ do this!

You seem to imply that forceRedraw() currently does not necessarily
cause this and that it should not cause this. Maybe you can clarify
why you think so or what you mean instead?

>    I'd be curious how you came to this conclusion, because I just
>checked Batik and ASV and both of them behave this way (getBBox works
>on text that has been dynamically created and inserted into the
>document, before any rendering has happened).  In my mind this is the
>only reasonable solution.

With Adobe SVG Viewer 6.0 Build 38363 the following

  <svg
    xmlns               = "http://www.w3.org/2000/svg"
    version             = "1.2"
  >
  <text y = '100' font-size='50'>
    <tspan onload="alert(evt.target.getComputedTextLength())"
    >Scalable Vector Graphics</tspan>
  </text>
  </svg>

does not work reliably, especially when re-loading the document, most
of the time a computed text length of 0 will be reported. Sometimes an
accurate length is reported though, so maybe you've hit some kind of
race condition. Adobe SVG Viewer 3.0x is subject to the same problem as
far as I can tell.

>    What I think is really in need of clarification is when these
>methods _don't_ work.  To give my 2 cents I think they shouldn't work
>whenever the node is not part of the "rendering tree".  I can think
>of tree major cases where this happens:

If there are any such cases, it would of course also need to be
specified what the methods do when called in a case where they are
required not to work, like throwing an exception.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Wednesday, 12 January 2005 09:33:49 UTC