Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ function generateBMFont (fontPath, opt, callback) {
opt = {};
}

const lookupKey = process.arch === "arm64" ?`${process.platform}_${process.arch}` : process.platform;
const platformKey = process.arch === "arm64" ?`${process.platform}_${process.arch}` : process.platform;

const binName = binaryLookup[lookupKey];
const binName = binaryLookup[platformKey];

assert.ok(binName, `No msdfgen binary for platform ${lookupKey}.`);
assert.ok(binName, `No msdfgen binary for platform ${platformKey}.`);
assert.ok(fontPath, 'must specify a font path');
assert.ok(typeof fontPath === 'string' || fontPath instanceof Buffer, 'font must be string path or Buffer');
assert.ok(opt.filename || !(fontPath instanceof Buffer), 'must specify filename if font is a Buffer');
Expand All @@ -67,7 +67,7 @@ function generateBMFont (fontPath, opt, callback) {

// Set fallback output path to font path
let fontDir = typeof fontPath === 'string' ? path.dirname(fontPath) : '';
const binaryPath = path.join(__dirname, 'bin', process.platform, binName);
const binaryPath = path.join(__dirname, 'bin', platformKey, binName);

// const reuse = (typeof opt.reuse === 'boolean' || typeof opt.reuse === 'undefined') ? {} : opt.reuse.opt;
let reuse, cfg = {};
Expand Down