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


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"

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

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

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

    <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" />

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

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

- - -

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


P.S., While experimenting I tried substituting

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


    <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 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:57 UTC