def test_us_weight(self): "Tests the usWeight of the fonts to be correct." "" for font in self.fonts: weight = roboto_data.extract_weight_name(font_data.font_name(font)) expected_numeric_weight = roboto_data.WEIGHTS[weight] self.assertEqual(font['OS/2'].usWeightClass, expected_numeric_weight)
def test_us_weight(self): "Tests the usWeight of the fonts to be correct.""" for font in self.fonts: weight = roboto_data.extract_weight_name(font_data.font_name(font)) expected_numeric_weight = roboto_data.WEIGHTS[weight] self.assertEqual( font['OS/2'].usWeightClass, expected_numeric_weight)
def apply_temporary_fixes(font): """Apply some temporary fixes.""" # Fix usWeight: font_name = font_data.font_name(font) weight = roboto_data.extract_weight_name(font_name) weight_number = roboto_data.WEIGHTS[weight] font['OS/2'].usWeightClass = weight_number # Set ascent, descent, and lineGap values to Android K values hhea = font['hhea'] hhea.ascent = 1900 hhea.descent = -500 hhea.lineGap = 0 # Copyright message font_data.set_name_record( font, 0, 'Copyright 2011 Google Inc. All Rights Reserved.')