Closed blikblum closed 5 years ago
@blikblum Thanks for this PR: As far as I see, this does not change the API. However, after having updated fontkit I still get the same results as described here https://github.com/bpampuch/pdfmake/issues/1659. Not sure if I did everything the right way. Does this require further changes in the downstream modules?
Did you rebuild font kit?
Check, I built and it worked! Great!
would require to make all offsets even numbers, needing to add some sort of data padding complicating things at write and read time
FWIW I work on a Racket port of fontkit
. I discovered this problem independently. AFAICT padding glyf
data buffer to a 2-byte boundary is established practice (in ancient times, these buffers were even padded to 4-byte boundaries). It can be done in one line right about here. It works fine. I agree with @devongovett’s original logic about deriving the loca
version rather than copying it, because the short version is intended as a kind of compression.
I agree with @devongovett’s original logic about deriving the loca version rather than copying it, because the short version is intended as a kind of compression.
Nice, please create a PR so we can review.
I work on a Racket port of fontkit
. Unfortunately I don’t know how to fix it in JS.
Fixes saving the loca index format when subsetting.
Fonts with version 1 (long format) were being saved with version 0. This was mangling the odd offsets (they were being saved divided by two and read multiplied by two creating a off by one error)
Probably fixes https://github.com/bpampuch/pdfmake/issues/1659 and https://github.com/foliojs/pdfkit/issues/914