opentype.js having problem processing ttf font extracted from ttc
See original GitHub issueOK, I will admit this is a confusing case, but this is what we believe we know so far:
- OS X El Capitan comes with a new default system font for Chinese users, aka
PingFang
. So I am trying to analyze it with opentype.js’ Font Inspector. - Between their Developer Preview Beta1 and Beta2, Apple made some changes to this font, naturally, I want to see what’s the difference.
The steps I use is as following:
- get the font from
/System/Library/Fonts/
- unpack with ttc2ttf https://gist.github.com/kayahr/2479682
- load using http://nodebox.github.io/opentype.js/font-inspector.html
Problem is: while the resulting ttf from DP1 works, the ones from DP2 font doesn’t, font inspector gives us TypeError: Cannot read property 'glyphIndexMap' of null
which I believe is an error from opentype.js
, not just the Font Inspector script.
Initially we believe this is a problem with ttc2ttf
, because DP2 ttc is using some kind of offsets to give the same ttf payload 2 different names (apologize in advance for using the wrong terms, don’t know the spec well enough myself), ie. both DP1 and DP2 PingFang.ttc
contains only 12 actual font files, but DP2 adds extra alias to each fonts, so 24 names show up.
But using fonttools
and Apple Font Book we are not able to find any faults with these files.
So I have a theory, somewhere in opentype.js
, there is a bug that’s only triggered under this scenario. Would you take a look when available?
I will share the DP2 PingFang.ttc here in case you need it (probably against its font license, but hopefully for a good cause)
https://www.dropbox.com/s/qnfy6q41zkji330/PingFang_DP2.ttc.zip?dl=0
For an introduction on PingFang, see my blog post: http://bitinn.net/11280/
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
@Jolg42 “Synalyze It! - much more than a Hex Editor for Mac OS X”
@blackgear Thank you 😉 It works well! I will update the awesome-typography repo asap!