Use local verdana file if available.

This commit is contained in:
Thaddee Tyl 2014-01-04 13:00:58 +01:00
parent c04d52da73
commit 1b3f60ab8e

View File

@ -5,6 +5,11 @@ var SVGO = require('svgo');
var Canvas = require('canvas');
var canvasElement = new Canvas(0, 0); // Width and height are irrelevant.
var canvasContext = canvasElement.getContext('2d');
var CanvasFont = Canvas.Font;
try {
var opensans = new CanvasFont('Verdana', './Verdana.ttf');
canvasContext.addFont(opensans);
} catch(e) {}
canvasContext.font = '10px Verdana';
// Template crafting action below.