This commit is contained in:
2025-09-17 19:43:11 +02:00
parent 7c041e2a26
commit 0e9a655ea1
58 changed files with 2821 additions and 892 deletions

View File

@@ -8,16 +8,21 @@ import platform
import os
def install_pillow():
pass
"""Install Pillow if not available"""
try:
pass
import PIL
except ImportError:
pass
print("Installing Pillow...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "pillow>=10.0.0"])
def get_system_fonts():
pass
"""Get detailed list of available system fonts with paths"""
try:
pass
from PIL import ImageFont
import glob
@@ -25,6 +30,7 @@ def get_system_fonts():
system = platform.system()
if system == "Windows":
pass
font_dirs = [
"C:/Windows/Fonts/",
os.path.expanduser("~/AppData/Local/Microsoft/Windows/Fonts/")
@@ -47,35 +53,46 @@ def get_system_fonts():
extensions = ["*.ttf", "*.ttc", "*.otf"]
for font_dir in font_dirs:
pass
if os.path.exists(font_dir):
pass
for ext in extensions:
pass
for font_path in glob.glob(os.path.join(font_dir, "**", ext), recursive=True):
pass
try:
pass
font_name = os.path.splitext(os.path.basename(font_path))[0]
font_name = font_name.replace("-", " ").replace("_", " ")
fonts[font_name] = font_path
except Exception:
pass
continue
return fonts
except ImportError:
pass
return {}
def get_font_enum_items(self, context):
pass
"""Dynamic enum items for font selection"""
items = [("default", "Default Font", "Use system default font", 0)]
if not hasattr(get_font_enum_items, 'cached_fonts'):
pass
get_font_enum_items.cached_fonts = get_system_fonts()
fonts = get_font_enum_items.cached_fonts
for i, (font_name, font_path) in enumerate(sorted(fonts.items())[:50]):
pass
items.append((font_path, font_name, f"Font: {font_name}", i + 1))
return items
def get_anchor_point_matrix():
pass
"""Return a 3x3 matrix of anchor point identifiers for UI positioning grid"""
return [
['TOP_LEFT', 'TOP_CENTER', 'TOP_RIGHT'],