Closed canda closed 2 years ago
LGTM. The only thing i think is missing is a test. You can look at existing ones as a base
🤙 Added a test to check this case @blikblum
@blikblum bump, we're forking fontkit and pdfkit for now so we can use this fix, any word on merge and release so pdfkit can be updated?
I dont have rights to commit to fontkit, only pdfkit
@devongovett can help to merge this and release a new version ?
we need this to support Noto
@calvin-oen You can use up-to-date fork https://github.com/foliojs-fork/fontkit.
A little bit of context. While working with pdfkit we found this error. https://github.com/foliojs/pdfkit/issues/1106 We narrowed down the repro to fontkit with this little script
With this script you can see that glyphs were missing on the subset font if you opened the font with something like fontforge
Regarding the logic behind this fix, when
!used_fds[fd]
was false, last items intopDict.FDArray
andused_subrs
weren't really the ones corresponding to the currentfd
. So we are saving a dictionary to find the real index were those values were stored.What do you think about this fix?