W3C home > Mailing lists > Public > www-svg@w3.org > June 2012

[www-svg] <none>

From: Dimitrios Apostolou <jimis@gmx.net>
Date: Sat, 30 Jun 2012 06:12:48 +0300 (EEST)
To: www-svg@w3.org
cc: Jeremie Patonnier <jeremie.patonnier@gmail.com>, Rick <graham.rick@gmail.com>, David Dailey <ddailey@zoominternet.net>, Francis Hemsher <fhemsher@gmail.com>, "Dr. Olaf Hoffmann" <Dr.O.Hoffmann@gmx.de>
Message-ID: <alpine.LNX.2.02.1206300358360.4288@localhost.localdomain>
Hello again, thanks for all the helpful replies. I've used some of your 
tips and have also noted some more for future improvement, especially as 
browsers implement more features!

I've temporarily put my little SVG tool at the following address in case 
you are curious:

http://teras-ics.mooo.com:8003/cgi-bin/callgrind_svg.cgi?r=4.8-20120429


David: you mentioned a good tip of keeping rects/texts inside a <g> so 
that I set coordinates only once. Since <g> doesn't have x,y attributes 
I'd have to use translate(), right? Wouldn't that mean that I wouln't be 
able to use % coords? (I use them all over the place) Would it have other 
implications?

Also textLength and lengthAdjust are fantastic, but if I understand they 
are not meant to clip text, but to squeeze it.

Olaf: Textarea is very nice, I'll certainly use it when supported! But I'd 
be happy with even simpler solution, since wrapping is an overkill for my 
needs. Ideally I'd want <text> to accepth the "width" attribute, wouldn't 
that be really simple both in understanding and in implementing? Or maybe 
textarea needs a new attribute: onlimit=wrap/clip?

Right now I restrict the text you see inside the rects by running 
getBBox() on every text, see if it fits, cut the string in half, see if it 
fits, and clear it if not. Reducing the string length char-by-char until 
it fits proved *way* too slow. For simplicity I had this to execute 
"onload" for every rect but didn't work, so I changed it to "onload" for 
the whole <svg>. I guess this is client-dependant.

Maybe there is a transformation for <g> that sets width and height for 
children elements?

That reminds me that I was trying to set the value of some attributes in 
<g>, for example rx,x,y,width,height,onmouseover so that all children 
elements inherit them. This is not doable in some other way, right? 
Especially for "rx", it seemed to me strange that I had to repeat it in 
every element, since I couldn't globally set it either with XML or CSS.

Finally, Olaf, you mention that I should use a viewbox, which indeed is 
much more friendly for all the transformations. If I do how can I set the 
SVG to use the 100% of the browser window?


Thanks in advance,
Dimitris
Received on Saturday, 30 June 2012 03:13:19 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:51 GMT