diff options
Diffstat (limited to 'src/sliceitoff/text')
-rw-r--r-- | src/sliceitoff/text/fonts.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/sliceitoff/text/fonts.py b/src/sliceitoff/text/fonts.py index 8776530..24eb91e 100644 --- a/src/sliceitoff/text/fonts.py +++ b/src/sliceitoff/text/fonts.py @@ -1,5 +1,6 @@ """ text.fonts - .FNT file loading and storing """ import os +from pathlib import Path import pygame DEBUG = os.getenv("DEBUG") @@ -10,14 +11,9 @@ class Fonts: self.fonts = {} def init(self, base_path): - """ loads fonts from list """ - filename_fontlist = os.path.join(base_path, "fonts.lst") - with open(filename_fontlist, "r", encoding="utf-8") as fontlist_file: - for line in fontlist_file: - name, *path = line.strip().split() - filename = os.path.join(base_path, *path) - self.fonts[name] = Font(filename) - return True + """ loads fonts found in assets directory """ + for fnt_file in Path(base_path).glob('*.fnt'): + self.fonts[str(fnt_file.stem)] = Font(fnt_file) class Font: |