Text Following a Specified Path

   



Key Constructs

A text string can be rendered with the following SVG snippet:

<g transform="translate(100,100)">   <text  x="0" y="0"          fill="red"          font-size="18">         Sample Text   </text> </g>

A text string can be rotated counterclockwise 90% with the following SVG snippet:

<g transform="translate(100,300)">   <text  x="0" y="0"          transform="rotate(-90)"         fill="red"          font-size="18">         Counter clockwise Rotated Text   </text> </g>

A text string with an SVG blur filter can be rendered with the following SVG snippet:

<defs>   <filter            filterUnits="objectBoundingBox"      x="0" y="0"       width="100%" height="100%">       <feGaussianBlur stdDeviation="4"/>   </filter> </defs> <g transform="translate(50,100)">   <text  x="0" y="100"          filter="url(#blurFilter1)"         fill="red" stroke="black" stroke-width="4"         font-size="72">       Blurred Text   </text> </g>

A text string can follow a Bezier curve with the following SVG snippet:

<defs>   <path          d="m0,0 Q100,0 200,200 T300,200 z"/> </defs> <g transform="translate(100,100)">   <text  fill="red"        stroke="blue" stroke-width="2"       font-size="24">   <textPath xlink:href="#pathDefinition">         Sample Text that follows a path specified by a Quadratic 
Bezier curve </textPath> </text> </g>



   



Fundamentals of SVG Programming. Concepts to Source Code
Fundamentals of SVG Programming: Concepts to Source Code (Graphics Series)
ISBN: 1584502983
EAN: 2147483647
Year: 2003
Pages: 362

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net