Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 

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);
});

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.