Phantomjs: Webfonts don't work in Windows version

Created on 1 Sep 2015  路  37Comments  路  Source: ariya/phantomjs

Hello! I've just discovered webfonts don't work in 2.0.0 on Windows. I understand that might be part of 2.0.1? Any word on that release? If I can't wait, what are my options? Presumably I can try building from the master on the repo? Are there nightly builds or something I could grab?

Thank you for your help!

Bug Regression Windows

Most helpful comment

PhantomCSS and PhantomJS are essentially dead now GoogleChrome/puppeteer and Nightmarejs have come along.

The former uses the actual latest version of chrome so features arrive quickly.

All 37 comments

Yes, it will be in 2.0.1 release. To enable web fonts you need to compile PhantomJS with zlib.

Great to hear! I assume I follow the instructions in the Windows section of http://phantomjs.org/build.html (but without the git checkout 2.0). How do I enable zlib?

Also, do you know if the build will work with https://www.visualstudio.com/products/visual-studio-community-vs ? The build page says 2012/2013, but it looks like the latest is 2015.

Of course if anyone here already has a built Windows version of Phantom with webfonts they can point to, I'd love to hear about it!

hey,
i have the same issue.

how did you enabled zlib (on windows platform)
and did it fix this issue?

thanks

@zadahead Unfortunately we still haven't figured that out...we'll let you know if/when we do; please do the same!

@zadahead Looks like this comment from @Vitallium covers it:

https://github.com/ariya/phantomjs/issues/10592#issuecomment-104670467

Does Anyone got a build to share with the world and save humanity?

@yairza I ended up giving up and went with a Mac based server instead. That said, I'm still interested if someone comes up with a Windows build!

@yairza @zadahead you may want to try the version maintained for DeckTape which are available at https://github.com/astefanutti/decktape/tree/gh-pages/downloads.

@astefanutti thanks! however it seems that the windows version is still not supporting web fonts, or am i missing something?

@yairza I haven't dig that much into your issue though I've managed to export HTML presentations with Web fonts correctly on Windows OS with the provided executable from DeckTape. One example is http://mikemaccana.github.io/rejectjs2013/ exported into https://astefanutti.github.io/decktape/examples/new-es5-overloards.pdf.

Other examples of presentations with Web fonts exported on Windows OS can be found here: https://github.com/astefanutti/decktape#examples.

That being said, that may be a completely different use case than yours.

Can you try it again with PhantomJS 2.1?

It appears that WOFF fonts still aren't rendered on Windows in PhantomJS 2.1.1. PhantomJS 1.9 is able to render both of the WOFF fonts I tested.

@rlaytham sample?

Try extracting the contents of this zip file to a folder and running "phantomjs.exe renderpng.js". The font is rendered in PhantomJS 1.9 (and in Chrome), but not in 2.1.1.

The zip file also includes screen captures generated from PhantomJS 1.9 and 2.1.1.
render_woff.zip

Indeed. Confirmed. Thanks for reporting! This will be fixed in the next patch release!

Fantastic. Thank you for the quick response.

For developers: looks like QtWebkit tries to find the dynamic version of the zlib library. But we use static version. I already a have fix for this. Will push it shortly.

Any progress of patch? I've met same issue. Thanks a lot.

@Vitallium where can we find the patch?

I'm facing the same issues version 2.1.1 on Windows doesn't support webfonts. Is there any built in version which I can use?

any update on this? is there a patch available?

Workaround for me was to use wkhtmltopdf directly instead of the phantomjs wrapper.
The fix for the issue is described here: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1527#issuecomment-72549818
and take a note of this post:
http://blog.gluga.com/2012/05/wkhtmltopdf-font-and-sizing-issues.html

This issue should be fixed in master branch.

Fixed in master

Is this fix going to be released soon? It has been a year since the last update

This still doesn't seem to work @Vitallium ?

@Rukenshia 2.5 version can render Web fonts

where is version 2.5? I only see 2.1.1

Here - https://bitbucket.org/ariya/phantomjs/downloads But it's in the beta phase atm.

Any idea how long this will be in beta. It has been a year since the last stable release.

Any update? Since april no activity? I'm really waiting for webfonts to work, its a great addition to the product.

PhantomCSS and PhantomJS are essentially dead now GoogleChrome/puppeteer and Nightmarejs have come along.

The former uses the actual latest version of chrome so features arrive quickly.

@phawxby Wow this is awesome, thanks for informing me of these new tools. JS community evolves fast :-)

They seem to do very similar things, which is better suited for PDF rendering of a page, if you are familiar?
Update: looks like Puppeteer is more for rendering pdf and nightmarejs more for automated interactions, I'll look more into it.

Unfortunately, GoogleChrome/puppeteer does not support custom Header/Footer:
https://productforums.google.com/forum/#!topic/chrome/N7XsmwYV15U

@MichaelKorn Puppeteer seems to support custom header and footer now: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions

@ronkot Thanks, we are using custom header and footer in Puppeteer since last week. It is working fine and we will replace phantomjs completely.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mdominado picture mdominado  路  3Comments

yisibl picture yisibl  路  5Comments

mz3 picture mz3  路  5Comments

olee picture olee  路  4Comments

yairza picture yairza  路  6Comments