Skip to content

Commit

Permalink
New emoji icons. Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelngs committed Apr 12, 2020
1 parent 5503c06 commit 6c55e11
Show file tree
Hide file tree
Showing 6,305 changed files with 67,075 additions and 1,859 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 0 additions & 9 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
# This is the official list of Noto authors for copyright
# purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.

# Names should be added to this file as:
# Name or Organization <email address>
# The email address is not required for organizations.

Google Inc.
Arjen Nienhuis <[email protected]> # SVG cleanup
12 changes: 6 additions & 6 deletions AppleColorEmoji.tmpl.ttx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<head>
<!-- Most of this table will be recalculated by the compiler -->
<tableVersion value="1.0"/>
<fontRevision value="2.017"/>
<fontRevision value="2.019"/>
<checkSumAdjustment value="0x4d5a161a"/>
<magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00001011"/>
Expand Down Expand Up @@ -231,7 +231,7 @@

<name>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
Copyright 2013 Apple Inc.
Copyright Apple Inc.
</namerecord>
<namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
Apple Color Emoji
Expand All @@ -246,13 +246,13 @@
Apple Color Emoji
</namerecord>
<namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
Version 2.017;GOOG;noto-emoji:20180810:f1da3bc656f9
Version 2.019;GOOG;noto-emoji:20200307:BETA
</namerecord>
<namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
AppleColorEmoji
</namerecord>
<namerecord nameID="7" platformID="3" platEncID="1" langID="0x409">
Apple is a trademark of Apple Inc.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries.
</namerecord>
<namerecord nameID="8" platformID="3" platEncID="1" langID="0x409">
Apple, Inc.
Expand All @@ -264,10 +264,10 @@
Color emoji font using CBDT glyph data.
</namerecord>
<namerecord nameID="11" platformID="3" platEncID="1" langID="0x409">
http://www.google.com/get/noto/
https://developer.apple.com/
</namerecord>
<namerecord nameID="12" platformID="3" platEncID="1" langID="0x409">
http://www.google.com/get/noto/
https://developer.apple.com/
</namerecord>
<namerecord nameID="13" platformID="3" platEncID="1" langID="0x409">
This Font Software is licensed under the SIL Open Font License, Version 1.1. This Font Software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the SIL Open Font License for the specific language, permissions and limitations governing your use of this Font Software.
Expand Down
6 changes: 3 additions & 3 deletions AppleColorEmojiSvg.tmpl.ttx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@

<name>
<namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
Copyright 2015 Apple Inc.
Copyright Apple Inc.
</namerecord>
<namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
Apple Color Emoji SVG
Expand All @@ -151,10 +151,10 @@
AppleColorEmojiSVG
</namerecord>
<namerecord nameID="7" platformID="3" platEncID="1" langID="0x409">
Apple is a trademark of Apple Inc. and may be registered in certain jurisdictions.
Apple is a trademark of Apple Inc., registered in the U.S. and other countries.
</namerecord>
<namerecord nameID="11" platformID="3" platEncID="1" langID="0x409">
http://code.google.com/p/noto/
https://developer.apple.com/
</namerecord>
<namerecord nameID="13" platformID="3" platEncID="1" langID="0x409">
This Font Software is licensed under the SIL Open Font License, Version 1.1. This Font Software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the SIL Open Font License for the specific language, permissions and limitations governing your use of this Font Software.
Expand Down
27 changes: 0 additions & 27 deletions CONTRIBUTING.md

This file was deleted.

11 changes: 0 additions & 11 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# People who have agreed to one of the CLAs and can contribute patches.
# The AUTHORS file lists the copyright holders; this file
# lists people. For example, Google employees are listed here
# but not in AUTHORS, because Google holds the copyright.
#
# https://developers.google.com/open-source/cla/individual
# https://developers.google.com/open-source/cla/corporate
#
# Names should be added to this file as:
# Name <email address>

Arjen Nienhuis <[email protected]>
Behdad Esfahbod <[email protected]>
Doug Felt <[email protected]>
Expand Down
4 changes: 0 additions & 4 deletions Gemfile

This file was deleted.

121 changes: 19 additions & 102 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ font: $(EMOJI).ttf

CFLAGS = -std=c99 -Wall -Wextra `pkg-config --cflags --libs cairo`
LDFLAGS = -lm `pkg-config --libs cairo`
PNGQUANTDIR := third_party/pngquant
PNGQUANT := $(PNGQUANTDIR)/pngquant

PNGQUANT = pngquant
PYTHON = python3
PNGQUANTFLAGS = --speed 1 --skip-if-larger --quality 85-95 --force
BODY_DIMENSIONS = 136x128
IMOPS := -size $(BODY_DIMENSIONS) canvas:none -compose copy -gravity center
Expand All @@ -37,65 +38,17 @@ ADD_GLYPHS_FLAGS = -a emoji_aliases.txt
PUA_ADDER = map_pua_emoji.py
VS_ADDER = add_vs_cmap.py # from nototools

EMOJI_SRC_DIR := build/dump/unicode
FLAGS_SRC_DIR := third_party/region-flags/png
EMOJI_SRC_DIR ?= png/128

BUILD_DIR := build
EMOJI_DIR := $(BUILD_DIR)/emoji
FLAGS_DIR := $(BUILD_DIR)/flags
RESIZED_FLAGS_DIR := $(BUILD_DIR)/resized_flags
RENAMED_FLAGS_DIR := $(BUILD_DIR)/renamed_flags
QUANTIZED_DIR := $(BUILD_DIR)/quantized_pngs
COMPRESSED_DIR := $(BUILD_DIR)/compressed_pngs

# Unknown flag is PUA fe82b
# Note, we omit some flags below that we support via aliasing instead.

LIMITED_FLAGS = CN DE ES FR GB IT JP KR RU US
SELECTED_FLAGS = AC AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ \
BA BB BD BE BF BG BH BI BJ BM BN BO BR BS BT BW BY BZ \
CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ \
DE DJ DK DM DO DZ \
EC EE EG EH ER ES ET EU \
FI FJ FK FM FO FR \
GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY \
HK HN HR HT HU \
IC ID IE IL IM IN IO IQ IR IS IT \
JE JM JO JP \
KE KG KH KI KM KN KP KR KW KY KZ \
LA LB LC LI LK LR LS LT LU LV LY \
MA MC MD ME MG MH MK ML MM MN MO MP MR MS MT MU MV MW MX MY MZ \
NA NC NE NF NG NI NL NO NP NR NU NZ \
OM \
PA PE PF PG PH PK PL PM PN PR PS PT PW PY \
QA \
RO RS RU RW \
SA SB SC SD SE SG SH SI SK SL SM SN SO SR SS ST SV SX SY SZ \
TA TC TD TG TH TJ TK TL TM TN TO TR TT TV TW TZ \
UA UG UN US UY UZ \
VA VC VE VG VI VN VU \
WF WS \
XK \
YE YT \
ZA ZM ZW \
GB-ENG GB-SCT GB-WLS

