feat: Implement interactive font selection by scanning the fonts/ directory for .otf, .ttf, and .ttc files, adding new fonts and updating documentation.
This commit is contained in:
@@ -57,6 +57,10 @@ _FONT_CACHE = {}
|
||||
def font():
|
||||
"""Lazy-load the primary OTF font (path + face index aware)."""
|
||||
global _FONT_OBJ, _FONT_OBJ_KEY
|
||||
if not config.FONT_PATH:
|
||||
raise FileNotFoundError(
|
||||
f"No primary font selected. Add .otf/.ttf/.ttc files to {config.FONT_DIR}."
|
||||
)
|
||||
key = (config.FONT_PATH, config.FONT_INDEX, config.FONT_SZ)
|
||||
if _FONT_OBJ is None or _FONT_OBJ_KEY != key:
|
||||
_FONT_OBJ = ImageFont.truetype(
|
||||
|
||||
Reference in New Issue
Block a user