2014-03-24 22:49:10 +00:00
created: 20140324223413403
2014-09-19 16:18:25 +00:00
modified: 20140919161431562
tags: Learning
2014-03-24 22:49:10 +00:00
title: Making curved text with SVG
type: text/vnd.tiddlywiki
\define textOnPath(text)
$$$.svg
2015-04-28 08:11:11 +00:00
<svg width="100%" height="100%" viewBox="0 0 1000 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="background:white;">
2014-03-24 22:49:10 +00:00
<defs>
<path id="MyPath" d="M 100 200 C 200 100 300 0 400 100 C 500 200 600 300 700 200 C 800 100 900 100 900 100"/>
</defs>
2014-03-26 10:16:15 +00:00
<use xlink:href="#MyPath" fill="none" stroke="#ddd"/>
2014-03-24 22:49:10 +00:00
<text font-family="'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif" font-size="42.5">
<textPath xlink:href="#MyPath">
$text$
</textPath>
</text>
</svg>
$$$
\end
This demo shows how to use SVG to render transcluded text along a path. Enter some text in the textbox below to try it out; view the source to see how it is done.
<$edit-text tiddler="$:/CurvedText" tag="input" placeholder="Type text here" default=""/>
<$macrocall $name="textOnPath" text={{$:/CurvedText}}/>