I'm developing a website with Nuxt and Contentful. I loaded some fonts using FontFace. I need to load them in this way because it's a Type design club website and they need to load their fonts as they release new ones.
They ask me to show all features of those loaded fonts, such as ligatures, stylistic alternatives, etc.
Is there a way in JavaScript to know which features are available for font?
You'd need code that can parse GSUB to a depth that gets you all features for all scripts/langsys, which is an incredibly complex thing to write yourself.
I wrote lib-font for that task (which is used by the folks over on https://wakamaifondue.com, a play on "what can my font do", an online font analysis service), with the test code covering a number of things you'd normally need to query a font on, including getting all features: for an example of listing all script/langsys/feature/lookup sets, have a look at lib-font's GSUB test function, with the simplified/compacted code being: