Bug 1231701 - Ship our own variant of EmojiOne on Windows and Linux, r=glandium, r=dolske, r=jfkthame, r=gerv

This patch bundles a color font named "EmojiOne Mozilla", and turn on
the necessary code for including the bundled font, on Linux and Windows.
With that, users of Linux and Windows <=8.0 is able to see color Emoji
on Firefox without support from System.

The font bundled is the v0.2.1 version, generated from the project repo
in

https://github.com/mozilla/emojione-colr

with artwork from the original EmojiOne font and Twemoji,
under CC BY 4.0 license.

Test files, about:license page, and the packager instruction are
modified accordingly.

MozReview-Commit-ID: 2mmxnA0vS3u
This commit is contained in:
Timothy Guan-tin Chien 2016-06-15 21:58:49 +01:00
Родитель 8529c19f12
Коммит 9ed4429e08
10 изменённых файлов: 104 добавлений и 7 удалений

Просмотреть файл

@ -8,6 +8,11 @@ MOZ_APP_VENDOR=Mozilla
MOZ_UPDATER=1
MOZ_PHOENIX=1
if test "$OS_ARCH" = "WINNT" -o \
"$OS_ARCH" = "Linux"; then
MOZ_BUNDLED_FONTS=1
fi
if test "$OS_ARCH" = "WINNT"; then
MOZ_MAINTENANCE_SERVICE=1
if ! test "$HAVE_64BIT_BUILD"; then

Двоичные данные
browser/fonts/EmojiOneMozilla.ttf Normal file

Двоичный файл не отображается.

9
browser/fonts/README.txt Normal file
Просмотреть файл

@ -0,0 +1,9 @@
EmojiOne Mozilla
================
The upstream repository of EmojiOne Mozilla can be found at
https://github.com/mozilla/emojione-colr
Please refer commit history for the current version of the font.
This file purposely omit the version, so there is no need to update it here.

11
browser/fonts/moz.build Normal file
Просмотреть файл

@ -0,0 +1,11 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['OS_ARCH'] in ('WINNT', 'Linux'):
DIST_SUBDIR = ''
FINAL_TARGET_FILES.fonts += [
'EmojiOneMozilla.ttf'
]

Просмотреть файл

