fix(devcontainer): prevent PhantomJS crash on PDF export by installing emoji fonts by lakshay122007 · Pull Request #1953 · hackmdio/codimd

This PR fixes a critical issue where the application container crashes during PDF export if the note contains emojis or CJK characters. The crash originates from PhantomJS encountering a SIGFPE (Floating Point Exception) when attempting to render glyphs that are missing from the system fonts.

Changes

  • .devcontainer/Dockerfile:
  • Added installation of fonts-noto, fonts-noto-cjk, and fonts-noto-color-emoji to provide necessary glyphs.
  • Added fontconfig and ran fc-cache to ensure fonts are recognized.
  • Added rm -rf /var/lib/apt/lists/* to clean up apt cache and reduce image layer size.
  • .devcontainer/docker-compose.yml:
    Added QT_QPA_PLATFORM=offscreen environment variable. This is required for PhantomJS to run reliably in a headless Docker environment without an X server.

Related Issue

Fixes crash reported when exporting notes with emojis to PDF.

closes #1932