Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
src
LICENSE
README.md

README.md

fabric.CurvesText by TJ

Plugin for fabric.js. Plugin's page

fabric.CurvesText
Demo1
Demo2

Installation

<script src="js/fabricjs.js"></script>
<script src="js/opentype.js"></script>
<script src="js/fabric.CurvesText.min.js"></script>

JS

var fontsArr = [];

// load font
opentype.load('fonts/Caveat.ttf', function (err, font) {
	if (err) {
		console.error('Error loading font ', err);
		return
	}
	
	// Add font to array
	fontsArr['Caveat'] = {
		obj: font,
		name: 'Caveat',
	}
	
	// add CurvesText
	var text = new fabric.CurvesText('fabric CurvesText plugin by TJ', {
		fontFamily: 'Caveat',
		width: 230,
		left: 20,
		top: 20,
		textAlign: 'left',
		fill: '#000000',
		fontSize: 26,
		lineHeight: 1,
	});
	canvas.add(text);
});