code: def com_google_fonts_check_font_version(ttFont):
    
    from decimal import Decimal
    head_version_str = str(Decimal(ttFont["head"].fontRevision).quantize(Decimal('1.000')))
    head_version = parse_version_string(head_version_str)
  
    # Compare the head version against the name ID 5 strings in all name records.
    name_id_5_records = [
        record for record in ttFont["name"].names
        if record.nameID == NameID.VERSION_STRING
    ]
  
    failed = False
    if name_id_5_records:
      for record in name_id_5_records:
        try:
          name_version = parse_version_string(record.toUnicode())
          if name_version != head_version:
            failed = True
            yield FAIL, Message("mismatch",
                                "head version is '{}' while name version string"
                                " (for platform {}, encoding {}) is '{}'."
                                "".format(head_version_str,
                                          record.platformID,
                                          record.platEncID,
                                          record.toUnicode()))
        except ValueError:
          failed = True
          yield FAIL, Message("parse",
                              "name version string for platform {},"
                              " encoding {} ('{}'), could not be parsed."
                              "".format(record.platformID,
                                        record.platEncID,
                                        record.toUnicode()))
    else:
      failed = True
      yield FAIL, Message("missing",
                          "There is no name ID 5 (version string) in the font.")
  
    if not failed:
      yield PASS, "All font version fields match."
docs: Checking font version fields (head and name table).