CSS usage:
@font-face { font-family: myFirstFont; src: url('Sansation_Light.ttf'), url('Sansation_Light.eot'); }
Create an instance of a text object object:
var object = new fabric.Text("NEW TEXT", { fontFamily: "myFirstFont", left: 150, top: 100, fontSize: 24, textAlign: "left", fill: "#000000" }); canvas.add(object); canvas.renderAll();
source share