问题
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