mirror of
https://github.com/googlefonts/noto-emoji.git
synced 2026-11-26 15:01:56 +00:00
Compare commits
No commits in common. "43bac1a1272f31cedf0d74c2089fba6c7f952276" and "8998f5dd683424a73e2314a8c1f1e359c19e8742" have entirely different histories.
43bac1a127
...
8998f5dd68
24 changed files with 57 additions and 186 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
|
@ -1 +0,0 @@
|
||||||
3D/fonts/*.ttf filter=lfs diff=lfs merge=lfs -text
|
|
||||||
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
|
@ -10,14 +10,10 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
health_check:
|
health_check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
lfs: true
|
|
||||||
- name: Set up Python 3
|
- name: Set up Python 3
|
||||||
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
|
uses: actions/setup-python@v2
|
||||||
- name: Install FontTools
|
- name: Install FontTools
|
||||||
run: pip install fonttools pytest
|
run: pip install fonttools pytest
|
||||||
- name: pytest
|
- name: pytest
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,92 +0,0 @@
|
||||||
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.
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:6b6f85282ca413efcdf2cbdc6ca3b20f958e3faf4ec39974a9d37557df39ccb9
|
|
||||||
size 7208244
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:0fdfec3dbefb214750465b5c17ac8f7c47286fc0c88d8605c12cd45e86613f7c
|
|
||||||
size 140952312
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:6f4312a7c02d0c9de88095ee65e320ffe9316d2d8d56e4c515e7181fca5ed439
|
|
||||||
size 147882884
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:1d67d40f3cdbf285b1732d7fa6abbe785d40a810fcfc26c9bf738e8cb493454e
|
|
||||||
size 11040224
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:5ca3f637dfebc8da8f887ffc4e5fcd433802f93994f813f7ff9f179e6a8dd625
|
|
||||||
size 218345004
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:278e14dfc2c7f528f42a7e7d34eb1e302250d6b400e0fceb07a4ad2da72b617a
|
|
||||||
size 228959280
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:f3a4c6f6d84354209abffef719d34d2661e7e64ad8900cd414b2f334ed92736f
|
|
||||||
size 1810272
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:d141379ae1339189b3d52e4e8e4b1a58d6d1ef04ea1ffcf6ab6ea50c4889b628
|
|
||||||
size 33855964
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:d5934469c144a951d26be9ae7173a702a6231418e18bfb395fbda3683891838c
|
|
||||||
size 35598452
|
|
||||||
|
|
@ -13,12 +13,8 @@ def name(font, name_id):
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
font_files = []
|
font_files = sorted(p for p in (Path(__file__).parent / "fonts").iterdir() if p.suffix == ".ttf")
|
||||||
for sub_dir in [Path(__file__).parent / "2D" / "fonts", Path(__file__).parent / "3D" / "fonts"]:
|
max_name_len = max(len(p.name) for p in font_files)
|
||||||
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:
|
for font_file in font_files:
|
||||||
font = ttLib.TTFont(font_file)
|
font = ttLib.TTFont(font_file)
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
fonts/NotoColorEmoji-flagsonly.ttf
Normal file
BIN
fonts/NotoColorEmoji-flagsonly.ttf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -11,14 +11,14 @@ NAME_ID_POSTSCRIPT_NAME = 6
|
||||||
|
|
||||||
|
|
||||||
def test_consistent_version():
|
def test_consistent_version():
|
||||||
for sub_dir in [Path("2D/fonts"), Path("3D/fonts")]:
|
fonts_dir = Path("fonts")
|
||||||
assert sub_dir.is_dir()
|
assert fonts_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 = []
|
debug_versions = []
|
||||||
versions = set()
|
versions = set()
|
||||||
for font_file in sub_dir.rglob("*.ttf"):
|
for font_file in fonts_dir.rglob("*.ttf"):
|
||||||
font = ttLib.TTFont(font_file)
|
font = ttLib.TTFont(font_file)
|
||||||
head_ver = f"{font['head'].fontRevision:.03f}"
|
head_ver = f"{font['head'].fontRevision:.03f}"
|
||||||
versions.add(head_ver)
|
versions.add(head_ver)
|
||||||
|
|
@ -30,32 +30,34 @@ def test_consistent_version():
|
||||||
if not name.isUnicode():
|
if not name.isUnicode():
|
||||||
continue
|
continue
|
||||||
match = name5_re.match(name.toUnicode())
|
match = name5_re.match(name.toUnicode())
|
||||||
assert match is not None, f"{name.toUnicode()} is malformed in {font_file.name}"
|
assert match is not None, f"{name.toUnicode()} is malformed"
|
||||||
versions.add(match.group(1))
|
versions.add(match.group(1))
|
||||||
debug_versions.append(f"{font_file.name} name {match.group(1)}")
|
debug_versions.append(f"{font_file.name} name {match.group(1)}")
|
||||||
debug_versions_str = "\n".join(debug_versions)
|
debug_versions = "\n".join(debug_versions)
|
||||||
assert (
|
assert (
|
||||||
len(versions) == 1
|
len(versions) == 1
|
||||||
), f"Should have a consistent version under {sub_dir}, found\n{debug_versions_str}"
|
), f"Should have a consistent version, found\n{debug_versions}"
|
||||||
|
|
||||||
|
|
||||||
def test_consistent_fstype():
|
def test_consistent_fstype():
|
||||||
for sub_dir in [Path("2D/fonts"), Path("3D/fonts")]:
|
fonts_dir = Path("fonts")
|
||||||
assert sub_dir.is_dir()
|
assert fonts_dir.is_dir()
|
||||||
|
|
||||||
|
name5_re = re.compile(r"^Version (\d+.\d+);GOOG;noto-emoji:\d+:[a-z0-9]+$")
|
||||||
|
|
||||||
debug_fstypes = []
|
debug_fstypes = []
|
||||||
fstypes = set()
|
fstypes = set()
|
||||||
for font_file in sub_dir.rglob("*.ttf"):
|
for font_file in fonts_dir.rglob("*.ttf"):
|
||||||
font = ttLib.TTFont(font_file)
|
font = ttLib.TTFont(font_file)
|
||||||
fstype = font["OS/2"].fsType
|
fstype = font["OS/2"].fsType
|
||||||
fstypes.add(fstype)
|
fstypes.add(fstype)
|
||||||
debug_fstypes.append(f"{font_file.name} fsType {fstype}")
|
debug_fstypes.append(f"{font_file.name} fsType {fstype}")
|
||||||
debug_fstypes_str = "\n".join(debug_fstypes)
|
debug_fstypes = "\n".join(debug_fstypes)
|
||||||
assert fstypes == {0}, f"All fsType's should be 0 under {sub_dir}, found\n{debug_fstypes_str}"
|
assert fstypes == {0}, f"All fsType's should be 0, found\n{debug_fstypes}"
|
||||||
|
|
||||||
|
|
||||||
def test_has_emojicompat():
|
def test_has_emojicompat():
|
||||||
fonts_dir = Path("2D/fonts")
|
fonts_dir = Path("fonts")
|
||||||
assert fonts_dir.is_dir()
|
assert fonts_dir.is_dir()
|
||||||
|
|
||||||
ec_fonts = set(fonts_dir.rglob("*-emojicompat.ttf"))
|
ec_fonts = set(fonts_dir.rglob("*-emojicompat.ttf"))
|
||||||
|
|
@ -82,11 +84,9 @@ def name(font, name_id):
|
||||||
|
|
||||||
|
|
||||||
def test_flagsonly_name():
|
def test_flagsonly_name():
|
||||||
found = False
|
fonts_dir = Path("fonts")
|
||||||
for sub_dir in [Path("2D/fonts"), Path("3D/fonts")]:
|
assert fonts_dir.is_dir()
|
||||||
assert sub_dir.is_dir()
|
font_file = fonts_dir / "NotoColorEmoji-flagsonly.ttf"
|
||||||
for font_file in sub_dir.rglob("*flagsonly.ttf"):
|
|
||||||
found = True
|
|
||||||
font = ttLib.TTFont(font_file)
|
font = ttLib.TTFont(font_file)
|
||||||
assert [
|
assert [
|
||||||
"Noto Color Emoji Flags",
|
"Noto Color Emoji Flags",
|
||||||
|
|
@ -99,4 +99,3 @@ def test_flagsonly_name():
|
||||||
name(font, NAME_ID_UNIQUE_ID),
|
name(font, NAME_ID_UNIQUE_ID),
|
||||||
name(font, NAME_ID_POSTSCRIPT_NAME),
|
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