Thanks Peter, 

That looks good for what I asked for. But unfortunately I also want some lines 
to remain the same 
width under scaling.

So I've gone ahead and excluded the relevant texts and lines from the scaled 
group, then computed 
and assigned their required new coordinates after every scale operation. 
Laborious, but it seems to 
be the only way - but I'm a relative newby at SVG, so maybe someone knows a 
better way.

The problem is that it isn't possible to exclude the font size or stroke-width 
from scaling operations 
in SVG.

George

--- In [email protected], Peter Thompson <[EMAIL PROTECTED]> wrote:
>
> Does this do what you want?
> 
> <?xml version="1.0"?>
> <svg xmlns="http://www.w3.org/2000/svg"; width="100%" height="100%">
>     <circle cx="50" cy="200" r="2" stroke="green" stroke-width="1" 
> fill="green"/>
>     <g id="Labels" transform="translate(50,200)"  font-size="20pt" fill="red">
>         <text>Text scales, but doesn't change font size.</text>
>     </g>
> <script>
> <![CDATA[
> function SyncUI()
> {
>     var root = document.rootElement;
>     var scaleUI = 1/parseFloat(root.currentScale);
>     var obj = document.getElementById("Labels");
>     obj.setAttribute("font-size", (20 * scaleUI) + "pt");
> }
> document.rootElement.addEventListener( "SVGScroll", SyncUI, false );
> document.rootElement.addEventListener( "SVGResize", SyncUI, false );
> document.rootElement.addEventListener( "SVGZoom", SyncUI, false );
> SyncUI();
> // ]]>
> </script>
> </svg>
> 
> --- On Sun, 9/7/08, gfc22 <[EMAIL PROTECTED]> wrote:
> From: gfc22 <[EMAIL PROTECTED]>
> Subject: [svg-developers] Non-scalable text labels in scalable graphics?
> To: [email protected]
> Date: Sunday, September 7, 2008, 8:48 AM
> 
> I expect this is a FAQ, but Google doesn't offer anything relevant:
> 
>  I have text labels in scalable SVG groups. I want the positions of the 
> labels to scale with the 
>  other elements but not their text size. This must be a common requirement. 
> Suggestions 
>  welcome.
> 
>  George
> 
>             
> 
> 
>       
> 
> [Non-text portions of this message have been removed]
>




------------------------------------

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
----Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to