WOFF font support issues #11992

benjigreig opened this Issue Feb 20, 2014 · 9 comments


None yet
6 participants

Have been testing cases this against recent builds of PhantomJS on Mac OS X and linux. We've discovered that PhantomJS seems to have an issue with OTF and/or Postscript data in WOFF files. WOFFs compiled from TTF data display fine however.

For us this has implications in being able to use commercially available web fonts which frequently have OTF and even Postscript encapsulated in them. At the moment PhantomJS seems not to handle these. :-( We'll keep trucking for a solution.

We have many test screenshots that bare this out. Hassle me if you'd like to see them.

jory commented Feb 26, 2014

@benjigreig Were the fonts displaying correctly when using older versions of PhantomJS (namely 1.9.2)?

Hi @jory. I work with benjigreig. I haven't been debugging the font issue, but I do wrangle the servers and deploy the binaries.

We see the font issues running 1.9.2. This is deployed by wrapping the binary from the PhantomJS Linux .tar.bz2 in a .deb, but I don't think that should have any bearing on the problem.

The host system is Ubuntu 12.04.4. We have:

$ dpkg -l | egrep 'lib(fontconfig|freetype)' | cut -c-64
ii  libfontconfig1                   2.8.0-3ubuntu9.1
ii  libfreetype6                     2.4.8-1ubuntu2.1

I can switch 1.9.2 out with whatever other version to assist with a fix.

jory commented Feb 27, 2014

I made a repo with the test case I've been seeing.

I'm including a base64 encoded WOFF of Revalia on the page, and running it on a simple web server on port 3131.

Here it is in Chrome:

Here it is using 1.9.2:

And here's 1.9.7:

jory commented Feb 27, 2014

1.9.2 does properly render the font, but I see the following output in the console:

2014-02-27 10:26:34.429 phantomjs[13643:507] CoreText performance note: Client called CTFontCreateWithName() using name "Revalia" and got font with PostScript name "Revalia-Regular". For best performance, only use PostScript names when calling this API.
2014-02-27 10:26:34.430 phantomjs[13643:507] CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug.

This issue seem to persist on phantom 2.0, compiled and run on Ubuntu x64 14.04 LTS

Here is an example of the Google font "Montserrat" in Google Chrome
screen shot 2015-04-22 at 15 38 08

Here is the same in phantomjs 2.0
screen shot 2015-04-22 at 15 37 55

On the image you see that the P is cut on the right corner, same thing happens with other letters.

Also the google font "Oswald" doesn't render at all.


screen shot 2015-04-22 at 15 41 51

screen shot 2015-04-22 at 15 42 07

istr commented Nov 29, 2015

For 2.0.0 this is probably an issue with the build script only.

When building 2.0.0 using this hint @jory s regression test passes and works.

You might want to try out your own build with that tweak or use my experimental pre-release builds to verify.


Vitallium commented Nov 29, 2015

@istr support for WOFF fonts has been landed to the master recently.

istr commented Nov 29, 2015

@Vitallium Nice. 👍 Will try to build from master with the python based build script. Thanks for the hint.


Vitallium commented Jan 11, 2017

PJS 2.5 has full support for WOFF and WOFF2 now

@Vitallium Vitallium closed this Jan 11, 2017

@Vitallium Vitallium added this to the Release 2.5 milestone Jan 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment