Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.24
-
None
Description
The log2 method in TTFSubsetter is incorrectly calling round instead of floor on the log2 result.
If
Math.log(num) / Math.log(2)
results in a whole number, the searchRange is correct but decimal results could get rounded up or down.
The spec calls for a floor of the result.
https://docs.microsoft.com/en-us/typography/opentype/spec/cmap#:~:text=uint16-,searchRange,-Maximum%20power%20of
Attached two svgs with embedded subset fonts. Firefox gives the best console error output.