Scalable Vector Graphics (SVG) - compute text size

James-Hughes

Usenet Archive
Joined
Jul 22, 2003
Messages
1
Reaction score
0
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.
 

Thomas Meinike

Usenet Archive
Joined
Jul 24, 2003
Messages
15
Reaction score
0
James-Hughes said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,802
Members
249,594
Latest member
henrywalsh

Latest Threads

Top