Skip to content

Tod314/fabric.CurvesText

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

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

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