ALL_FLAGS = $(basename $(notdir $(wildcard $(FLAGS_SRC_DIR)/*.png)))

FLAGS = $(SELECTED_FLAGS)

FLAG_NAMES = $(FLAGS:%=%.png)
FLAG_FILES = $(addprefix $(FLAGS_DIR)/, $(FLAG_NAMES))
RESIZED_FLAG_FILES = $(addprefix $(RESIZED_FLAGS_DIR)/, $(FLAG_NAMES))

FLAG_GLYPH_NAMES = $(shell ./flag_glyph_name.py $(FLAGS))
RENAMED_FLAG_NAMES = $(FLAG_GLYPH_NAMES:%=emoji_%.png)
RENAMED_FLAG_FILES = $(addprefix $(RENAMED_FLAGS_DIR)/, $(RENAMED_FLAG_NAMES))

EMOJI_NAMES = $(notdir $(wildcard $(EMOJI_SRC_DIR)/emoji_u*.png))
EMOJI_FILES= $(addprefix $(EMOJI_DIR)/,$(EMOJI_NAMES)))

ALL_NAMES = $(EMOJI_NAMES) $(RENAMED_FLAG_NAMES)
ALL_NAMES = $(EMOJI_NAMES)

ALL_QUANTIZED_FILES = $(addprefix $(QUANTIZED_DIR)/, $(ALL_NAMES))
ALL_COMPRESSED_FILES = $(addprefix $(COMPRESSED_DIR)/, $(ALL_NAMES))
Expand All @@ -120,12 +73,6 @@ endif

emoji: $(EMOJI_FILES)

flags: $(FLAG_FILES)

resized_flags: $(RESIZED_FLAG_FILES)

renamed_flags: $(RENAMED_FLAG_FILES)

quantized: $(ALL_QUANTIZED_FILES)

compressed: $(ALL_COMPRESSED_FILES)
Expand All @@ -147,14 +94,9 @@ ifdef MISSING_ADDER
endif


$(EMOJI_DIR) $(EMOJI_SRC_DIR) $(FLAGS_DIR) $(RESIZED_FLAGS_DIR) $(RENAMED_FLAGS_DIR) $(QUANTIZED_DIR) $(COMPRESSED_DIR):
$(EMOJI_DIR) $(QUANTIZED_DIR) $(COMPRESSED_DIR):
mkdir -p "$@"

$(PNGQUANT):
$(MAKE) -C $(PNGQUANTDIR)

waveflag: waveflag.c
$(CC) $< -o $@ $(CFLAGS) $(LDFLAGS)

# imagemagick's -extent operator munges the grayscale images in such a fashion
# that while it can display them correctly using libpng12, chrome and gimp using
Expand All @@ -168,26 +110,7 @@ waveflag: waveflag.c
$(EMOJI_DIR)/%.png: $(EMOJI_SRC_DIR)/%.png | $(EMOJI_DIR)
@convert $(IMOPS) "$<" -composite "PNG32:$@"

$(FLAGS_DIR)/%.png: $(FLAGS_SRC_DIR)/%.png ./waveflag $(PNGQUANT) | $(FLAGS_DIR)
@./waveflag $(FLAGS_DIR)/ "$<"

$(RESIZED_FLAGS_DIR)/%.png: $(FLAGS_DIR)/%.png | $(RESIZED_FLAGS_DIR)
@convert $(IMOPS) "$<" -composite "PNG32:$@"

flag-symlinks: $(RESIZED_FLAG_FILES) | $(RENAMED_FLAGS_DIR)
@$(subst ^, , \
$(join \
$(FLAGS:%=ln^-fs^../resized_flags/%.png^), \
$(RENAMED_FLAG_FILES:%=%; ) \
) \
)

$(RENAMED_FLAG_FILES): | flag-symlinks

$(QUANTIZED_DIR)/%.png: $(RENAMED_FLAGS_DIR)/%.png $(PNGQUANT) | $(QUANTIZED_DIR)
@($(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"; case "$$?" in "98"|"99") echo "reuse $<"; cp $< $@;; *) exit "$$?";; esac)

$(QUANTIZED_DIR)/%.png: $(EMOJI_DIR)/%.png $(PNGQUANT) | $(QUANTIZED_DIR)
$(QUANTIZED_DIR)/%.png: $(EMOJI_DIR)/%.png | $(QUANTIZED_DIR)
@($(PNGQUANT) $(PNGQUANTFLAGS) -o "$@" "$<"; case "$$?" in "98"|"99") echo "reuse $<";cp $< $@;; *) exit "$$?";; esac)

$(COMPRESSED_DIR)/%.png: $(QUANTIZED_DIR)/%.png | check_compress_tool $(COMPRESSED_DIR)
Expand All @@ -201,41 +124,35 @@ endif
# Make 3.81 can endless loop here if the target is missing but no
# prerequisite is updated and make has been invoked with -j, e.g.:
# File `font' does not exist.
# File `NotoColorEmoji.tmpl.ttx' does not exist.
# File `AppleColorEmoji.tmpl.ttx' does not exist.
# File `font' does not exist.
# File `NotoColorEmoji.tmpl.ttx' does not exist.
# File `AppleColorEmoji.tmpl.ttx' does not exist.
# ...
# Run make without -j if this happens.

%.ttx: %.ttx.tmpl $(ADD_GLYPHS) $(ALL_COMPRESSED_FILES)
@python $(ADD_GLYPHS) -f "$<" -o "$@" -d "$(COMPRESSED_DIR)" $(ADD_GLYPHS_FLAGS)
@$(PYTHON) $(ADD_GLYPHS) -f "$<" -o "$@" -d "$(COMPRESSED_DIR)" $(ADD_GLYPHS_FLAGS)

%.ttf: %.ttx
@rm -f "$@"
ttx "$<"

%.dump: $(EMOJI_SRC_DIR)
@ruby -e " \
require './emoji_extractor.rb'; \
unicode_version = 11; \
emoji_extractor = EmojiExtractor.new(unicode_version); \
emoji_extractor.download_sequences; \
emoji_extractor.extract"

$(EMOJI).ttf: $(EMOJI).dump $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) \
$(EMOJI).ttf: $(EMOJI).tmpl.ttf $(EMOJI_BUILDER) $(PUA_ADDER) \
$(ALL_COMPRESSED_FILES) | check_vs_adder
@python $(EMOJI_BUILDER) $(SMALL_METRICS) -V $< "$@" "$(COMPRESSED_DIR)/emoji_u"
@python $(PUA_ADDER) "$@" "$@-with-pua"
@$(PYTHON) $(EMOJI_BUILDER) $(SMALL_METRICS) -V $< "$@" "$(COMPRESSED_DIR)/emoji_u"
@$(PYTHON) $(PUA_ADDER) "$@" "$@-with-pua"
@$(VS_ADDER) -vs 2640 2642 2695 --dstdir '.' -o "$@-with-pua-varsel" "$@-with-pua"
@mv "$@-with-pua-varsel" "$@"
@rm "$@-with-pua"

install: font
mkdir -p $$HOME/.local/share/fonts
cp -f AppleColorEmoji.ttf $$HOME/.local/share/fonts/

clean:
rm -f $(EMOJI).ttf $(EMOJI).tmpl.ttf $(EMOJI).tmpl.ttx
rm -f waveflag
rm -rf $(BUILD_DIR)

.SECONDARY: $(EMOJI_FILES) $(FLAG_FILES) $(RESIZED_FLAG_FILES) $(RENAMED_FLAG_FILES) \
$(ALL_QUANTIZED_FILES) $(ALL_COMPRESSED_FILES)
.SECONDARY: $(EMOJI_FILES) $(ALL_QUANTIZED_FILES) $(ALL_COMPRESSED_FILES)

.PHONY: clean flags emoji renamed_flags quantized compressed check_compress_tool
.PHONY: clean compressed check_compress_tool emoji install quantized
59 changes: 36 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
# apple-emoji-linux
Apple Color Emoji for Linux
![AppleColorEmojiLinux](images/screenshot.png)
# Apple Color Emoji for Linux
Color and Black-and-White Apple color emoji fonts, and tools for working with them.

![Screenshot](preview.png)
## Disclaimer

### Getting Started
The code provided is for educational purposes only. Apple is a trademark of Apple Inc., registered in the U.S. and other countries.

1. Clone this repo
## Building AppleColorEmoji

```sh
$ git clone [email protected]:samuelngs/apple-emoji-linux.git
```
Building AppleColorEmoji currently requires a Python 2.x wide build. To build
the emoji font you will require a few files from nototools. Clone a copy from
https://github.com/googlei18n/nototools and either put it in your PYTHONPATH or
use 'python setup.py develop' ('install' currently won't fully install all the
data used by nototools). You will also need fontTools, get it from
https://github.com/behdad/fonttools.git.

2. Install build dependencies
Then run `make` and `make install`. AppleColorEmoji is the default target.
It's suggested to use -j, especially if you are using zopflipng for compression.
Intermediate products (compressed image files, for example) will be put into a
build subdirectory; the font will be at the top level.

```sh
$ bundle install
```
## Using AppleColorEmoji

3. Now, go to your Mac. Find the font `Apple Color Emoji.ttc` under `/System/Library/Fonts` or `/Library/Fonts` and make a copy of the file to the `source` folder.
AppleColorEmoji uses the CBDT/CBLC color font format, which is supported by Android
and Chrome/Chromium OS. Windows supports it starting with Windows 10 Anniversary
Update in Chome and Edge. On macOS, only Chrome supports it, while on Linux it will
support it with some fontconfig tweaking.

4. Build `fonts/AppleColorEmoji.ttf` and `fonts/AppleEmoji-Regular.ttf`
## Color emoji assets

```sh
$ make -j
```
The assets provided in the repo are all those used to build the AppleColorEmoji
font. Note however that AppleColorEmoji often uses the same assets to represent
different character sequences-- notably, most gender-neutral characters or
sequences are represented using assets named after one of the gendered
sequences. This means that some sequences appear to be missing. Definitions of
the aliasing used appear in the `emoji_aliases.txt` file.

5. Copy `fonts/AppleColorEmoji.ttf` and `fonts/AppleEmoji-Regular.ttf` to `~/.local/share/fonts`
Also note that the images in the font might differ from the original assets. In
particular the flag images in the font are PNG images to which transforms have
been applied to standardize the size and generate the wave and border shadow. We
do not have SVG versions that reflect these transforms.

### Credits
## Credits

- https://github.com/github/gemoji
- https://github.com/mattermost/mattermost-webapp
- https://github.com/googlei18n/noto-emoji
- https://github.com/googlei18n/nototools

### Disclaimer
## License

The code provided is for educational purposes only. Apple is a trademark of Apple Inc., registered in the U.S. and other countries.
- Emoji fonts (under the fonts subdirectory) are under the [SIL Open Font License, version 1.1](fonts/LICENSE).
- Tools and some image resources are under the [Apache license, version 2.0](./LICENSE).
Loading

0 comments on commit 6c55e11

Please sign in to comment.