pyftsubset generated WOFF2 renders fine on Firefox/Chrome but shows gibberish on Safari
See original GitHub issueHello,
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:
- Created 5 years ago
- Comments:22 (14 by maintainers)
Top GitHub Comments
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).-o -
is to print to standard output instead of to a file.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