mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 01:57:54 +02:00
Override certain font registration names
This commit is contained in:
+5
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user