Ignore missing font in fontchain_linter.py
It is totally valid if the font is missing even if the font is listed in
fonts.xml. Android Watch has less fonts and OEM vendor may reduce the
font files.
Bug: 72159040
Test: m fontchain_lint
Change-Id: I22bdf7bfeb6d80a2a338ebf7536c8eaf193b03c5
diff --git a/tools/fonts/fontchain_linter.py b/tools/fonts/fontchain_linter.py
index 15d39fd..ec40a222 100755
--- a/tools/fonts/fontchain_linter.py
+++ b/tools/fonts/fontchain_linter.py
@@ -270,6 +270,9 @@
if index:
index = int(index)
+ if not path.exists(path.join(_fonts_dir, font_file)):
+ continue # Missing font is a valid case. Just ignore the missing font files.
+
record = FontRecord(
name,
frozenset(scripts),