Emoji: Add support for the upcoming Emoji 4 release.

Emoji 4 adds 32 new professions, (with variations for gender and skin tone), and updates 33 existing character for male and female variations.

Fixes #38113 for trunk.


Built from https://develop.svn.wordpress.org/trunk@38717


git-svn-id: http://core.svn.wordpress.org/trunk@38660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2016-10-04 03:24:30 +00:00
parent c4d3f20870
commit 84aebb9896
7 changed files with 28 additions and 11 deletions

View File

@ -4948,7 +4948,7 @@ function _print_emoji_detection_script() {
*
* @param string The emoji base URL for png images.
*/
'baseUrl' => apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/2/72x72/' ),
'baseUrl' => apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/2.2.1/72x72/' ),
/**
* Filters the extension of the emoji png files.
@ -4966,7 +4966,7 @@ function _print_emoji_detection_script() {
*
* @param string The emoji base URL for svg images.
*/
'svgUrl' => apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2/svg/' ),
'svgUrl' => apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/2.2.1/svg/' ),
/**
* Filters the extension of the emoji SVG files.
@ -5013,7 +5013,7 @@ function _print_emoji_detection_script() {
?>
<script type="text/javascript">
window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>;
!function(a,b,c){function d(a){var c,d,e,f,g,h=b.createElement("canvas"),i=h.getContext&&h.getContext("2d"),j=String.fromCharCode;if(!i||!i.fillText)return!1;switch(i.textBaseline="top",i.font="600 32px Arial",a){case"flag":return i.fillText(j(55356,56806,55356,56826),0,0),h.toDataURL().length<3e3?!1:(i.clearRect(0,0,h.width,h.height),i.fillText(j(55356,57331,65039,8205,55356,57096),0,0),c=h.toDataURL(),i.clearRect(0,0,h.width,h.height),i.fillText(j(55356,57331,55356,57096),0,0),d=h.toDataURL(),c!==d);case"diversity":return i.fillText(j(55356,57221),0,0),e=i.getImageData(16,16,1,1).data,f=e[0]+","+e[1]+","+e[2]+","+e[3],i.fillText(j(55356,57221,55356,57343),0,0),e=i.getImageData(16,16,1,1).data,g=e[0]+","+e[1]+","+e[2]+","+e[3],f!==g;case"simple":return i.fillText(j(55357,56835),0,0),0!==i.getImageData(16,16,1,1).data[0];case"unicode8":return i.fillText(j(55356,57135),0,0),0!==i.getImageData(16,16,1,1).data[0];case"unicode9":return i.fillText(j(55358,56631),0,0),0!==i.getImageData(16,16,1,1).data[0]}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity","unicode9"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
!function(a,b,c){function d(a){var c,d,e,f,g,h,i,j=b.createElement("canvas"),k=j.getContext&&j.getContext("2d"),l=String.fromCharCode;if(!k||!k.fillText)return!1;switch(k.textBaseline="top",k.font="600 32px Arial",a){case"flag":return k.fillText(l(55356,56806,55356,56826),0,0),j.toDataURL().length<3e3?!1:(k.clearRect(0,0,j.width,j.height),k.fillText(l(55356,57331,65039,8205,55356,57096),0,0),c=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(l(55356,57331,55356,57096),0,0),d=j.toDataURL(),c!==d);case"diversity":return k.fillText(l(55356,57221),0,0),e=k.getImageData(16,16,1,1).data,f=e[0]+","+e[1]+","+e[2]+","+e[3],k.fillText(l(55356,57221,55356,57343),0,0),e=k.getImageData(16,16,1,1).data,g=e[0]+","+e[1]+","+e[2]+","+e[3],f!==g;case"simple":return k.fillText(l(55357,56835),0,0),0!==k.getImageData(16,16,1,1).data[0];case"unicode8":return k.fillText(l(55356,57135),0,0),0!==k.getImageData(16,16,1,1).data[0];case"unicode9":return k.fillText(l(55358,56631),0,0),0!==k.getImageData(16,16,1,1).data[0];case"emoji4":return k.fillText(l(55357,56425,55356,57341,8205,55357,56507),0,0),h=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(l(55357,56425,55356,57341,55357,56507),0,0),i=j.toDataURL(),h!==i}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity","unicode9","emoji4"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
</script>
<?php
}
@ -5078,7 +5078,7 @@ function wp_staticize_emoji( $text ) {
$text = wp_encode_emoji( $text );
/** This filter is documented in wp-includes/formatting.php */
$cdn_url = apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/2/72x72/' );
$cdn_url = apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/2.2.1/72x72/' );
/** This filter is documented in wp-includes/formatting.php */
$ext = apply_filters( 'emoji_ext', '.png' );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@
var canvas = document.createElement( 'canvas' ),
context = canvas.getContext && canvas.getContext( '2d' ),
stringFromCharCode = String.fromCharCode,
flag, flag2, tonedata, tone, tone2;
flag, flag2, tonedata, tone, tone2, technologist, technologist2;
if ( ! context || ! context.fillText ) {
return false;
@ -102,6 +102,23 @@
*/
context.fillText( stringFromCharCode( 55358, 56631 ), 0, 0 );
return context.getImageData( 16, 16, 1, 1 ).data[0] !== 0;
case 'emoji4':
/*
* Emoji 4 has the best technologists. So does WordPress!
*
* To test for support, try to render a new emoji (woman technologist: medium skin tone),
* then compare it to how it would look if the browser doesn't render it correctly
* (woman technologist: medium skin tone + personal computer).
*/
context.fillText( stringFromCharCode( 55357, 56425, 55356, 57341, 8205, 55357, 56507), 0, 0 );
technologist = canvas.toDataURL();
context.clearRect( 0, 0, canvas.width, canvas.height );
context.fillText( stringFromCharCode( 55357, 56425, 55356, 57341, 55357, 56507), 0, 0 );
technologist2 = canvas.toDataURL();
return technologist !== technologist2;
}
return false;
@ -115,7 +132,7 @@
document.getElementsByTagName( 'head' )[0].appendChild( script );
}
tests = Array( 'simple', 'flag', 'unicode8', 'diversity', 'unicode9' );
tests = Array( 'simple', 'flag', 'unicode8', 'diversity', 'unicode9', 'emoji4' );
settings.supports = {
everything: true,

View File

@ -1 +1 @@
!function(a,b,c){function d(a){var c,d,e,f,g,h=b.createElement("canvas"),i=h.getContext&&h.getContext("2d"),j=String.fromCharCode;if(!i||!i.fillText)return!1;switch(i.textBaseline="top",i.font="600 32px Arial",a){case"flag":return i.fillText(j(55356,56806,55356,56826),0,0),h.toDataURL().length<3e3?!1:(i.clearRect(0,0,h.width,h.height),i.fillText(j(55356,57331,65039,8205,55356,57096),0,0),c=h.toDataURL(),i.clearRect(0,0,h.width,h.height),i.fillText(j(55356,57331,55356,57096),0,0),d=h.toDataURL(),c!==d);case"diversity":return i.fillText(j(55356,57221),0,0),e=i.getImageData(16,16,1,1).data,f=e[0]+","+e[1]+","+e[2]+","+e[3],i.fillText(j(55356,57221,55356,57343),0,0),e=i.getImageData(16,16,1,1).data,g=e[0]+","+e[1]+","+e[2]+","+e[3],f!==g;case"simple":return i.fillText(j(55357,56835),0,0),0!==i.getImageData(16,16,1,1).data[0];case"unicode8":return i.fillText(j(55356,57135),0,0),0!==i.getImageData(16,16,1,1).data[0];case"unicode9":return i.fillText(j(55358,56631),0,0),0!==i.getImageData(16,16,1,1).data[0]}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity","unicode9"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);
!function(a,b,c){function d(a){var c,d,e,f,g,h,i,j=b.createElement("canvas"),k=j.getContext&&j.getContext("2d"),l=String.fromCharCode;if(!k||!k.fillText)return!1;switch(k.textBaseline="top",k.font="600 32px Arial",a){case"flag":return k.fillText(l(55356,56806,55356,56826),0,0),j.toDataURL().length<3e3?!1:(k.clearRect(0,0,j.width,j.height),k.fillText(l(55356,57331,65039,8205,55356,57096),0,0),c=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(l(55356,57331,55356,57096),0,0),d=j.toDataURL(),c!==d);case"diversity":return k.fillText(l(55356,57221),0,0),e=k.getImageData(16,16,1,1).data,f=e[0]+","+e[1]+","+e[2]+","+e[3],k.fillText(l(55356,57221,55356,57343),0,0),e=k.getImageData(16,16,1,1).data,g=e[0]+","+e[1]+","+e[2]+","+e[3],f!==g;case"simple":return k.fillText(l(55357,56835),0,0),0!==k.getImageData(16,16,1,1).data[0];case"unicode8":return k.fillText(l(55356,57135),0,0),0!==k.getImageData(16,16,1,1).data[0];case"unicode9":return k.fillText(l(55358,56631),0,0),0!==k.getImageData(16,16,1,1).data[0];case"emoji4":return k.fillText(l(55357,56425,55356,57341,8205,55357,56507),0,0),h=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(l(55357,56425,55356,57341,55357,56507),0,0),i=j.toDataURL(),h!==i}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity","unicode9","emoji4"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.7-alpha-38716';
$wp_version = '4.7-alpha-38717';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.