Merge pull request #5275 from lesamouraipourpre/gen-display-headers

Fix crash in gen_display_resources.py
This commit is contained in:
Scott Shawcroft 2021-08-31 10:00:18 -07:00 committed by GitHub
commit 65753a1c25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ sys.path.insert(0, "../../tools/bitmap_font")
from adafruit_bitmap_font import bitmap_font
parser = argparse.ArgumentParser(description="Generate USB descriptors.")
parser = argparse.ArgumentParser(description="Generate displayio resources.")
parser.add_argument("--font", type=str, help="Font path", required=True)
parser.add_argument("--extra_characters", type=str, help="Unicode string of extra characters")
parser.add_argument(
@ -49,7 +49,7 @@ if args.sample_file:
# Merge visible ascii, sample characters and extra characters.
visible_ascii = bytes(range(0x20, 0x7F)).decode("utf-8")
all_characters = visible_ascii
all_characters = list(visible_ascii)
for c in sample_characters:
if c not in all_characters:
all_characters += c