Scalable Vector Graphics (SVG) - compute text size

Discussion in 'XML' started by James-Hughes, Jul 22, 2003.

  1. James-Hughes

    James-Hughes Guest

    I am currently working on a .Net assembly (C#) to dynamically generate
    an SVG in the form of a bar chart. I am having a problem drawing the
    legend based upon dynamic data being passed to my class. When I am
    drawing the legend, I need to determine which item is the longest and
    make the legend at least that wide. What I would like to do is
    determine the height and width of a piece of text based upon a
    selected font and size. Does anyone have any code to do this or know
    of where I can go for more information.
     
    James-Hughes, Jul 22, 2003
    #1
    1. Advertising

  2. James-Hughes wrote:

    >I am currently working on a .Net assembly (C#) to dynamically generate
    >an SVG in the form of a bar chart. I am having a problem drawing the
    >legend based upon dynamic data being passed to my class. When I am
    >drawing the legend, I need to determine which item is the longest and
    >make the legend at least that wide.


    Use the method getComputedTextLength(), see for example:
    <http://www.datenverdrahten.de/svglbc/?code=textinformationen>
    <http://www.datenverdrahten.de/svglbc/?code=tooltip>

    cu, Thomas
    --
    SVG - Learning By Coding
    <http://www.datenverdrahten.de/svglbc/>
     
    Thomas Meinike, Jul 24, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ilya
    Replies:
    9
    Views:
    1,830
  2. Arne Nordmann
    Replies:
    0
    Views:
    542
    Arne Nordmann
    Jun 28, 2004
  3. RC
    Replies:
    1
    Views:
    908
    Bjoern Hoehrmann
    Aug 3, 2006
  4. Replies:
    8
    Views:
    1,960
    Csaba
    Feb 18, 2006
  5. PerlFAQ Server
    Replies:
    0
    Views:
    275
    PerlFAQ Server
    Feb 2, 2011
Loading...

Share This Page