mirror of
https://github.com/googlefonts/noto-emoji.git
synced 2026-09-20 21:58:17 +00:00
Merge pull request #558 from googlefonts/emoji18
Some checks are pending
Continuous Test + Deploy / health_check (push) Waiting to run
Some checks are pending
Continuous Test + Deploy / health_check (push) Waiting to run
Add Emoji 18 fonts
This commit is contained in:
commit
43bac1a127
24 changed files with 186 additions and 57 deletions
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
3D/fonts/*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
|
@ -10,10 +10,14 @@ on:
|
|||
jobs:
|
||||
health_check:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
lfs: true
|
||||
- name: Set up Python 3
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
|
||||
- name: Install FontTools
|
||||
run: pip install fonttools pytest
|
||||
- name: pytest
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
2D/fonts/NotoColorEmoji-flagsonly.ttf
Normal file
BIN
2D/fonts/NotoColorEmoji-flagsonly.ttf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
92
3D/fonts/LICENSE
Normal file
92
3D/fonts/LICENSE
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
This Font Software is licensed under the SIL Open Font License,
|
||||
Version 1.1.
|
||||
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font
|
||||
creation efforts of academic and linguistic communities, and to
|
||||
provide a free and open framework in which fonts may be shared and
|
||||
improved in partnership with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply to
|
||||
any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software
|
||||
components as distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to,
|
||||
deleting, or substituting -- in part or in whole -- any of the
|
||||
components of the Original Version, by changing formats or by porting
|
||||
the Font Software to a new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed,
|
||||
modify, redistribute, and sell modified and unmodified copies of the
|
||||
Font Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components, in
|
||||
Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the
|
||||
corresponding Copyright Holder. This restriction only applies to the
|
||||
primary font name as presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created using
|
||||
the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
3
3D/fonts/Noto-3D-128-flagsonly.ttf
Normal file
3
3D/fonts/Noto-3D-128-flagsonly.ttf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6b6f85282ca413efcdf2cbdc6ca3b20f958e3faf4ec39974a9d37557df39ccb9
|
||||
size 7208244
|
||||
3
3D/fonts/Noto-3D-128-noflags.ttf
Normal file
3
3D/fonts/Noto-3D-128-noflags.ttf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0fdfec3dbefb214750465b5c17ac8f7c47286fc0c88d8605c12cd45e86613f7c
|
||||
size 140952312
|
||||
3
3D/fonts/Noto-3D-128.ttf
Normal file
3
3D/fonts/Noto-3D-128.ttf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6f4312a7c02d0c9de88095ee65e320ffe9316d2d8d56e4c515e7181fca5ed439
|
||||
size 147882884
|
||||
3
3D/fonts/Noto-3D-192-flagsonly.ttf
Normal file
3
3D/fonts/Noto-3D-192-flagsonly.ttf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1d67d40f3cdbf285b1732d7fa6abbe785d40a810fcfc26c9bf738e8cb493454e
|
||||
size 11040224
|
||||
3
3D/fonts/Noto-3D-192-noflags.ttf
Normal file
3
3D/fonts/Noto-3D-192-noflags.ttf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5ca3f637dfebc8da8f887ffc4e5fcd433802f93994f813f7ff9f179e6a8dd625
|
||||
size 218345004
|
||||
3
3D/fonts/Noto-3D-192.ttf
Normal file
3
3D/fonts/Noto-3D-192.ttf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:278e14dfc2c7f528f42a7e7d34eb1e302250d6b400e0fceb07a4ad2da72b617a
|
||||
size 228959280
|
||||
3
3D/fonts/Noto-3D-watch-flagsonly.ttf
Normal file
3
3D/fonts/Noto-3D-watch-flagsonly.ttf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f3a4c6f6d84354209abffef719d34d2661e7e64ad8900cd414b2f334ed92736f
|
||||
size 1810272
|
||||
3
3D/fonts/Noto-3D-watch-noflags.ttf
Normal file
3
3D/fonts/Noto-3D-watch-noflags.ttf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d141379ae1339189b3d52e4e8e4b1a58d6d1ef04ea1ffcf6ab6ea50c4889b628
|
||||
size 33855964
|
||||
3
3D/fonts/Noto-3D-watch.ttf
Normal file
3
3D/fonts/Noto-3D-watch.ttf
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d5934469c144a951d26be9ae7173a702a6231418e18bfb395fbda3683891838c
|
||||
size 35598452
|
||||
|
|
@ -13,8 +13,12 @@ def name(font, name_id):
|
|||
|
||||
|
||||
def main():
|
||||
font_files = sorted(p for p in (Path(__file__).parent / "fonts").iterdir() if p.suffix == ".ttf")
|
||||
max_name_len = max(len(p.name) for p in font_files)
|
||||
font_files = []
|
||||
for sub_dir in [Path(__file__).parent / "2D" / "fonts", Path(__file__).parent / "3D" / "fonts"]:
|
||||
if sub_dir.is_dir():
|
||||
font_files.extend(sub_dir.rglob("*.ttf"))
|
||||
font_files.sort(key=lambda p: p.name)
|
||||
max_name_len = max(len(p.name) for p in font_files) if font_files else 0
|
||||
|
||||
for font_file in font_files:
|
||||
font = ttLib.TTFont(font_file)
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -11,53 +11,51 @@ NAME_ID_POSTSCRIPT_NAME = 6
|
|||
|
||||
|
||||
def test_consistent_version():
|
||||
fonts_dir = Path("fonts")
|
||||
assert fonts_dir.is_dir()
|
||||
for sub_dir in [Path("2D/fonts"), Path("3D/fonts")]:
|
||||
assert sub_dir.is_dir()
|
||||
|
||||
name5_re = re.compile(r"^Version (\d+.\d+);GOOG;noto-emoji:\d+:[a-z0-9]+$")
|
||||
name5_re = re.compile(r"^Version (\d+.\d+);GOOG;noto-emoji:\d+:[a-z0-9]+$")
|
||||
|
||||
debug_versions = []
|
||||
versions = set()
|
||||
for font_file in fonts_dir.rglob("*.ttf"):
|
||||
font = ttLib.TTFont(font_file)
|
||||
head_ver = f"{font['head'].fontRevision:.03f}"
|
||||
versions.add(head_ver)
|
||||
debug_versions.append(f"{font_file.name} head {head_ver}")
|
||||
for name in font["name"].names:
|
||||
# name 5 is version
|
||||
if name.nameID != 5:
|
||||
continue
|
||||
if not name.isUnicode():
|
||||
continue
|
||||
match = name5_re.match(name.toUnicode())
|
||||
assert match is not None, f"{name.toUnicode()} is malformed"
|
||||
versions.add(match.group(1))
|
||||
debug_versions.append(f"{font_file.name} name {match.group(1)}")
|
||||
debug_versions = "\n".join(debug_versions)
|
||||
assert (
|
||||
len(versions) == 1
|
||||
), f"Should have a consistent version, found\n{debug_versions}"
|
||||
debug_versions = []
|
||||
versions = set()
|
||||
for font_file in sub_dir.rglob("*.ttf"):
|
||||
font = ttLib.TTFont(font_file)
|
||||
head_ver = f"{font['head'].fontRevision:.03f}"
|
||||
versions.add(head_ver)
|
||||
debug_versions.append(f"{font_file.name} head {head_ver}")
|
||||
for name in font["name"].names:
|
||||
# name 5 is version
|
||||
if name.nameID != 5:
|
||||
continue
|
||||
if not name.isUnicode():
|
||||
continue
|
||||
match = name5_re.match(name.toUnicode())
|
||||
assert match is not None, f"{name.toUnicode()} is malformed in {font_file.name}"
|
||||
versions.add(match.group(1))
|
||||
debug_versions.append(f"{font_file.name} name {match.group(1)}")
|
||||
debug_versions_str = "\n".join(debug_versions)
|
||||
assert (
|
||||
len(versions) == 1
|
||||
), f"Should have a consistent version under {sub_dir}, found\n{debug_versions_str}"
|
||||
|
||||
|
||||
def test_consistent_fstype():
|
||||
fonts_dir = Path("fonts")
|
||||
assert fonts_dir.is_dir()
|
||||
for sub_dir in [Path("2D/fonts"), Path("3D/fonts")]:
|
||||
assert sub_dir.is_dir()
|
||||
|
||||
name5_re = re.compile(r"^Version (\d+.\d+);GOOG;noto-emoji:\d+:[a-z0-9]+$")
|
||||
|
||||
debug_fstypes = []
|
||||
fstypes = set()
|
||||
for font_file in fonts_dir.rglob("*.ttf"):
|
||||
font = ttLib.TTFont(font_file)
|
||||
fstype = font["OS/2"].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}"
|
||||
debug_fstypes = []
|
||||
fstypes = set()
|
||||
for font_file in sub_dir.rglob("*.ttf"):
|
||||
font = ttLib.TTFont(font_file)
|
||||
fstype = font["OS/2"].fsType
|
||||
fstypes.add(fstype)
|
||||
debug_fstypes.append(f"{font_file.name} fsType {fstype}")
|
||||
debug_fstypes_str = "\n".join(debug_fstypes)
|
||||
assert fstypes == {0}, f"All fsType's should be 0 under {sub_dir}, found\n{debug_fstypes_str}"
|
||||
|
||||
|
||||
def test_has_emojicompat():
|
||||
fonts_dir = Path("fonts")
|
||||
fonts_dir = Path("2D/fonts")
|
||||
assert fonts_dir.is_dir()
|
||||
|
||||
ec_fonts = set(fonts_dir.rglob("*-emojicompat.ttf"))
|
||||
|
|
@ -84,18 +82,21 @@ def name(font, name_id):
|
|||
|
||||
|
||||
def test_flagsonly_name():
|
||||
fonts_dir = Path("fonts")
|
||||
assert fonts_dir.is_dir()
|
||||
font_file = fonts_dir / "NotoColorEmoji-flagsonly.ttf"
|
||||
font = ttLib.TTFont(font_file)
|
||||
assert [
|
||||
"Noto Color Emoji Flags",
|
||||
"Noto Color Emoji Flags",
|
||||
"Noto Color Emoji Flags",
|
||||
"NotoColorEmojiFlags",
|
||||
] == [
|
||||
name(font, NAME_ID_FAMILY),
|
||||
name(font, NAME_ID_FULLNAME),
|
||||
name(font, NAME_ID_UNIQUE_ID),
|
||||
name(font, NAME_ID_POSTSCRIPT_NAME),
|
||||
]
|
||||
found = False
|
||||
for sub_dir in [Path("2D/fonts"), Path("3D/fonts")]:
|
||||
assert sub_dir.is_dir()
|
||||
for font_file in sub_dir.rglob("*flagsonly.ttf"):
|
||||
found = True
|
||||
font = ttLib.TTFont(font_file)
|
||||
assert [
|
||||
"Noto Color Emoji Flags",
|
||||
"Noto Color Emoji Flags",
|
||||
"Noto Color Emoji Flags",
|
||||
"NotoColorEmojiFlags",
|
||||
] == [
|
||||
name(font, NAME_ID_FAMILY),
|
||||
name(font, NAME_ID_FULLNAME),
|
||||
name(font, NAME_ID_UNIQUE_ID),
|
||||
name(font, NAME_ID_POSTSCRIPT_NAME),
|
||||
]
|
||||
assert found, "Should find at least one flagsonly font to test"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue