[
https://issues.apache.org/jira/browse/PDFBOX-5326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17447499#comment-17447499
]
Brian Blocher commented on PDFBOX-5326:
---------------------------------------
The SVG will still display. What happens is the embedded font is considered
invalid and ignored. The browser will fall back to the default font and render
the SVG with that.
> 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
> Assignee: Tilman Hausherr
> Priority: Major
> Fix For: 2.0.25, 3.0.0 PDFBox
>
> Attachments: notworking.svg, working.svg
>
>
> 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]
> Attached two svgs with embedded subset fonts. Firefox gives the best console
> error output.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]