Brian Blocher created PDFBOX-5326:
-------------------------------------

             Summary: TTFSubsetter incorrectly calculating 'searchRange'
                 Key: PDFBOX-5326
                 URL: https://issues.apache.org/jira/browse/PDFBOX-5326
             Project: PDFBox
          Issue Type: Bug
          Components: FontBox
    Affects Versions: 2.0.24
            Reporter: Brian Blocher


The log2 method in TTFSubsetter is incorrectly calling _round_ instead of 
_floor_ on the log2 result.

If 
{code:java}
Math.log(num) / Math.log(2){code}
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



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to