简体   繁体   English

Docker,Cent OS,PhantomJS字体格式问题

[英]Docker, Cent OS, PhantomJS Font Format Issue

I am running a phantomJS command which converts HTML to a PDF buffer on Docker containing Cent OS. 我正在运行phantomJS命令,该命令在包含Cent OS的Docker上将HTML转换为PDF缓冲区。 The PDF renders fine, but the font/font format is rendering PDF可以正常渲染,但是字体/字体格式正在渲染 在此处输入图片说明

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. 也许我应该在Docker文件中安装字体。

Thanks! 谢谢!

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: 希望任何人遇到此问题都将有用。.在我的Dockerfile中,我运行以下命令:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM