fix(inkscape): use xvfb-run for headless execution

- Inkscape requires X11 display connection, causing 'GtkStyleContext without display' error
- Solution: use xvfb-run to create virtual X11 display
- Fallback: try direct inkscape if xvfb-run fails
- Add xvfb package to Dockerfile
- Update inkscape tests for new xvfb-run behavior

Fixes: Gtk-ERROR: Can't create a GtkStyleContext without a display connection
This commit is contained in:
Your Name 2026-01-22 23:56:47 +08:00
parent 2f9c418964
commit b5992a84e0
4 changed files with 168 additions and 7 deletions

View file

@ -167,12 +167,14 @@ RUN apt-get update --fix-missing && apt-get install -y --no-install-recommends \
# 階段 4圖像處理工具
# 注意bookworm 使用 imagemagick版本 6trixie 才有 imagemagick-7
# 注意xvfb 用於 Inkscape 在 headless 環境運行(需要虛擬 X11 顯示器)
RUN apt-get update --fix-missing && apt-get install -y --no-install-recommends \
imagemagick \
inkscape \
libheif-examples \
libjxl-tools \
libvips-tools \
xvfb \
&& rm -rf /var/lib/apt/lists/*
# 階段 5文件處理工具