Text Following a Specified Path : text « SVG « XML






Text Following a Specified Path

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" 
 "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">

<svg width="100%" height="100%">

  <defs>
    <path id="pathDefinition" d="m0,0 Q100,0 200,200 T300,200 z" />
  </defs>

  <g transform="translate(100,100)">
    <text id="textStyle" fill="red" stroke="blue" stroke-width="2"
      font-size="24">

      <textPath xlink:href="#pathDefinition">
        A Quadratic Bezier curve
      </textPath>
    </text>
  </g>
</svg>

 








Related examples in the same category

1.Rendering a Text String
2.Rendering a Text String with Colored Borders
3.Using Text Decoration with Text Strings
4.Using the SVG tspan Element with Text Strings
5.Rendering Shadowed Text
6.Rotating a Text String Counterclockwise
7.Displaying Text with Linear Gradients
8.Displaying Text with Opacity
9.Displaying Text with blur Filters
10.Vertical text