Browse Source

Add back registerFonts

Noah 7 years ago
parent
commit
8ff1eadeb4
1 changed files with 10 additions and 0 deletions
  1. 10 0
      lib/register-fonts.js

+ 10 - 0
lib/register-fonts.js View File

@@ -0,0 +1,10 @@
1
+var fonts = require("./settings/").fonts,
2
+    _ = require("underscore"),
3
+    Canvas = require("canvas");
4
+
5
+// Register custom fonts one time
6
+if (Array.isArray(fonts)) {
7
+  fonts.forEach(function(font){
8
+    Canvas.registerFont(font.file, _.pick(font, "family", "weight", "style"));
9
+  });
10
+}