1

How can I read the existing fontFeatureSettings / fontVariationSettings of a font file (for example 'ss01', 'liga', 'WGHT' etc.) and also their range and value? I know how to access and change the features with javascript, but I would like to render Faders dynamically based on the settings that are provided by each font. I am pretty sure it is possible, but maybe I am looking for the wrong keywords? I am also happy with a server-side solution with node.js if not possible other wise.

Thank you!

I tried to dynamically import the font file with javascript but I can't find the information that I need in documents.fonts:

async function loadFonts() {
    const font = new FontFace('Variable', 'url(NobotoFlex-VF.ttf)');

    await font.load();

    document.fonts.add(font);

    // I can't find the information I am looking for:
    console.log(document.fonts);
}
loadFonts()
Philipp
  • 105
  • 6
  • You might be interested in this: https://typedrawers.com/discussion/1790/detect-opentype-features-of-a-font-file-via-browser – Rakesh G R Jul 24 '19 at 10:15
  • Thank you, that helps a lot. I guess there is no direct way to read that information directly with javascript. I am just confused, that it is so simple to change the value but not to read it? – Philipp Jul 24 '19 at 14:56

0 Answers0