[ Launch: just another inlet to tributary ] 4567185 by roundrobin
-
-
Save roundrobin/4567185 to your computer and use it in GitHub Desktop.
Text on bezier curve
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"description":"Text on bezier curve","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"tab":"edit","display_percent":0.7,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"hidepanel":false,"fullscreen":false,"thumbnail":"http://i.imgur.com/lyGGmt4.png"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var startX = 50 | |
var startY = 200 | |
var curve = 150 | |
var amplitude = -151 | |
var targetX = 393 | |
var targetY = 0 | |
var svg = g; | |
var defs = svg.append('defs') | |
var font_size = 70 | |
var text_string = 'Coffee for free' | |
var font_face = 'Arial' | |
//______ To adjust change parameters above __________ | |
defs.append('path') | |
.attr('d','M '+startX+' '+startY+' q '+curve+' '+amplitude+' '+targetX+' '+targetY+'') | |
.attr('stroke','blue') | |
.attr('stroke-width',3) | |
.attr('fill','none') | |
.attr('id','bezierCurve') | |
var text = svg.append('text') | |
.attr('font-size',font_size) | |
.attr('font-family',font_face) | |
text.append('textPath') | |
.attr('xlink:href','#bezierCurve') | |
.text(text_string) | |
svg.append('use') | |
.attr('xlink:href','#bezierCurve') | |
.text(text_string) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment