Merge pull request from googlefonts/bug

Rebuild with mistaken change to 1fae5 reverted
This commit is contained in:
Rod 2023-11-27 13:01:41 -08:00 committed by GitHub
commit 20e155dc97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 52 additions and 19 deletions

View file

@ -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"/>
@ -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

View file

@ -16,6 +16,7 @@ from nototools import add_vs_cmap
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
@ -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)
@ -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)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

(image error) Size: 2.4 KiB

After

(image error) Size: 3.1 KiB

Binary file not shown.

Before

(image error) Size: 681 B

After

(image error) Size: 886 B

Binary file not shown.

Before

(image error) Size: 9.7 KiB

After

(image error) Size: 11 KiB

Binary file not shown.

Before

(image error) Size: 1.4 KiB

After

(image error) Size: 1.8 KiB

View file

@ -1,3 +1,4 @@
fonttools>=4.7.0
notofonttools>=0.2.17
nanoemoji >= 0.14.3
pytest>=7.4

View file

@ -2,9 +2,23 @@
<!-- Generator: Adobe Illustrator 26.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Raised-Hand" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
y="0px" viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
<path style="fill:#EB8F00;" d="M63.77,118.84H63.6c-3.99,0-8.01-0.36-11.93-1.07l0.54-2.95c3.75,0.68,7.58,1.03,11.4,1.03h0.17
V118.84z M75.71,117.74l-0.55-2.95c3.78-0.7,7.48-1.76,10.98-3.14l1.1,2.79C83.56,115.89,79.68,117,75.71,117.74z M40.12,114.54
c-3.81-1.47-7.41-3.29-10.72-5.43l1.63-2.52c3.13,2.03,6.55,3.76,10.17,5.15L40.12,114.54z M97.91,108.92l-1.65-2.51
<g>
<g id="neutral-face_00000080885983375266818540000014933881844342678202_">
<path id="mouth_00000064329789738385436900000009578621846817519233_" style="fill:#823E00;" d="M79,88H49c-2.21,0-4-1.79-4-4
s1.79-4,4-4h30c2.21,0,4,1.79,4,4S81.21,88,79,88z"/>
</g>
<path style="fill:#AF6300;" d="M44.67,45.94L44.67,45.94c-4.19,0-8,3.54-8,9.42s3.81,9.42,8,9.42l0,0c4.19,0,8-3.54,8-9.42
S48.86,45.94,44.67,45.94z"/>
<path style="fill:#AF6300;" d="M83.02,45.94L83.02,45.94c-4.19,0-8,3.54-8,9.42s3.81,9.42,8,9.42l0,0c4.19,0,8-3.54,8-9.42
S87.21,45.94,83.02,45.94z"/>
</g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="63.7232" y1="118.8388" x2="63.7232" y2="6.9618">
<stop offset="0.015" style="stop-color:#EB8F00"/>
<stop offset="1" style="stop-color:#FFD54F"/>
</linearGradient>
<path style="fill:url(#SVGID_1_);" d="M63.77,118.84H63.6c-3.99,0-8.01-0.36-11.93-1.07l0.54-2.95c3.75,0.68,7.58,1.03,11.4,1.03
h0.17V118.84z M75.71,117.74l-0.55-2.95c3.78-0.7,7.48-1.76,10.98-3.14l1.1,2.79C83.56,115.89,79.68,117,75.71,117.74z
M40.12,114.54c-3.81-1.47-7.41-3.29-10.72-5.43l1.63-2.52c3.13,2.03,6.55,3.76,10.17,5.15L40.12,114.54z M97.91,108.92l-1.65-2.51
c2-1.32,3.92-2.77,5.69-4.33c1.05-0.93,2.08-1.92,3.04-2.94l2.18,2.07c-1.02,1.08-2.11,2.13-3.23,3.12
C102.06,105.99,100.03,107.53,97.91,108.92z M20.09,101.47c-2.8-2.91-5.24-6.15-7.25-9.63l2.6-1.5c1.89,3.27,4.18,6.32,6.81,9.05
L20.09,101.47z M114.37,91.56l-2.6-1.49c1.86-3.24,3.37-6.75,4.47-10.44l2.88,0.86C117.95,84.39,116.35,88.12,114.37,91.56z
@ -17,23 +31,16 @@
c1.05,0.93,2.06,1.9,3.01,2.89L104.78,26.32z M30.87,19.31l-1.64-2.51c3.29-2.15,6.89-3.99,10.7-5.47l1.09,2.8
C37.41,15.53,33.99,17.27,30.87,19.31z M85.84,13.96c-3.5-1.34-7.21-2.36-11.01-3.03l0.52-2.96c3.99,0.7,7.88,1.78,11.57,3.19
L85.84,13.96z M52.02,11.02l-0.54-2.95c3.92-0.72,7.93-1.1,11.93-1.11l0.01,3C59.6,9.97,55.77,10.33,52.02,11.02z"/>
<g id="neutral-face_2_">
<path id="mouth_96_" style="fill:#422B0D;" d="M79,88H49c-2.21,0-4-1.79-4-4s1.79-4,4-4h30c2.21,0,4,1.79,4,4S81.21,88,79,88z"/>
</g>
<path style="fill:#422B0D;" d="M44.67,45.94L44.67,45.94c-4.19,0-8,3.54-8,9.42s3.81,9.42,8,9.42l0,0c4.19,0,8-3.54,8-9.42
S48.86,45.94,44.67,45.94z"/>
<g>
<g id="peepers_57_">
<path style="fill:#896024;" d="M44.28,49.87L44.28,49.87c-1.03-0.72-2.58-0.49-3.58,0.95c-1,1.45-0.67,2.97,0.36,3.69l0,0
c1.03,0.72,2.58,0.49,3.58-0.95C45.64,52.11,45.31,50.59,44.28,49.87z"/>
<g id="peepers_00000000943899703814137150000008559515959999254185_">
<path style="opacity:0.4;fill:#FFFFFF;" d="M44.28,49.87L44.28,49.87c-1.03-0.72-2.58-0.49-3.58,0.95c-1,1.45-0.67,2.97,0.36,3.69
l0,0c1.03,0.72,2.58,0.49,3.58-0.95C45.64,52.11,45.31,50.59,44.28,49.87z"/>
</g>
</g>
<path style="fill:#422B0D;" d="M83.02,45.94L83.02,45.94c-4.19,0-8,3.54-8,9.42s3.81,9.42,8,9.42l0,0c4.19,0,8-3.54,8-9.42
S87.21,45.94,83.02,45.94z"/>
<g>
<g id="peepers_56_">
<path style="fill:#896024;" d="M82.63,49.87L82.63,49.87c-1.03-0.72-2.58-0.49-3.58,0.95c-1,1.45-0.67,2.97,0.36,3.69l0,0
c1.03,0.72,2.58,0.49,3.58-0.95C84,52.11,83.67,50.59,82.63,49.87z"/>
<g id="peepers_00000032608173352806590750000000877398772088101567_">
<path style="opacity:0.4;fill:#FFFFFF;" d="M82.63,49.87L82.63,49.87c-1.03-0.72-2.58-0.49-3.58,0.95c-1,1.45-0.67,2.97,0.36,3.69
l0,0c1.03,0.72,2.58,0.49,3.58-0.95C84,52.11,83.67,50.59,82.63,49.87z"/>
</g>
</g>
</svg>

Before

(image error) Size: 2.9 KiB

After

(image error) Size: 3.4 KiB

View file

@ -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"