@ -48,6 +48,9 @@
@RESPATH@/chrome/@AB_CD@@JAREXT@
@RESPATH@/chrome/@AB_CD@.manifest
@RESPATH@/dictionaries/*
#if defined(XP_WIN) || defined(XP_LINUX)
@RESPATH@/fonts/*
#endif
@RESPATH@/hyphenation/*
@RESPATH@/browser/@PREF_DIR@/firefox-l10n.js
#ifdef HAVE_MAKENSISU

Просмотреть файл

@ -12,6 +12,7 @@ DIRS += [
'base',
'components',
'experiments',
'fonts',
'locales',
'modules',
'themes',

Просмотреть файл

@ -90,7 +90,7 @@ gfxPlatformGtk::gfxPlatformGtk()
mMaxGenericSubstitutions = UNINITIALIZED_VALUE;
#ifdef MOZ_X11
sUseXRender = (GDK_IS_X11_DISPLAY(gdk_display_get_default())) ?
sUseXRender = (GDK_IS_X11_DISPLAY(gdk_display_get_default())) ?
mozilla::Preferences::GetBool("gfx.xrender.enabled") : false;
#endif
@ -202,6 +202,7 @@ gfxPlatformGtk::UpdateFontList()
// out a more general list
static const char kFontDejaVuSans[] = "DejaVu Sans";
static const char kFontDejaVuSerif[] = "DejaVu Serif";
static const char kFontEmojiOneMozilla[] = "EmojiOne Mozilla";
static const char kFontFreeSans[] = "FreeSans";
static const char kFontFreeSerif[] = "FreeSerif";
static const char kFontTakaoPGothic[] = "TakaoPGothic";
@ -214,11 +215,25 @@ gfxPlatformGtk::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
Script aRunScript,
nsTArray<const char*>& aFontList)
{
if (aNextCh == 0xfe0fu) {
// if char is followed by VS16, try for a color emoji glyph
aFontList.AppendElement(kFontEmojiOneMozilla);
}
aFontList.AppendElement(kFontDejaVuSerif);
aFontList.AppendElement(kFontFreeSerif);
aFontList.AppendElement(kFontDejaVuSans);
aFontList.AppendElement(kFontFreeSans);
if (!IS_IN_BMP(aCh)) {
uint32_t p = aCh >> 16;
if (p == 1) { // try color emoji font, unless VS15 (text style) present
if (aNextCh != 0xfe0fu && aNextCh != 0xfe0eu) {
aFontList.AppendElement(kFontEmojiOneMozilla);
}
}
}
// add fonts for CJK ranges
// xxx - this isn't really correct, should use the same CJK font ordering
// as the pref font code
@ -288,7 +303,7 @@ gfxPlatformGtk::LookupLocalFont(const nsAString& aFontName,
aStretch, aStyle);
}
gfxFontEntry*
gfxFontEntry*
gfxPlatformGtk::MakePlatformFont(const nsAString& aFontName,
uint16_t aWeight,
int16_t aStretch,
@ -437,7 +452,7 @@ gfxPlatformGtk::GetPlatformCMSOutputProfile(void *&mem, size_t &size)
// return with nullptr.
if (!dpy)
return;
Window root = gdk_x11_get_default_root_xwindow();
Atom retAtom;

Просмотреть файл

@ -654,6 +654,7 @@ static const char kFontCambriaMath[] = "Cambria Math";
static const char kFontEbrima[] = "Ebrima";
static const char kFontEstrangeloEdessa[] = "Estrangelo Edessa";
static const char kFontEuphemia[] = "Euphemia";
static const char kFontEmojiOneMozilla[] = "EmojiOne Mozilla";
static const char kFontGabriola[] = "Gabriola";
static const char kFontJavaneseText[] = "Javanese Text";
static const char kFontKhmerUI[] = "Khmer UI";
@ -690,6 +691,7 @@ gfxWindowsPlatform::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
{
if (aNextCh == 0xfe0fu) {
aFontList.AppendElement(kFontSegoeUIEmoji);
aFontList.AppendElement(kFontEmojiOneMozilla);
}
// Arial is used as the default fallback for system fallback
@ -701,9 +703,11 @@ gfxWindowsPlatform::GetCommonFallbackFonts(uint32_t aCh, uint32_t aNextCh,
if (aNextCh == 0xfe0eu) {
aFontList.AppendElement(kFontSegoeUISymbol);
aFontList.AppendElement(kFontSegoeUIEmoji);
aFontList.AppendElement(kFontEmojiOneMozilla);
} else {
if (aNextCh != 0xfe0fu) {
aFontList.AppendElement(kFontSegoeUIEmoji);
aFontList.AppendElement(kFontEmojiOneMozilla);
}
aFontList.AppendElement(kFontSegoeUISymbol);
}

Просмотреть файл

@ -191,10 +191,11 @@ HTTP(..) != 1170688.html 1170688-ref.html
# Bug 727276: tests with variation selectors 15 and 16 to control emoji rendering style
== emoji-03.html emoji-03-ref.html
# the next two will fail on OS X 10.6 and on Windows prior to 8.1 because no color emoji font is present,
# and also on Linux/Android/B2G platforms until we have color emoji fonts there
fails-if(OSX==1006||/^Windows\x20NT\x20(5|6\.[0-2])/.test(http.oscpu)||gtkWidget||Android) != emoji-03.html emoji-03-notref.html
fails-if(OSX==1006||/^Windows\x20NT\x20(5|6\.[0-2])/.test(http.oscpu)||gtkWidget||Android) == emoji-04.html emoji-04-ref.html
# the next two will fail on OS X 10.6 because no color emoji font is present,
# and also on Android/B2G platforms until we have color emoji fonts there.
# Tests rely on bundled EmojiOne Mozilla to pass on Windows <8.1 and Linux.
fails-if(OSX==1006||B2G||Android) != emoji-03.html emoji-03-notref.html
fails-if(OSX==1006||B2G||Android) == emoji-04.html emoji-04-ref.html
!= emoji-05.html emoji-05-notref.html
# check that Graphite shaping (bug 631479) is working

Просмотреть файл

@ -88,6 +88,9 @@
<li><a href="about:license#dagre-d3">Dagre-D3 License</a></li>
<li><a href="about:license#dtoa">dtoa License</a></li>
<li><a href="about:license#hunspell-nl">Dutch Spellchecking Dictionary License</a></li>
#if defined(XP_WIN) || defined(XP_LINUX)
<li><a href="about:license#emojione">EmojiOne License</a></li>
#endif
<li><a href="about:license#hunspell-ee">Estonian Spellchecking Dictionary License</a></li>
<li><a href="about:license#expat">Expat License</a></li>
<li><a href="about:license#firebug">Firebug License</a></li>
@ -2965,6 +2968,51 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<hr>
#if defined(XP_WIN) || defined(XP_LINUX)
<h1><a id="emojione"></a>EmojiOne License</h1>
<p>This license applies to the emoji art contained within the bundled
emoji font file.</p>
<pre>
Copyright (c) 2016 Ranks.com Inc.
Copyright (c) 2014 Twitter, Inc and other contributors.
Creative Commons Attribution 4.0 International (CC BY 4.0)
See https://creativecommons.org/licenses/by/4.0/legalcode or
for the human readable summary: https://creativecommons.org/licenses/by/4.0/
You are free to:
Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
Attribution — You must give appropriate credit, provide a link to the license,
and indicate if changes were made. You may do so in any reasonable manner,
but not in any way that suggests the licensor endorses you or your use.
No additional restrictions — You may not apply legal terms or technological
measures that legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in
the public domain or where your use is permitted by an applicable exception or
limitation. No warranties are given. The license may not give you all of the
permissions necessary for your intended use. For example, other rights such as
publicity, privacy, or moral rights may limit how you use the material.
</pre>
<hr>
#endif
<h1><a id="hunspell-ee"></a>Estonian Spellchecking Dictionary License</h1>
<p>This license applies to precursor works to certain files which are