Only Courier-Fonts with Phantomjs 1.7/1.8/1.9, perhaps CSS specific

萝らか妹 提交于 2019-12-21 21:25:57

问题


Since updating to OpenSuse 12.2 I cannot use phantomjs (updated from 1.5 to Version 1.8.1 64bit) any longer to create screenshots. The problem is a missing font support for serif/sansserif fonts. Only a courier/monospace like font is used.

Additionally phantomjs is really slow on rendering (5 seconds and more --> solved).

I tried to install packages like google-droid-fonts, free-ttf-fonts, bitstream-vera-fonts, freetype, font-config - but the only result are some other ugly fonts used.

Does anybody knows how to configure OpenSuse 12.2 to enable some useable fonts (like googles droid fonts) as fallback in phantomjs? Or did I miss to install a important font-render-lib (slow rendering)?

Update

  • Building from source solved the performance issue
  • Installing the Microsoft Core fonts like "Arial" etc did not help
  • "fc-match" returns the right results
  • an "strace -e open" shows, that phantomjs access the configs under /etc/fonts alright

Update 2

  • The problem seems to originate in the CSS of my project. Trying different sites, most are well rendered.
  • Tested version PhantomJS 1.9 with the same results
  • Public URL to reproduce the bug: http://www.berlin.de/kennedy/

回答1:


I had a similar problem, installing the urw-fonts package solved it for me.

In my case no fonts where rendering at all, so this might not be the solution in your case, but worth a try:

yum install urw-fonts




回答2:


The problem was solved by some major CSS rewrites including an update of Twitter Bootstrap. In some way some CSS rules interfered with the correct rendering.

With newer OS versions, I cannot reproduce the bug, either.



来源:https://stackoverflow.com/questions/14705330/only-courier-fonts-with-phantomjs-1-7-1-8-1-9-perhaps-css-specific

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