Open lehni opened 2 months ago
Creating a test case that fails in current code and is fixed with the PR would help
Like I said, I'm only encountering this issue with one font so far, and I cannot share this font for reasons of copyright.
The change is correct IMO and seems obvious. case 4 in lookup earlier in the file has return gid & 0xffff;
which is simply the inverse of this.
At Lineto we have a typeface where the following code does not retrieve all code-points correctly. Sadly, we cannot share the font here. I tried a few other open-source fonts, but did not encounter the same issue.
Wit our font, for most glyphs, I am getting correct results, such as:
But for quite a few,
codePointsForGlyph()
doesn't produce the inverse ofglyphForCodePoint()
:This simple PR fixes this bug: