Skip to content

Commit

Permalink
Make rebuilding a bit simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
rsheeter committed Oct 2, 2024
1 parent 124c7d4 commit 8444068
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 63 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ __pycache__/
waveflag
build/
venv/
emojicompat/
66 changes: 3 additions & 63 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,69 +39,9 @@ Edit `NotoColorEmoji.tmpl.ttx.tmpl`
* New flags are added to `wave_list.txt`
* To wave only the new flag delete other entries locally

## CBDT
## Rebuild the fonts

```bash
rm -rf venv # in case you have an old borked venv!
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python size_check.py
rm -rf build/ && time make -j 48
# Should take 2-3 minutes to create noto-emoji/NotoColorEmoji.ttf

mv *.ttf fonts/

# make noflags CBDT font
rm fonts/NotoColorEmoji-noflags.ttf
python drop_flags.py fonts/NotoColorEmoji.ttf
# Build CBDT, COLR, flags-only, and emojicompat fonts
$ ./full_rebuild.sh
```

## COLRv1

```bash
# If you are updating to a new Unicode rev, update configs
python colrv1_generate_configs.py
git diff colrv1/*.toml

# Compile the fonts
(cd colrv1 && rm -rf build/ && time nanoemoji *.toml)
cp colrv1/build/NotoColorEmoji.ttf fonts/Noto-COLRv1.ttf
cp colrv1/build/NotoColorEmoji-noflags.ttf fonts/Noto-COLRv1-noflags.ttf

# Post-process them
python colrv1_postproc.py
```

## Emojicompat

```
# Add support for new sequences per https://github.com/googlefonts/emojicompat#support-new-unicode-sequences
# Install https://github.com/googlefonts/emojicompat in a venv
# Create emojicompat versions of the fonts you made
# Starting from the root of noto-emoji-next:
$ pushd fonts
$ cp NotoColorEmoji.ttf NotoColorEmoji-emojicompat.ttf
$ cp Noto-COLRv1.ttf Noto-COLRv1-emojicompat.ttf
$ emojicompat --op setup --font NotoColorEmoji-emojicompat.ttf
$ emojicompat --op setup --font Noto-COLRv1-emojicompat.ttf
$ emojicompat --op check --font NotoColorEmoji-emojicompat.ttf
$ emojicompat --op check --font Noto-COLRv1-emojicompat.ttf
# The emojicompat --op check step should print something akin to:
3835 items_by_codepoints
0 PUA missing
0 PUA point at wrong glyph
3835 PUA correct
0 Emji entries did NOT match a glyph
```

## Flags only

```bash
$ hb-subset --unicodes-file=flags-only-unicodes.txt \
--output-file=fonts/NotoColorEmoji-flagsonly.ttf \
fonts/NotoColorEmoji.ttf
$ python update_flag_name.py
```
59 changes: 59 additions & 0 deletions full_rebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env bash

set -e
set -v

# We have to have hb-subset on PATH
which hb-subset

# Build the CBDT font

rm -rf venv # in case you have an old borked venv!
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

rm -rf emojicompat
git clone [email protected]:googlefonts/emojicompat.git
pip install emojicompat/

# Validation
python size_check.py
rm -rf build/ && time make -j 48
# Should take 2-3 minutes to create noto-emoji/NotoColorEmoji.ttf

mv *.ttf fonts/

# make noflags CBDT font
rm fonts/NotoColorEmoji-noflags.ttf
python drop_flags.py fonts/NotoColorEmoji.ttf

# Build the COLRv1 font (slow)

python colrv1_generate_configs.py
git diff colrv1/*.toml

# Compile the fonts
# Should take ~20 minutes
(cd colrv1 && rm -rf build/ && time nanoemoji *.toml)
cp colrv1/build/NotoColorEmoji.ttf fonts/Noto-COLRv1.ttf
cp colrv1/build/NotoColorEmoji-noflags.ttf fonts/Noto-COLRv1-noflags.ttf

# Post-process them
python colrv1_postproc.py

# Produce emojicompat variants
# Add support for new sequences per https://github.com/googlefonts/emojicompat#support-new-unicode-sequences

pushd fonts
cp NotoColorEmoji.ttf NotoColorEmoji-emojicompat.ttf
cp Noto-COLRv1.ttf Noto-COLRv1-emojicompat.ttf
emojicompat --op setup --font NotoColorEmoji-emojicompat.ttf
emojicompat --op setup --font Noto-COLRv1-emojicompat.ttf
emojicompat --op check --font NotoColorEmoji-emojicompat.ttf
emojicompat --op check --font Noto-COLRv1-emojicompat.ttf

hb-subset --unicodes-file=flags-only-unicodes.txt \
--output-file=fonts/NotoColorEmoji-flagsonly.ttf \
fonts/NotoColorEmoji.ttf
python update_flag_name.py

0 comments on commit 8444068

Please sign in to comment.