question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pyftsubset generated WOFF2 renders fine on Firefox/Chrome but shows gibberish on Safari

See original GitHub issue

Hello,

For quite some time, this issue had been bugging me – See https://gitlab.com/kaushalmodi/kaushalmodi.gitlab.io/issues/3.

For some reason, the text from my blog showed up as gibberish on Safari, but worked fine on Firefox/Chrome.

After countless hours of debug, tweaking CSS, changing fonts, etc, I narrowed down to the issue that Safari cannot render the pyftsubset generated WOFF2.

I have the .ttf version of the fonts, and I generate the woff and woff2 using this:

pyftsubset font.ttf  --layout-features="" --unicodes="U+0020-007E,U+00A7-00BE,U+2000-205E,U+00C0-00FF" --flavor=woff  --with-zopfli --output-file=font.woff
pyftsubset font.woff --layout-features="" --unicodes="U+0020-007E,U+00A7-00BE,U+2000-205E,U+00C0-00FF" --flavor=woff2 --output-file=font.woff2

If I use woff2 font, Safari shows my blog (https://scripter.co) like this (older screenshot, so content is different):

You can even live-test this woff2/Safari issue by visiting https://woff2--scripter-co.netlify.com/ on Safari (iOS as I have consistently recreated this issue on mobile Safari on iPhone 8). If you visit https://test--scripter-co.netlify.com/ on the same browser, you will not see that issue as there I am using just the WOFF version of fonts.

But if I use the woff font, the text shows up fine.

Take the pyftsubset generated Merriweather-Regular.woff2 from here as an example.

  • Using those files, would it be possible to help fix this rendering issue on Safari?
  • Are my pyftsubset commands above correct?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
anthrotypecommented, Jul 12, 2018

Also is there a user friendly (for someone knowing nothing of woff\2 internals) command line method to print all the glyphs from an input font?

you can use ttx to print the GlyphOrder table (which is not really an OpenType ‘table’, but it’s where fontTools internally stores the information as to what is the glyph name and the order of the glyphs in a font).

$ ttx -o - -t GlyphOrder MyAwesomeFont-Regular.ttf

-o - is to print to standard output instead of to a file.

1reaction
anthrotypecommented, Jul 12, 2018

you can use pyftsubset with --verbose option, it will tell you each steps it’s currently doing including the final glyph set that it’s actually keeping after evaluating all the options

Read more comments on GitHub >

github_iconTop Results From Across the Web

Safari/Firefox displays text as gibberish at sites that use Flash
This appears to be strictly a display issue, since the text reads just fine when I copy/paste it into TextEdit.
Read more >
Safari font rendering issues - css - Stack Overflow
I tried using -webkit-font-smoothing: subpixel-antialiased; but according to this question, the code isn't working anymore. Chrome: Chrome font-rendering.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found