Docker, Cent OS, PhantomJS Font Format Issue

℡╲_俬逩灬. 提交于 2019-12-11 17:23:55

问题


I am running a phantomJS command which converts HTML to a PDF buffer on Docker containing Cent OS. The PDF renders fine, but the font/font format is rendering

The available fonts on the system are:

/usr/share/fonts/lyx/eufm10.ttf: eufm10:style=LyX
/usr/share/fonts/lyx/cmsy10.ttf: cmsy10:style=LyX
/usr/share/fonts/lyx/msam10.ttf: msam10:style=LyX
/usr/share/fonts/lyx/cmmi10.ttf: cmmi10:style=LyX
/usr/share/fonts/lyx/wasy10.ttf: wasy10:style=LyX
/usr/share/fonts/lyx/esint10.ttf: esint10:style=LyX
/usr/share/fonts/lyx/rsfs10.ttf: rsfs10:style=LyX
/usr/share/fonts/lyx/stmary10.ttf: stmary10:style=LyX
/usr/share/fonts/lyx/cmex10.ttf: cmex10:style=LyX
/usr/share/fonts/lyx/msbm10.ttf: msbm10:style=LyX
/usr/share/fonts/lyx/cmr10.ttf: cmr10:style=LyX

How do I fix this to use a readable font? I can enforce an inline style font family but what would I set it to in order for it to be readable?

Perhaps I should be installing fonts in my Docker file.

Thanks!


回答1:


Forgot to follow up on this but basically found some libs to fill this void and fix the font issue. Hope it will be useful if anyone runs into this issue.. In my Dockerfile, I run the following:

RUN yum install libXext -y
RUN yum install libXrender -y
RUN yum install xorg-x11-fonts-Type1 -y
RUN yum install xorg-x11-fonts-75dpi -y
RUN yum install xorg-x11-fonts-100dpi -y


来源:https://stackoverflow.com/questions/48694808/docker-cent-os-phantomjs-font-format-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!