Skip to content

Commit 69dec90

Browse files
author
EC2 Default User
committed
Upgrade to node-canvas 2.6.1
1 parent bc332a7 commit 69dec90

File tree

139 files changed

+17
-23620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+17
-23620
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
./node_modules
2+
package-lock.json

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Charoite Lee
3+
Copyright (c) 2020 Charoite Lee
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

fonts/NotoSans-Regular.ttf

299 KB
Binary file not shown.

fonts/NotoSerif-Regular.ttf

371 KB
Binary file not shown.

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
var Canvas = require('canvas');
1+
const { createCanvas, registerFont } = require('canvas');
22

33
exports.handler = function(event, context, callback) {
4-
var canvas = new Canvas(200, 200);
4+
registerFont(__dirname + '/fonts/NotoSans-Regular.ttf', { family: 'Noto Sans' });
5+
var canvas = createCanvas(200, 200);
56
var ctx = canvas.getContext('2d');
67

7-
ctx.font = '30px Impact';
8-
ctx.fillText('Awesome!', 50, 100);
8+
ctx.font = '30px Noto Sans';
9+
ctx.fillText(typeof event.text !== 'undefined' ? event.text : 'Hello' , 50, 100);
910

1011
callback(null, '<img src="' + canvas.toDataURL() + '" />');
1112
};

libblkid.so.1

300 KB
Binary file not shown.

libcairo-script-interpreter.so.2

-150 KB
Binary file not shown.

libcairo.so.2

-1.18 MB
Binary file not shown.

libcairomm-1.0.so.1

-155 KB
Binary file not shown.

libgif.so.4

-41.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)