foliojs / fontkit

An advanced font engine for Node and the browser
1.48k stars 219 forks source link

postscriptname null in some version of fontkit #336

Open alecjacobson opened 3 months ago

alecjacobson commented 3 months ago

I admit I'm lost in my node dependencies, but I have some configuration where this program works correctly:

var fontkit = require('fontkit');

// open a font synchronously from arg
var font = fontkit.openSync('STRRETCH-SANS-FREE-dqme76.otf');
console.log(font.postscriptName);

and outputs:

STRRETCHSANSFREERegular

But then in a different node installation directory this same program will just output:

null

I liked the behavior that I could reliably get the postscriptname from the font I loaded from file. Did this feature change?

alecjacobson commented 3 months ago

Could be related to https://github.com/foliojs/fontkit/issues/333

alecjacobson commented 3 months ago

also, fwiw, both of my installs are supposedly using 2.0.2 so it's really weird that they're producing different behavior. Maybe there's an issue with dependencies?

If I downgrade to 1.9.0 I don't seem to have a problem. But already 2.0.0 produced null in one of the installations