Sign In/My Account | View Cart  
advertisement

Article:
 Simple Text Wrapping
Subject: Firefox 1.5
Date: 2006-08-16 11:45:50
From: richbk


Hello,


Excellent article. Anyone get this working in Firefox 1.5? Anyone know of any reason why it wouldn't work in Firefox 1.5?


In the example included below I get the error:
Error: tspan.style has no properties
Source File: file:TextWrap.js
Line: 150


Thanks,
Rick


<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:text="http://xmlns.graougraou.com/svg/text/"
onload="TextWrap._init()"
>

<defs>
<script type="text/javascript" xlink:href="TextWrap.js" />
</defs>


<text:wrap x="10.5" y="47.5" width="440" style=" font-family: arial;font-size: 11px;text-rendering: optimizeLegibility;text-align: justify;line-interval: 1.5em">SVG is a language for describing two-dimensional graphics in XML. SVG allows for three types of graphic objects</text:wrap>



</svg>


Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • Firefox 1.5
    2008-05-12 05:09:14 ebbeebbe

    To make it work in Firefox 2, native SVG, you should do the following:
    - add "important" as the third argument to all setPropertyValue
    - find the line which says tspan.setAttribute('dy', i ? this._interval : '1em'); and change that into tspan.setAttribute('dy',15);


    In Firefox 2 there is also an issue with getComputedTextLength(). This will only work when the element it is called on is rendered _and_ visible. For the onload function you can make sure everything is rendered by setting a timeout: setTimeout('TextWrap._init()',1000); Firefox 3 should not have this issue anymore. See https://bugzilla.mozilla.org/show_bug.cgi?id=345635 for more info about the getComputedTextLength() issue in Firefox 2.


Sponsored By: