Skip to content

Commit

Permalink
fix: omit path in font-face
Browse files Browse the repository at this point in the history
fix #49
  • Loading branch information
soimy committed Feb 2, 2020
1 parent 7b1f2a7 commit ae559fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ function generateBMFont (fontPath, opt, callback) {
const os2 = font.tables.os2;
const baseline = os2.sTypoAscender * (fontSize / font.unitsPerEm) + (distanceRange >> 1);

const fontface = filename || path.basename(fontPath, path.extname(fontPath));
const fontface = typeof fontPath === 'string' ? path.basename(fontPath, path.extname(fontPath)) : filename;

if(!filename) {
filename = fontface;
console.log(`Use font-face as filename : ${filename}`);
Expand Down

0 comments on commit ae559fd

Please sign in to comment.