Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[add-font] Continue if license detection fails #1065

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.")
m4rc1e marked this conversation as resolved.
Show resolved Hide resolved
subsets = sorted(subsets)
for subset in subsets:
metadata.subsets.append(subset)
Expand Down