feat: add chinese font support for pandoc

This commit is contained in:
纹波 2025-12-14 22:30:34 +08:00
parent c0e1aa524b
commit 6a9c3365dd
2 changed files with 26 additions and 0 deletions

View file

@ -74,9 +74,19 @@ RUN apt-get update && apt-get install -y \
texlive-latex-extra \ texlive-latex-extra \
texlive-latex-recommended \ texlive-latex-recommended \
texlive-xetex \ texlive-xetex \
texlive-lang-chinese \
fonts-noto-cjk \
fonts-wqy-zenhei \
fonts-wqy-microhei \
fonts-arphic-ukai \
fonts-arphic-uming \
--no-install-recommends \ --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN mkdir -p /usr/share/fonts/truetype/chinese && \
ln -sf /usr/share/fonts/truetype/noto /usr/share/fonts/truetype/chinese/noto && \
fc-cache -f -v
# Install VTracer binary # Install VTracer binary
RUN ARCH=$(uname -m) && \ RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "aarch64" ]; then \ if [ "$ARCH" = "aarch64" ]; then \

16
docker-compose.yml Normal file
View file

@ -0,0 +1,16 @@
services:
convertx:
image: convertx:pandoc-support-chinese
container_name: convertx
restart: unless-stopped
ports:
- "3001:3000"
environment:
- JWT_SECRET=ivanzhangwb # will use randomUUID() if unset
- HTTP_ALLOWED=true # uncomment this if accessing it over a non-https connection
- PANDOC_ENABLE_CHINESE_FONT=true
- PANDOC_CHINESE_FONT_FAMILY=Noto Serif CJK SC
- PANDOC_CHINESE_FONT_PATH=/usr/local/share/fonts/chinese
volumes:
- /home/admin/data/docker/convertX:/app/data
- /usr/share/fonts:/usr/local/share/fonts/chinese:ro