[
https://issues.apache.org/jira/browse/PDFBOX-5191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17344148#comment-17344148
]
Larry Lynn commented on PDFBOX-5191:
------------------------------------
"the method can be package local instead of protected."
-- I've made this change per your suggestion
"Wouldn't it be enough to just check that {{maskedFsType ==
OS2WindowsMetricsTable.FSTYPE_RESTRICTED}} ?"
-- Yes. I thought that the powers of two calculation might be useful for
differentiating version0-2 tables from version 3+ tables. But what you suggest
is simpler, more readable code. I've made this change.
"Choices 2 or 3 are both fine. "
-- Let's go with Choice 2 please. That will unblock us from an upgrade to
pdfbox 2.0.24+ more quickly. I'd also be happy to write a follow up PR with
unit tests that are compatible with pdfbox 2.0.x
> isEmbeddingPermitted() is too restrictive on TTFs with OS2 table versions 0-2
> -----------------------------------------------------------------------------
>
> Key: PDFBOX-5191
> URL: https://issues.apache.org/jira/browse/PDFBOX-5191
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 2.0.21, 3.0.0 PDFBox
> Reporter: Larry Lynn
> Priority: Major
> Attachments: 2021-05-13_15-20-29.png
>
>
> PDFBOX-4882 fixed a bug that made isEmbeddingPermitted() too permissive. But
> it introduced a bug that made isEmbeddingPermitted() too restrictive for TTFs
> with OS2 table versions 0-2.
>
> TTFs with OS2 table versions 0-2 can have multiple permission bits set.
> According to the spec described in
> [https://docs.microsoft.com/en-us/typography/opentype/spec/os2#fstype]
> "in the event that more than one of bits 0 to 3 are set in a given font, then
> the _least-restrictive permission indicated take precedence_."
> Unfortunately, the current code essentially makes the most restrictive
> permission take precedence. This causes pdfbox to throw an error:
> "This font does not permit embedding"
> when attempting to process fonts that worked fine in pdfbox v2.0.20 and lower
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]