You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
470 B
11 lines
470 B
7 years ago
|
// 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;
|
||
|
});
|