Closed prepare closed 7 years ago
I found a bug in cmap's calculation of glyphIdArrayLength I test with tahoma font, on Windows
with character unicode3652 => ไ
"IndexOutOfRange exception"
I reviewed what size of the glyphIdArray should be, according to //https://www.microsoft.com/typography/otspec/cmap.htm
This obscure indexing trick works because glyphIdArray immediately follows idRangeOffset in the font file. The C expression that yields the glyph index is: *(idRangeOffset[i]/2 + (c - startCount[i]) + &idRangeOffset[i])
This obscure indexing trick works because glyphIdArray immediately follows idRangeOffset in the font file. The C expression that yields the glyph index is:
*(idRangeOffset[i]/2 + (c - startCount[i]) + &idRangeOffset[i])
so, I fixed it as describe in picture below.
I also send you a pull request, but you can just copy-n-paste.
Fixed in #21. Thank you!
I found a bug in cmap's calculation of glyphIdArrayLength I test with tahoma font, on Windows
with character unicode3652 => ไ
"IndexOutOfRange exception"
I reviewed what size of the glyphIdArray should be, according to //https://www.microsoft.com/typography/otspec/cmap.htm
so, I fixed it as describe in picture below.
I also send you a pull request, but you can just copy-n-paste.