summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSeigo Nonaka <nona@google.com>2021-03-30 23:34:28 -0700
committerSeigo Nonaka <nona@google.com>2021-03-30 23:34:28 -0700
commita1245b1c7c9f6e0da43f5f7e1deefdb768c4bc90 (patch)
tree4470680cdd85b21a5c32d5362700112d8525fe5b /tools
parentdf1fcdadd0df589e803900fb3c114d0cc9e9eb17 (diff)
Revert font file rename.
This reverts commit f31ac94a03092d33c86d3edd8fd9d93dd87e4e8a. This reverts commit 2f0674a7fa6c54d57c231467e0a88232669bad2a. Bug: 184003133 Test: N/A Change-Id: I6bd807ce0df6cd81e44bf89918ac4b7b01c27ae1
Diffstat (limited to 'tools')
-rwxr-xr-xtools/fonts/fontchain_linter.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/tools/fonts/fontchain_linter.py b/tools/fonts/fontchain_linter.py
index e775e1adb04e..f0b759547a93 100755
--- a/tools/fonts/fontchain_linter.py
+++ b/tools/fonts/fontchain_linter.py
@@ -665,51 +665,6 @@ def check_cjk_punctuation():
assert_font_supports_none_of_chars(record.font, cjk_punctuation, name)
-def getPostScriptName(font):
- ttf = open_font(font)
- nameTable = ttf['name']
- for name in nameTable.names:
- if name.nameID == 6 and name.platformID == 3 and name.platEncID == 1 and name.langID == 0x0409:
- return str(name)
-
-
-def getSuffix(font):
- file_path, index = font
- with open(path.join(_fonts_dir, file_path), 'rb') as f:
- tag = f.read(4)
- isCollection = tag == b'ttcf'
-
- ttf = open_font(font)
- isType1 = ('CFF ' in ttf or 'CFF2' in ttf)
-
- if isType1:
- if isCollection:
- return '.otc'
- else:
- return '.otf'
- else:
- if isCollection:
- return '.ttc'
- else:
- return '.ttf'
-
-
-def check_canonical_name():
- for record in _all_fonts:
- file_name, index = record.font
-
- if index and index != 0:
- continue
-
- psName = getPostScriptName(record.font)
- assert psName, 'PostScript must be defined'
-
- suffix = getSuffix(record.font)
- canonicalName = '%s%s' % (psName, suffix)
-
- assert file_name == canonicalName, (
- '%s is not a canonical name. Must be %s' % (file_name, canonicalName))
-
def main():
global _fonts_dir
target_out = sys.argv[1]
@@ -727,8 +682,6 @@ def main():
check_cjk_punctuation()
- check_canonical_name()
-
check_emoji = sys.argv[2]
if check_emoji == 'true':
ucd_path = sys.argv[3]