| import os | |
| import sys | |
| from PIL import Image, ImageFont, ImageDraw | |
| def list_fonts(): | |
| print("--- FONT SCANNER ---") | |
| paths = [ | |
| "/usr/share/fonts", | |
| "/usr/share/fonts/truetype", | |
| "/usr/share/fonts/truetype/noto", | |
| "/usr/share/fonts/truetype/dejavu", | |
| "/usr/share/fonts/truetype/liberation", | |
| "assets" | |
| ] | |
| for p in paths: | |
| if os.path.exists(p): | |
| print(f" | |
| Directory: {p}") | |
| files = [f for f in os.listdir(p) if f.lower().endswith(('.ttf', '.otf'))] | |
| for f in sorted(files): | |
| full_path = os.path.join(p, f) | |
| size = os.path.getsize(full_path) | |
| print(f" - {f} ({size} bytes)") | |
| else: | |
| print(f" | |
| Directory NOT FOUND: {p}") | |
| if __name__ == "__main__": | |
| list_fonts() | |