| 123456789101112131415161718192021222324252627 |
- /*!
- {
- "name": "CSS Subpixel Fonts",
- "property": "subpixelfont",
- "tags": ["css"],
- "builderAliases": ["css_subpixelfont"],
- "authors": ["@derSchepp", "@gerritvanaaken", "@rodneyrehm", "@yatil", "@ryanseddon"],
- "notes": [{
- "name": "Origin Test",
- "href": "https://github.com/gerritvanaaken/subpixeldetect"
- }]
- }
- !*/
- define(['Modernizr', 'testStyles'], function(Modernizr, testStyles) {
- /*
- * (to infer if GDI or DirectWrite is used on Windows)
- */
- testStyles(
- '#modernizr{position: absolute; top: -10em; visibility:hidden; font: normal 10px arial;}#subpixel{float: left; font-size: 33.3333%;}',
- function(elem) {
- var subpixel = elem.firstChild;
- subpixel.innerHTML = 'This is a text written in Arial';
- Modernizr.addTest('subpixelfont', window.getComputedStyle ?
- window.getComputedStyle(subpixel, null).getPropertyValue('width') !== '44px'
- : false);
- }, 1, ['subpixel']);
- });
|