This commit is contained in:
Dragon Fire
2021-02-21 15:55:55 -05:00
parent 4d5a8a8a22
commit 405ff5f2c5
2 changed files with 1 additions and 7 deletions
+1 -5
View File
@@ -16,7 +16,7 @@ const fallbacks = ['Symbola', 'Noto-CJK'];
module.exports = class Font {
constructor(path, filename, metadata) {
this.path = path;
this.name = variants[filename] || metadata.name || filename;
this.name = metadata.name || filename;
this.filename = filename;
this.style = metadata.style === 'regular' ? 'normal' : metadata.style || 'normal';
this.weight = weights[metadata.weight] || metadata.weight || 'normal';
@@ -40,10 +40,6 @@ module.exports = class Font {
return this.filename.replace(/(\.(otf|ttf))$/, '');
}
get isVariant() {
return variants[this.filename];
}
get isFallback() {
return fallbacks.includes(this.filenameNoExt);
}
-2
View File
@@ -10,7 +10,6 @@ module.exports = class FontArgumentType extends ArgumentType {
const choice = value.toLowerCase();
let found = this.client.fonts.filter(font => {
if (font.isFallback) return false;
if (font.isVariant) return false;
if (font.name.toLowerCase().includes(choice)) return true;
if (font.filenameNoExt.toLowerCase().includes(choice)) return true;
return false;
@@ -33,7 +32,6 @@ module.exports = class FontArgumentType extends ArgumentType {
const choice = value.toLowerCase();
const found = this.client.fonts.filter(font => {
if (font.isFallback) return false;
if (font.isVariant) return false;
if (font.name.toLowerCase().includes(choice)) return true;
if (font.filenameNoExt.toLowerCase().includes(choice)) return true;
return false;