Loading ...
Sorry, an error occurred while loading the content.

Re: text defines document size

Expand Messages
  • domenico_strazzullo
    ... Hi Tristan, Yes, there are several ways, depending on the kind of formatting you re using. One of the simplest can be: myWidth =
    Message 1 of 3 , Feb 24 3:38 PM
    • 0 Attachment
      --- In svg-developers@yahoogroups.com, "drthmlyons"
      <tristan.lyons@...> wrote:
      >
      > I'm attempting to create an SVG document where the text in the
      > document defines the documents size, rather than a declaration like
      > <svg width="450" height="500"...
      >
      > So that just by changing the text, I get documents of different size.
      > Is such a thing possible?
      >
      > Thanks,
      > Tristan
      >


      Hi Tristan,

      Yes, there are several ways, depending on the kind of formatting
      you're using. One of the simplest can be:

      myWidth = Math.max(getComputedTextLength() of <text> element's
      children array)

      myHeigth = <text> element's children.length * dy (if consistent) +
      someExtraRoom

      setAttribute on the svg element

      To be more accurate you would probably take into account other
      parameters.

      Domenico
    • Tristan Lyons
      Thanks Domenico. I m going to give this a try. Tristan ... [Non-text portions of this message have been removed]
      Message 2 of 3 , Feb 27 5:06 AM
      • 0 Attachment
        Thanks Domenico. I'm going to give this a try.

        Tristan

        On 2/24/06, domenico_strazzullo <nst@...> wrote:
        >
        > --- In svg-developers@yahoogroups.com, "drthmlyons"
        > <tristan.lyons@...> wrote:
        > >
        > > I'm attempting to create an SVG document where the text in the
        > > document defines the documents size, rather than a declaration like
        > > <svg width="450" height="500"...
        > >
        > > So that just by changing the text, I get documents of different size.
        > > Is such a thing possible?
        > >
        > > Thanks,
        > > Tristan
        > >
        >
        >
        > Hi Tristan,
        >
        > Yes, there are several ways, depending on the kind of formatting
        > you're using. One of the simplest can be:
        >
        > myWidth = Math.max(getComputedTextLength() of <text> element's
        > children array)
        >
        > myHeigth = <text> element's children.length * dy (if consistent) +
        > someExtraRoom
        >
        > setAttribute on the svg element
        >
        > To be more accurate you would probably take into account other
        > parameters.
        >
        > Domenico
        >
        >
        >
        >
        >
        >
        > -----
        > To unsubscribe send a message to:
        > svg-developers-unsubscribe@yahoogroups.com
        > -or-
        > visit http://groups.yahoo.com/group/svg-developers and click "edit my
        > membership"
        > ----
        >
        >
        >
        > SPONSORED LINKS
        > Xml format<http://groups.yahoo.com/gads?t=ms&k=Xml+format&w1=Xml+format&w2=Svg&w3=Data&c=3&s=35&.sig=u8RdjEjLCbPTzkUjsFG_JA>
        > Svg<http://groups.yahoo.com/gads?t=ms&k=Svg&w1=Xml+format&w2=Svg&w3=Data&c=3&s=35&.sig=BrpyGiBcZ6vcQXDJ7ktaiw>
        > Data<http://groups.yahoo.com/gads?t=ms&k=Data&w1=Xml+format&w2=Svg&w3=Data&c=3&s=35&.sig=CrK_fWaLZ-AZKa5FK8rTGA>
        > ------------------------------
        > YAHOO! GROUPS LINKS
        >
        >
        > - Visit your group "svg-developers<http://groups.yahoo.com/group/svg-developers>"
        > on the web.
        >
        > - To unsubscribe from this group, send an email to:
        > svg-developers-unsubscribe@yahoogroups.com<svg-developers-unsubscribe@yahoogroups.com?subject=Unsubscribe>
        >
        > - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
        > Service <http://docs.yahoo.com/info/terms/>.
        >
        >
        > ------------------------------
        >


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.