arachnys / athenapdf

Drop-in replacement for wkhtmltopdf built on Go, Electron and Docker
MIT License
2.26k stars 186 forks source link

How to use font file(such as ".ttf") in microservice #191

Closed leejialing closed 5 years ago

leejialing commented 5 years ago

The page I need to convert contains PingFang font, which is normal in OSX system, but it fails in Linux.

I try to copy a font file (such as PingFang.ttf) into /usr/share/fonts/myfonts/, and map this directory to container's /usr/share/fonts.

fc-list command show that the font has been installed.But it didn't work.it still use Linux default font.

leejialing commented 5 years ago

well, I know how to fix it. mapping /usr/share/fonts to container's /usr/share/fonts. this is my command: docker run -v /usr/share/fonts:/usr/share/fonts -p 8080:8080 -i --rm arachnysdocker/athenapdf-service