Template for issues
by Steve Eberhardt
HTML
<script src="https://rawgithub.com/kangax/fabric.js/master/dist/fabric.js"></script>
<canvas id="c" width="800" height="800"></canvas>
CSS
canvas{
border: 1px solid black;
}
JavaScript
var canvas = new fabric.Canvas('c');
var o1 = new fabric.Text("Text 1", {
left: 200,
objectCaching: false,
fontSize: 30,
charSpacing: 1,
fill: "#4B9EBE",
})
var o2 = new fabric.Text("Text 2", {
left: 200, top: 200,
objectCaching: false,
fontSize: 30,
charSpacing: 1,
fill: "#4B9EBE",
paintFirst: 'stroke',
strokeWidth: '0'
})
canvas.add(o1);
canvas.add(o2);
o1.scaleToWidth(300, true)
o2.scaleToWidth(300, true)
o1.set('shadow', new fabric.Shadow({color: "#cccccc", offsetX: -20, offsetY: 5, blur:0}));
o2.shadow = new fabric.Shadow({color: "#cccccc", offsetX: -20, offsetY: 5, blur:0});