summaryrefslogtreecommitdiff
path: root/source/bower_components/modernizr/feature-detects/emoji.js
diff options
context:
space:
mode:
Diffstat (limited to 'source/bower_components/modernizr/feature-detects/emoji.js')
-rw-r--r--source/bower_components/modernizr/feature-detects/emoji.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/bower_components/modernizr/feature-detects/emoji.js b/source/bower_components/modernizr/feature-detects/emoji.js
new file mode 100644
index 0000000..271db65
--- /dev/null
+++ b/source/bower_components/modernizr/feature-detects/emoji.js
@@ -0,0 +1,11 @@
+// Requires a Modernizr build with `canvastext` included
+// http://www.modernizr.com/download/#-canvas-canvastext
+Modernizr.addTest('emoji', function() {
+ if (!Modernizr.canvastext) return false;
+ var node = document.createElement('canvas'),
+ ctx = node.getContext('2d');
+ ctx.textBaseline = 'top';
+ ctx.font = '32px Arial';
+ ctx.fillText('\ud83d\ude03', 0, 0); // "smiling face with open mouth" emoji
+ return ctx.getImageData(16, 16, 1, 1).data[0] !== 0;
+}); \ No newline at end of file