1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-05 01:26:18 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/howtos/Making curved text with SVG.tid

27 lines
1.0 KiB
Plaintext
Raw Normal View History

2014-03-24 22:49:10 +00:00
created: 20140324223413403
2015-05-05 06:38:00 +00:00
modified: 20150505063713581
2014-09-19 16:18:25 +00:00
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>
<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
2015-05-05 06:38:00 +00:00
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|Making curved text with SVG]] to see how it is done.
2014-03-24 22:49:10 +00:00
<$edit-text tiddler="$:/CurvedText" tag="input" placeholder="Type text here" default=""/>
<$macrocall $name="textOnPath" text={{$:/CurvedText}}/>