code: def com_google_fonts_check_metadata_nameid_family_name(ttFont, font_metadata):
    
    from fontbakery.utils import get_name_entry_strings
  
    familynames = get_name_entry_strings(ttFont, NameID.TYPOGRAPHIC_FAMILY_NAME)
    if not familynames:
        familynames = get_name_entry_strings(ttFont, NameID.FONT_FAMILY_NAME)
    if len(familynames) == 0:
      yield FAIL, Message("missing",
                          ("This font lacks a FONT_FAMILY_NAME entry"
                           " (nameID={}) in the name"
                           " table.").format(NameID.FONT_FAMILY_NAME))
    else:
      if font_metadata.name not in familynames:
        yield FAIL, Message("mismatch",
                            ("Unmatched family name in font:"
                             " TTF has \"{}\" while METADATA.pb"
                             " has \"{}\"").format(familynames[0],
                                                   font_metadata.name))
      else:
        yield PASS, ("Family name \"{}\" is identical"
                     " in METADATA.pb and on the"
                     " TTF file.").format(font_metadata.name)
docs: Checks METADATA.pb font.name field matches
       family name declared on the name table.