W3C home > Mailing lists > Public > www-svg@w3.org > January 2004

Geographical Coordinate Systems and textPath

From: Greg Sepesi <sepesi@eduneer.com>
Date: Wed, 28 Jan 2004 14:15:53 -0500
Message-ID: <40180A69.E01BB7DA@eduneer.com>
To: www-svg@w3.org

Greetings,

Chapter 7.12 of the SVG 1.1 Specification suggests the use of scale with
geographical coordinates, however it doesn't mention how to avoid the
following undesirable effects on textPath due to scale:  

1) scale(1,-1) used to get a coordinate system with North up, changes
the reference orientation and all the subsequent textPath text appears
upside down, and

2) scale(sx,1) used in the very common cylindrical equidistant
projection (i.e., scaling longitude by sx = cosine(latitude)), skews the
reference orientation so that subsequent textPath glyphs are not normal
to the path.

The following test document defines a rectangle and its two diagonal
lines.  It shows both undesirable effects.

- - -

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<svg viewBox="-50 15 10 5"
    preserveAspectRatio="xMidYMid"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink">

    <title>test7</title>
		<desc>scale and translate x; reverse and translate y</desc>

    <defs>
        <style type="text/css">
            <![CDATA[
            .TestLine { fill:none; stroke:black; stroke-width:2 }
            .TestFont { font-size:0.75; font-family:Verdana;
stroke:blue; stroke-width:0.05; fill:none; }
            ]]>
        </style>

        <path id="diagUL_LR" d="M -50 20 L -40 15"/>
        <path id="diagLL_UR" d="M -50 15 L -40 20"/>
    </defs>

    <g transform="translate(-45,0) scale(0.5,-1) translate(45,-35)" >
        <g fill="none" stroke="red" stroke-width="1" >
            <line x1="-50" y1="15" x2="-40" y2="15" />
            <line x1="-40" y1="15" x2="-40" y2="20" />
            <line x1="-40" y1="20" x2="-50" y2="20" />
            <line x1="-50" y1="20" x2="-50" y2="15" />
        </g>

        <use xlink:href="#diagUL_LR" class="TestLine" title="UL to LR"
/>
        <text class="TestFont">
            <textPath xlink:href="#diagUL_LR">UL to LR</textPath>
        </text>

        <use xlink:href="#diagLL_UR" class="TestLine" title="LL to UR"
/>
        <text class="TestFont">
            <textPath xlink:href="#diagLL_UR">LL to UR</textPath>
        </text>
    </g>
</svg>

- - -

Any suggestions to get rid of either of these scale effects on textPath?

Thanks,
Greg

P.S., While experimenting I tried substituting

    <g transform="translate(-45,0) scale(0.5,-1) translate(45,-35)" >

with

    <g transform="translate(-45,0) scale(0.5,1) rotate(180)
translate(45,-35)" >

and was surprised to see that the text not only switched ends, but also
switched diagonals (i.e., the "UL to LR" diagonal gets labeled "LL to
UR").  I still don't understand that.  FWIW, I'm using Adobe SVG Viewer
3.01 build 81.
Received on Wednesday, 28 January 2004 14:16:24 GMT

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