From 7cc7910df63d19e7ebc67bb1156437f0559712d7 Mon Sep 17 00:00:00 2001 From: Lars Henrik Mai Date: Sun, 21 Sep 2014 12:25:47 +0200 Subject: add foundation via bower --- .../modernizr/feature-detects/css-subpixelfont.js | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 source/bower_components/modernizr/feature-detects/css-subpixelfont.js (limited to 'source/bower_components/modernizr/feature-detects/css-subpixelfont.js') diff --git a/source/bower_components/modernizr/feature-detects/css-subpixelfont.js b/source/bower_components/modernizr/feature-detects/css-subpixelfont.js new file mode 100644 index 0000000..57a11b0 --- /dev/null +++ b/source/bower_components/modernizr/feature-detects/css-subpixelfont.js @@ -0,0 +1,23 @@ +/* + * Test for SubPixel Font Rendering + * (to infer if GDI or DirectWrite is used on Windows) + * Authors: @derSchepp, @gerritvanaaken, @rodneyrehm, @yatil, @ryanseddon + * Web: https://github.com/gerritvanaaken/subpixeldetect + */ +Modernizr.addTest('subpixelfont', function() { + var bool, + styles = "#modernizr{position: absolute; top: -10em; visibility:hidden; font: normal 10px arial;}#subpixel{float: left; font-size: 33.3333%;}"; + + // see https://github.com/Modernizr/Modernizr/blob/master/modernizr.js#L97 + Modernizr.testStyles(styles, function(elem) { + var subpixel = elem.firstChild; + + subpixel.innerHTML = 'This is a text written in Arial'; + + bool = window.getComputedStyle ? + window.getComputedStyle(subpixel, null).getPropertyValue("width") !== '44px' + : false; + }, 1, ['subpixel']); + + return bool; +}); -- cgit v1.2.1