Skip to content

fix(docker): add CJK fonts for Chinese/Japanese/Korean PDF rendering (#777)#785

Open
Frankli9986 wants to merge 1 commit into
srbhr:mainfrom
Frankli9986:fix-777-docker-cjk-fonts
Open

fix(docker): add CJK fonts for Chinese/Japanese/Korean PDF rendering (#777)#785
Frankli9986 wants to merge 1 commit into
srbhr:mainfrom
Frankli9986:fix-777-docker-cjk-fonts

Conversation

@Frankli9986
Copy link
Copy Markdown
Contributor

@Frankli9986 Frankli9986 commented May 4, 2026

Closes #777

Problem

Users running Resume-Matcher via Docker (docker compose up) experience garbled / box-character output when exporting Chinese resumes to PDF. The same code works correctly when running from source, because the host OS has CJK fonts installed.

Root Cause

The Docker image uses python:3.13-slim-bookworm as its base, which is a minimal Debian image that does not include any CJK fonts. PDF rendering uses Playwright + headless Chromium, which relies on system font fallback for Chinese characters. Without CJK fonts available in the container, Chromium has nothing to fall back to.

Fix

Add fonts-noto-cjk to the Dockerfile's apt-get install block. This package provides comprehensive CJK font coverage (Chinese, Japanese, Korean) and is the standard choice for Debian-based containers.

Verification

After rebuilding the image:

  1. docker compose up
  2. Create a resume with Chinese text
  3. Export to PDF → characters render correctly

Impact

  • Adds ~150MB to the image size (fonts-noto-cjk)
  • No code changes — purely an environment fix
  • Also benefits Japanese (ja) resume exports

Summary by cubic

Fixes garbled CJK text in PDF exports when running via Docker by installing fonts-noto-cjk in the python:3.13-slim-bookworm image. Addresses #777 and improves Chinese/Japanese/Korean rendering in Playwright/Chromium, with ~150MB image size increase and no app code changes.

  • Migration
    • Rebuild the Docker image and rerun docker compose up.

Written for commit c9528ef. Summary will update on new commits.

…rbhr#777)

The Docker image used python:3.13-slim-bookworm which does not include
any CJK fonts. Playwright/Chromium relies on system font fallback for
rendering Chinese characters in PDF exports. Without CJK fonts, Chinese
resumes render as garbled text / boxes.

Changes:
- Add fonts-noto-cjk to Dockerfile apt-get install block
- Covers Chinese, Japanese, and Korean characters

Closes srbhr#777
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Garbled PDF output when saving Chinese resumes

1 participant