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.



git-svn-id: https://develop.svn.wordpress.org/trunk@38717 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2016-10-04 03:23:22 +00:00
parent 5a6cfb0bb7
commit 2f4f5aac44
3 changed files with 23 additions and 6 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.
@ -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

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,