Check support of OpenType features in browser by JavaScript
Options

yanone
Posts: 134
Has anyone found a way to check in JavaScript whether certain OpenType features are supported by a certain browser that don't involve rasterization and bitwise comparison of Webfonts or similar voodoo?
Most tests fail because the CSS properties are indeed supported, but they are not executed for all features.
For instance,
Then, even if not executed, Safari would add ss01 to its style elements. So a comparison between style objects is not productive.
Most tests fail because the CSS properties are indeed supported, but they are not executed for all features.
For instance,
font-feature-settings
is supported in Safari, which is true because it supports features like liga and calt, but no Stylistic Sets and other dubious features.Then, even if not executed, Safari would add ss01 to its style elements. So a comparison between style objects is not productive.
0
Comments
-
I think we found voodoo is the best science on CSS feature support.2
-
i tested liga support recently at work by creating a single ot liga sub which, if successful, would sub in a zero-width glyph and measuring the width of an off-screen
span
. it's less voodoo-ey, but it's still a bit gross but it lets you do things likevar ligaSupported = $(el).width() === 0;
Does anyone have other tricks?0 -
Nice one!0
Categories
- All Categories
- 46 Introductions
- 3.8K Typeface Design
- 476 Type Design Critiques
- 555 Type Design Software
- 1.1K Type Design Technique & Theory
- 640 Type Business
- 831 Font Technology
- 29 Punchcutting
- 508 Typography
- 120 Type Education
- 313 Type History
- 75 Type Resources
- 109 Lettering and Calligraphy
- 30 Lettering Critiques
- 79 Lettering Technique & Theory
- 533 Announcements
- 86 Events
- 110 Job Postings
- 167 Type Releases
- 169 Miscellaneous News
- 274 About TypeDrawers
- 53 TypeDrawers Announcements
- 119 Suggestions and Bug Reports