body {
margin: 20px auto;
font-family: 'Lato';
font-weight: 300;
width: 600px;
text-align: center;
}
#text {
width: 600px;
height: 400px;
box-shadow: 0 0 1px #ddd, 0 2px 2px #aaa;
border-radius: 5px;
margin: 20px 0;
}
var canvasWidth = 600;
var canvasHeight = 400;
var stage = new Konva.Stage({
container: "text",
width: canvasWidth,
height: canvasHeight
});
var layerA = new Konva.Layer();
var textA = new Konva.TextPath({
y: 25,
align: 'center',
data: 'M100,300 C150,100 200,50 500 60',
text: "THIS TEXT GOES ALONG A PATH",
fontSize: 35,
fontFamily: "Lato",
fill: "orange"
});
var textB = new Konva.TextPath({
y: 28,
align: 'center',
data: 'M100,320 C200,200 400,400 500 80',
text: "THIS TEXT GOES ALONG ANOTHER PATH",
fontSize: 25,
fontFamily: "Lato",
fill: "green"
});
layerA.add(textA, textB);
stage.add(layerA);