Skip to content

Commit

Permalink
Test all fonts when running __init__.
Browse files Browse the repository at this point in the history
  • Loading branch information
LettError committed Feb 26, 2017
1 parent 7c3c76b commit a1c9b6d
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Lib/coverage/__init__.py
Expand Up @@ -163,8 +163,18 @@ def getFontWidth(f):
total.append(languageTotal/len(table))
return sum(total) / len(supportedLanguages)


if __name__ == "__main__":

def measureAllFonts():
for font in AllFonts():
if font is None:
continue
if font.path is not None:
print(os.path.basename(font.path))
print("weighted font coverage", getFontCoverage(font))
print("weighted font width", getFontWidth(font))
print

def test():
try:
font = CurrentFont()
if font is not None:
Expand All @@ -181,4 +191,8 @@ def getFontWidth(f):
print("\naverage font coverage", sum(totes)/len(totes))
print("\nweighted font width", getFontWidth(font))
except NameError:
pass
pass

if __name__ == "__main__":
measureAllFonts()

0 comments on commit a1c9b6d

Please sign in to comment.