Skip to content

Commit

Permalink
Merge pull request #1065 from googlefonts/add-font-no-license
Browse files Browse the repository at this point in the history
[add-font] Continue if license detection fails
  • Loading branch information
m4rc1e authored Nov 15, 2024
2 parents a64af18 + cce4dd4 commit d4ae50b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Lib/gftools/scripts/add_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def _MakeMetadata(args, is_new):

first_file = file_family_style_weights[0].file
old_metadata_file = os.path.join(args.directory, "METADATA.pb")
font_license = fonts.LicenseFromPath(args.directory)

metadata = fonts_pb2.FamilyProto()
metadata.name = file_family_style_weights[0].family
Expand Down Expand Up @@ -214,7 +213,12 @@ def _MakeMetadata(args, is_new):
):
metadata.primary_script = script

metadata.license = font_license
try:
font_license = fonts.LicenseFromPath(args.directory)
metadata.license = font_license
except ValueError:
print("WARNING: Could not determine license for %s" % args.directory)
print("Continuing without setting license.")
subsets = sorted(subsets)
for subset in subsets:
metadata.subsets.append(subset)
Expand Down

0 comments on commit d4ae50b

Please sign in to comment.