Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def CompareDirs(font1, font2):
"""Compares fonts by assuming font1/2 are dirs containing METADATA.pb."""
m1 = fonts.Metadata(font1)
m2 = fonts.Metadata(font2)
subsets_to_compare = fonts.UniqueSort(m1.subsets, m2.subsets)
subsets_to_compare.remove('menu')
subsets_to_compare.append('all')
font_filename1 = os.path.join(font1, fonts.RegularWeight(m1))
font_filename2 = os.path.join(font2, fonts.RegularWeight(m2))
if FLAGS.diff_coverage:
print('Subset Coverage Change (codepoints)')
for subset in subsets_to_compare:
DiffCoverage(font_filename1, font_filename2, subset)
print(CompareSize(font_filename1, font_filename2))
def CompareDirs(font1, font2):
"""Compares fonts by assuming font1/2 are dirs containing METADATA.pb."""
m1 = fonts.Metadata(font1)
m2 = fonts.Metadata(font2)
subsets_to_compare = fonts.UniqueSort(m1.subsets, m2.subsets)
subsets_to_compare.remove('menu')
subsets_to_compare.append('all')
font_filename1 = os.path.join(font1, fonts.RegularWeight(m1))
font_filename2 = os.path.join(font2, fonts.RegularWeight(m2))
if FLAGS.diff_coverage:
print('Subset Coverage Change (codepoints)')
for subset in subsets_to_compare:
DiffCoverage(font_filename1, font_filename2, subset)
print(CompareSize(font_filename1, font_filename2))