From 1eb843f1b29aa30fc1d86ddcca24a4c73b9275f1 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 20 Feb 2021 10:00:43 -0500 Subject: [PATCH] Override certain font registration names --- structures/Font.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/structures/Font.js b/structures/Font.js index a95e2da0..35f2fdfe 100644 --- a/structures/Font.js +++ b/structures/Font.js @@ -11,11 +11,15 @@ const weights = { 900: 'heavy', 950: 'extraBlack' }; +const variants = { + 'Noto-CJK.otf': 'Noto Sans', + 'Noto-Emoji.ttf': 'Noto Sans' +}; module.exports = class Font { constructor(path, filename, metadata) { this.path = path; - this.name = metadata.name || filename; + this.name = variants[filename] || metadata.name || filename; this.style = metadata.style === 'regular' ? 'normal' : metadata.style || 'normal'; this.weight = weights[metadata.weight] || metadata.weight || 'normal'; this.type = metadata.type;