PhantomJS字体格式问题

PhantomJS字体格式问题

本文介绍了Docker,Cent OS,PhantomJS字体格式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行phantomJS命令,该命令在包含Cent OS的Docker上将HTML转换为PDF缓冲区. PDF可以很好地呈现,但是字体/字体格式正在呈现

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

系统上可用的字体为:

/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?

也许我应该在Docker文件中安装字体.

Perhaps I should be installing fonts in my Docker file.

谢谢!

推荐答案

忘了跟进此操作,但基本上找到了一些库来填补此空白并解决字体问题.希望任何人遇到此问题都将有用..在我的Dockerfile中,我运行以下命令:

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

这篇关于Docker,Cent OS,PhantomJS字体格式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 08:13