diff --git a/index.js b/index.js index 71385dd..cc52969 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,7 @@ function generateBMFont (fontPath, opt, callback) { if (font.outlinesFormat !== 'truetype') { throw new TypeError('must specify a truetype font'); } - const canvas = new Canvas(textureWidth, textureHeight); + const canvas = Canvas.createCanvas(textureWidth, textureHeight); const context = canvas.getContext('2d'); const packer = new MultiBinPacker(textureWidth, textureHeight, texturePadding); const chars = []; diff --git a/package.json b/package.json index a8cbf0c..11ad3a8 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ }, "license": "MIT", "dependencies": { - "canvas": "^1.4.0", + "canvas": "^2.6.1", "map-limit": "0.0.1", "multi-bin-packer": "^1.1.3", "opentype.js": "^0.6.4"