Created
June 21, 2012 11:02
-
-
Save joshje/2965134 to your computer and use it in GitHub Desktop.
Revisions
-
joshje revised this gist
Jun 21, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,6 +28,7 @@ var controlWidth = span.offsetWidth; span.className += ' test'; var testWidth = span.offsetWidth; document.getElementsByTagName('html')[0].removeChild(span); return (controlWidth != testWidth)? true : false; } document.write(supportsFFS()? 'I support font-feature-settings :-)' : 'I don‘t support font-feature settings :-('); -
joshje created this gist
Jun 21, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Opentype Test</title> <style> span.opentype-test { font-family: Corbel; font-size: 100px; position: absolute; visibility: hidden; } span.opentype-test.test { -moz-font-feature-settings: 'tnum=1'; -webkit-font-feature-settings: 'tnum' 1; -moz-font-feature-settings: 'tnum' 1; -ms-font-feature-settings: 'tnum' 1; -o-font-feature-settings: 'tnum' 1; font-feature-settings: 'tnum' 1; } </style> <script> supportsFFS = function() { var span = document.createElement('span'); span.appendChild(document.createTextNode('1')); span.className = 'opentype-test'; document.getElementsByTagName('html')[0].appendChild(span); var controlWidth = span.offsetWidth; span.className += ' test'; var testWidth = span.offsetWidth; return (controlWidth != testWidth)? true : false; } document.write(supportsFFS()? 'I support font-feature-settings :-)' : 'I don‘t support font-feature settings :-('); </script> </head> <body> </body> </html>