Add css caching, adapt to LineLayout and Textlayout, add link support, add a resolve_url function, cache colors and space widths for fonts, fix bug crashing if font doesnt exist

This commit is contained in:
csd4ni3l
2025-07-22 18:32:27 +02:00
parent 385552bb08
commit 8b9b70c475
6 changed files with 200 additions and 71 deletions

7
run.py
View File

@@ -20,8 +20,11 @@ pyglet.font.add_directory('./assets/fonts')
if not os.path.exists(log_dir):
os.makedirs(log_dir)
if not os.path.exists("http_cache"):
os.makedirs("http_cache")
if not os.path.exists("html_cache"):
os.makedirs("html_cache")
if not os.path.exists("css_cache"):
os.makedirs("css_cache")
while len(os.listdir(log_dir)) >= 5:
files = [(file, os.path.getctime(os.path.join(log_dir, file))) for file in os.listdir(log_dir)]