List Opentype features from loaded webfonts
mt_1
Posts: 1
Hi all
I'm not sure this is possible but I thought I'd ask anyway.
Is there a way programatically to list the opentype features in a webfont without opening it.
I know I can open the font is something like Fontlab and see the Opentype features or Open it in a type setting program like Indesign and see which features are available but is there a way to get this from the font without opening it in another program.
I'm developing a website that will show Opentype features and it would be good If I could capture the opentype features in the font without having to open them.
I'm not sure this is possible but I thought I'd ask anyway.
Is there a way programatically to list the opentype features in a webfont without opening it.
I know I can open the font is something like Fontlab and see the Opentype features or Open it in a type setting program like Indesign and see which features are available but is there a way to get this from the font without opening it in another program.
I'm developing a website that will show Opentype features and it would be good If I could capture the opentype features in the font without having to open them.
Tagged:
0
Comments
-
python -> fonttools0
-
If you're doing this as a website, you may want to look into https://github.com/opentypejs/opentype.js which is a Javascript library that'll parse OpenType fonts for you. It has support for OT features, although it's not that well documented and you will need to dig around in the code to find it. Check out the Font Inspector example as a place to start.1
-
There is a proposal to expose OpenType features (including variable axes) through CSS or JavaScript, but it's just a draft and won't be coming to browsers anytime soon, I don't think. (But do leave a +1 there if you want to let browser developers know we want this!)
I made something similar to what you're doing. It's called Wakamai Fondue and I'm using Fontkit to analyse fonts and deduct OpenType features from them. The reason I'm using Fontkit over opentype.js is that it supports WOFF2 too. In either case, you'll need to include a hefty JavaScript and write code to list features yourself.
The code to Wakamai Fondue isn't open source but not a super secret either, if you need any help shoot me a message!0 -
If your list of fonts is a known I'd recommend to do the parsing server-side beforehand, and also cache the results, or even do it dynamically with a server round trip rather than a Javascript parser. Extracting this information for every user in their browser might solve the problem, but depending on the information shown it might not be a very efficient way.
1
Categories
- All Categories
- 43 Introductions
- 3.7K Typeface Design
- 799 Font Technology
- 1K Technique and Theory
- 617 Type Business
- 444 Type Design Critiques
- 541 Type Design Software
- 30 Punchcutting
- 136 Lettering and Calligraphy
- 83 Technique and Theory
- 53 Lettering Critiques
- 483 Typography
- 301 History of Typography
- 114 Education
- 68 Resources
- 498 Announcements
- 79 Events
- 105 Job Postings
- 148 Type Releases
- 165 Miscellaneous News
- 269 About TypeDrawers
- 53 TypeDrawers Announcements
- 116 Suggestions and Bug Reports