text2svg
> Convert text to svg path


Install
``
$ npm install --save text2svg
`
Usage
`js
var Text2svg = require('text2svg');
var text2svg = new Text2svg('localFontPath');
var svg = text2svg.toSVG('something', options);
`
API
$3
There are three ways to get an instance of Text2svg:
- new Text2svg('localFontPath')
- Text2svg.loadSync('localFontPath')
- Text2svg.load('fontUrl', callback)
The callback function looks like:
`js
function (text2svg) {
// ...
}
`
$3
Convert the text to path data, which is the attribute value of d in the element. Return:
`js
{
width : width, // Int, total width
height : height, // Int, total Height
pathData: pathData // Array/String
}
`
If options.divided is true the pathData will be an Array.
$3
Convert the text to element(s). Return:
`js
{
width : width, // Int, total width
height : height, // Int, total Height
pathData: pathData // Array/String
path : path // Array/String
}
`
$3
Convert the text
to