Implement project opening and drawing editor canvas

This commit is contained in:
2024-03-01 21:40:25 +01:00
parent 83d0058218
commit 1870471445
2 changed files with 75 additions and 58 deletions

View File

@@ -119,22 +119,7 @@ def cli_main():
# open existing font project
elif choice == 1:
file_path = filedialog.askopenfilename(
title="Open font project",
filetypes=[("Font project (json)", "*.fontproj")]
)
if file_path == "":
print("\nCanceled.\n")
continue
# save last path to cache
with open("last_path_cache.txt", "w") as f:
f.write(file_path)
with open(file_path, "r") as f:
project_data = json.load(f)
pass
# open last project
elif choice == 2:
@@ -173,4 +158,4 @@ def cli_main():
key_tips()
return project_data, file_path
return project_data, file_path