SVG and Canvas
path
to specify a path. <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="200px" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full"> <g fill-opacity="0.7" stroke="black" stroke-width="0.1cm"> <path d="M100,10 L100,10 40,180 190,60 10,60 160,180 z" stroke="blue" fill="darkblue" stroke-width="4" /> </g> </svg>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="200px" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full"> <defs> <linearGradient id="hill" x1="100%" y1="100%" x2="100%" y2="0%"> <stop offset="5%" stop-color="green" /> <stop offset="95%" stop-color="lightgreen" stop-opacity="0.8" /> </linearGradient> </defs> <path d="M40,140 L40,100 10,100 C10,10 90,10 90,100 L60,100 60,140 M140,50 C70,180 195,180 190,100 " stroke="darkgreen" stroke-width="4" fill="url(#hill)" /> <circle cx="10" cy="10" r="4" fill="none" stroke="red" /> <circle cx="90" cy="10" r="4" fill="none" stroke="red" /> <line x1="10" y1="10" x2="10" y2="100" stroke="black" stroke-width="2" opacity="0.5" /> <line x1="90" y1="10" x2="90" y2="100" stroke="black" stroke-width="2" opacity="0.5" /> <circle cx="70" cy="180" r="4" fill="none" stroke="red" /> <circle cx="195" cy="180" r="4" fill="none" stroke="red" /> <line x1="70" y1="180" x2="140" y2="50" stroke="black" stroke-width="2" opacity="0.5" /> <line x1="195" y1="180" x2="190" y2="100" stroke="black" stroke-width="2" opacity="0.5" /> </svg>
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="200px" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full"> <defs> <path id="path1" d="M25, 100 C10,10 175,10 175,100" /> </defs> <use xlink:href="#path1" fill="none" stroke="red" /> <text font-size="19.5" fill="blue"> <textPath xlink:href="#path1">Hello text-on-a-path world!</textPath> </text> </svg>
23 of 24