diff --git a/.devcontainer/pdf-converter/postCreateCommand.sh b/.devcontainer/pdf-converter/postCreateCommand.sh index a1cb50d19a5..d6f7f07d5e6 100644 --- a/.devcontainer/pdf-converter/postCreateCommand.sh +++ b/.devcontainer/pdf-converter/postCreateCommand.sh @@ -1,7 +1,7 @@ # Instal additional packages sudo apt update sudo apt-get install -y --no-install-recommends \ - chromium locales fonts-ipafont fonts-ipaexfont fonts-ipafont-gothic fonts-ipafont-mincho + chromium fonts-lato fonts-ipafont-gothic fonts-noto-cjk sudo apt-get clean -y # Setup pnpm diff --git a/apps/pdf-converter/docker/Dockerfile b/apps/pdf-converter/docker/Dockerfile index acfc42350b5..273ebf6da83 100644 --- a/apps/pdf-converter/docker/Dockerfile +++ b/apps/pdf-converter/docker/Dockerfile @@ -61,7 +61,7 @@ ENV LANG="ja_JP.UTF-8" ENV optDir="/opt" ENV appDir="${optDir}/pdf-converter" -RUN apt-get update && apt-get install -y chromium locales fonts-ipafont fonts-ipaexfont fonts-ipafont-gothic fonts-ipafont-mincho \ +RUN apt-get update && apt-get install -y chromium fonts-lato fonts-ipafont-gothic fonts-noto-cjk \ && apt-get clean \ && rm -rf /var/lib/apt/lists/*; \ echo "ja_JP UTF-8" > /etc/locale.gen && locale-gen; diff --git a/apps/pdf-converter/src/service/pdf-convert.ts b/apps/pdf-converter/src/service/pdf-convert.ts index 98b8cf064b6..87595ba6948 100644 --- a/apps/pdf-converter/src/service/pdf-convert.ts +++ b/apps/pdf-converter/src/service/pdf-convert.ts @@ -262,6 +262,13 @@ class PdfConvertService implements OnInit { await this.puppeteerCluster.task(async({ page, data: htmlString }) => { await page.setContent(htmlString, { waitUntil: 'domcontentloaded' }); + await page.addStyleTag({ + content: ` + body { + font-family: 'Lato', 'IPAGothic', 'Noto Sans CJK'; + } + `, + }); await page.emulateMediaType('screen'); const pdfResult = await page.pdf({ margin: {