diff options
author | Roozbeh Pournader <roozbeh@google.com> | 2016-07-27 16:35:12 -0700 |
---|---|---|
committer | Roozbeh Pournader <roozbeh@google.com> | 2016-07-27 16:35:12 -0700 |
commit | ede3a17f6079b7da62240bbcaf613591ba2fc055 (patch) | |
tree | c9036ff0fc1b712820681cc240e933301fa27ce6 /tools/fonts | |
parent | d2a4944d68bd05f98856ea0f95cf36117bd5fd48 (diff) |
Add test for ascent and descent of serif and mono fonts
fontchain_lint now has tests making sure that their ascent and
descent matches that of Roboto.
Also, this moves a test class that contains a similar test and and
other related tests from graphictests to coretests.
Bug: 19791102
Change-Id: I8b473dd2a5f97ae2e3d322a2cabc16f3d32489f6
Diffstat (limited to 'tools/fonts')
-rwxr-xr-x | tools/fonts/fontchain_lint.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/fonts/fontchain_lint.py b/tools/fonts/fontchain_lint.py index b6f46a2423ae..072a4a756d24 100755 --- a/tools/fonts/fontchain_lint.py +++ b/tools/fonts/fontchain_lint.py @@ -558,9 +558,13 @@ def check_vertical_metrics(): for record in _fallback_chain: if record.name in ['sans-serif', 'sans-serif-condensed']: font = open_font(record.font) - assert (font['head'].yMax == 2163 and font['head'].yMin == -555 and - font['hhea'].ascent == 1900 and font['hhea'].descent == -500), ( - 'Vertical metrics of %s do not match expected Roboto metrics.' % (record.font,)) + assert font['head'].yMax == 2163 and font['head'].yMin == -555, ( + 'yMax and yMin of %s do not match expected values.' % (record.font,)) + + if record.name in ['sans-serif', 'sans-serif-condensed', 'serif', 'monospace']: + font = open_font(record.font) + assert font['hhea'].ascent == 1900 and font['hhea'].descent == -500, ( + 'ascent and descent of %s do not match expected values.' % (record.font,)) def main(): |