feat: Enable and configure figment mode via new CLI flags, update documentation, and improve Cairo library detection on macOS.

This commit is contained in:
2026-03-19 13:11:24 -07:00
parent 3a1aa975d1
commit a25b80d4a6
4 changed files with 31 additions and 7 deletions

View File

@@ -7,8 +7,20 @@ Follows the same pixel-pair approach as engine/render.py for OTF fonts.
from __future__ import annotations
import os
import sys
from io import BytesIO
# cairocffi (used by cairosvg) calls dlopen() to find the Cairo C library.
# On macOS with Homebrew, Cairo lives in /opt/homebrew/lib (Apple Silicon) or
# /usr/local/lib (Intel), which are not in dyld's default search path.
# Setting DYLD_LIBRARY_PATH before the import directs dlopen() to those paths.
if sys.platform == "darwin" and not os.environ.get("DYLD_LIBRARY_PATH"):
for _brew_lib in ("/opt/homebrew/lib", "/usr/local/lib"):
if os.path.exists(os.path.join(_brew_lib, "libcairo.2.dylib")):
os.environ["DYLD_LIBRARY_PATH"] = _brew_lib
break
import cairosvg
from PIL import Image