Uh oh!
There was an error while loading. Please reload this page.
Fix Noto font bug - #230
Merged
Merged
Conversation
blikblum
commented
May 23, 2020
Member
LGTM. The only thing i think is missing is a test. You can look at existing ones as a base |
canda
commented
May 26, 2020
ContributorAuthor
🤙 |
A little bit of context. While working with pdfkit we found this error. foliojs/pdfkit#1106 We narrowed down the repro to fontkit with this little script ``` const fs = require('fs'); const notosans = require('fontkit').openSync('./NotoSansCJKsc-Bold.otf'); const subsetFor = (text, file) => { const run = notosans.layout(text); const subset = notosans.createSubset(); run.glyphs.forEach((glyph) => subset.includeGlyph(glyph)); subset.encodeStream().pipe(fs.createWriteStream(file)); }; subsetFor('间。楼', 'output.ttf'); ``` 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 in `topDict.FDArray` and `used_subrs` weren't really the ones corresponding to the current `fd`. So we are saving a dictionary to find the real index were those values were stored. What do you think about this fix?
jordonbiondo
commented
Jun 2, 2020
@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? |
blikblum
commented
Jun 3, 2020
Member
I dont have rights to commit to fontkit, only pdfkit |
e01306821 added a commit
to e01306821/umlet
that referenced
this pull request
Dec 10, 2020
e01306821 added a commit
to e01306821/umlet
that referenced
this pull request
Dec 17, 2020
e01306821 added a commit
to e01306821/umlet
that referenced
this pull request
Dec 17, 2020
afdia pushed a commit
to umlet/umlet
that referenced
this pull request
Dec 19, 2020
jichang
commented
Jul 31, 2021
@devongovett can help to merge this and release a new version ? |
calvin-oen
commented
Jul 31, 2021
we need this to support Noto |
liborm85
commented
Aug 2, 2021
Contributor
@calvin-oen You can use up-to-date fork https://github.com/foliojs-fork/fontkit. |
devongovett added a commit
that referenced
this pull request
May 20, 2022
This reverts commit 35b5f34.
This was referenced Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A little bit of context.
While working with pdfkit we found this error.
foliojs/pdfkit#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.FDArrayandused_subrsweren'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?