def com_google_fonts_check_name_postscriptname(ttFont, style, familyname):
  """ Check name table: POSTSCRIPT_NAME entries. """
  from fontbakery.utils import name_entry_id

  failed = False
  for name in ttFont['name'].names:
    if name.nameID == NameID.POSTSCRIPT_NAME:
      expected_value = f"{familyname}-{style}"

      string = name.string.decode(name.getEncoding()).strip()
      if string != expected_value:
        failed = True
        yield FAIL, ("Entry {} on the 'name' table: "
                     "Expected '{}' "
                     "but got '{}'.").format(name_entry_id(name),
                                             expected_value,
                                             string)
  if not failed:
    yield PASS, "POSTCRIPT_NAME entries are all good."
def com_google_fonts_check_name_postscriptname ( ttFont , style , familyname ) : from fontbakery . utils import name_entry_id failed = False for name in ttFont [ 'name' ] . names : if name . nameID == NameID . POSTSCRIPT_NAME : expected_value = f"{familyname}-{style}" string = name . string . decode ( name . getEncoding ( ) ) . strip ( ) if string != expected_value : failed = True yield FAIL , ( "Entry {} on the 'name' table: " "Expected '{}' " "but got '{}'." ) . format ( name_entry_id ( name ) , expected_value , string ) if not failed : yield PASS , "POSTCRIPT_NAME entries are all good."
Check name table: POSTSCRIPT_NAME entries.