Skip to content

Commit

Permalink
Merge pull request #447 from googlefonts/bug
Browse files Browse the repository at this point in the history
Rebuild with mistaken change to 1fae5 reverted
  • Loading branch information
rsheeter authored Nov 27, 2023
2 parents 144e84d + 8a5d56d commit 6b23602
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 19 deletions.
4 changes: 2 additions & 2 deletions NotoColorEmoji.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.040"/>
<fontRevision value="2.041"/>
<checkSumAdjustment value="0x4d5a161a"/>
<magicNumber value="0x5f0f3cf5"/>
<flags value="00000000 00001011"/>
Expand Down Expand Up @@ -246,7 +246,7 @@
Noto Color Emoji
</namerecord>
<namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
Version 2.040;GOOG;noto-emoji:20231016:92a58ea6b2cfcad2560c2271855bc9c77eab6c51
Version 2.041;GOOG;noto-emoji:20231120:69db1642752d1457ed8cfa6880781a9f36c9722e
</namerecord>
<namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
NotoColorEmoji
Expand Down
13 changes: 13 additions & 0 deletions colrv1_postproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from nototools import font_data
from nototools import unicode_data
from pathlib import Path
import re

from colrv1_add_soft_light_to_flags import add_soft_light_to_flags

Expand Down Expand Up @@ -291,6 +292,16 @@ def _set_no_font_embedding_restrictions(colr_font):
colr_font["OS/2"].fsType = 0


def _set_head_version_to_name_version(colr_font):
# head.fontRevision and the version on name 5 should match
name_version = colr_font['name'].getName(5, 3, 1, 0x409)
assert name_version is not None, "No version found in 'name'"
name_version = name_version.toUnicode()
match = re.match(r'^Version (\d+[.]\d+);GOOG;', name_version)
assert match is not None, f"Unable to parse version from '{name_version}'"
colr_font["head"].fontRevision = float(match.group(1))


def _font(path, check_fn, check_fail_str):
assert path.is_file(), path
font = ttLib.TTFont(path)
Expand Down Expand Up @@ -324,6 +335,8 @@ def main(_):

_set_no_font_embedding_restrictions(colr_font)

_set_head_version_to_name_version(colr_font)

print("Writing", colr_file)
colr_font.save(colr_file)

Expand Down
Binary file modified fonts/Noto-COLRv1-emojicompat.ttf
Binary file not shown.
Binary file modified fonts/Noto-COLRv1-noflags.ttf
Binary file not shown.
Binary file modified fonts/Noto-COLRv1.ttf
Binary file not shown.
Binary file modified fonts/NotoColorEmoji-emojicompat.ttf
Binary file not shown.
Binary file modified fonts/NotoColorEmoji-noflags.ttf
Binary file not shown.
Binary file modified fonts/NotoColorEmoji.ttf
Binary file not shown.
Binary file modified fonts/NotoColorEmoji_WindowsCompatible.ttf
Binary file not shown.
Binary file modified png/128/emoji_u1fae5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified png/32/emoji_u1fae5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified png/512/emoji_u1fae5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified png/72/emoji_u1fae5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fonttools>=4.7.0
notofonttools>=0.2.17
nanoemoji >= 0.14.3
pytest>=7.4
39 changes: 23 additions & 16 deletions svg/emoji_u1fae5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion tests/basic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,16 @@ def test_consistent_fstype():
fstypes.add(fstype)
debug_fstypes.append(f"{font_file.name} fsType {fstype}")
debug_fstypes = "\n".join(debug_fstypes)
assert fstypes == {0}, f"All fsType's should be 0, found\n{debug_fstypes}"
assert fstypes == {0}, f"All fsType's should be 0, found\n{debug_fstypes}"

def test_has_emojicompat():
fonts_dir = Path("fonts")
assert fonts_dir.is_dir()

ec_fonts = set(fonts_dir.rglob("*-emojicompat.ttf"))
assert {f.name for f in ec_fonts} == {"Noto-COLRv1-emojicompat.ttf", "NotoColorEmoji-emojicompat.ttf"}

for font_file in ec_fonts:
font = ttLib.TTFont(font_file)
assert "meta" in font, f"{font_file.name} should have a meta table"
assert "Emji" in font["meta"].data, f"{font_file.name} should have emojicompat data"

0 comments on commit 6b23602

Please sign in to comment.