You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2020/06/14 14:11:00 UTC

[jira] [Commented] (PDFBOX-4882) Two conditions are always false in TrueTypeEmbedder.isEmbeddingPermitted

    [ https://issues.apache.org/jira/browse/PDFBOX-4882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17135175#comment-17135175 ] 

Tilman Hausherr commented on PDFBOX-4882:
-----------------------------------------

You're right, this can't work. The "& 0x8" makes no sense. 

And FSTYPE_RESTRICTED = 1 is wrong, that one is 2.

> Two conditions are always false in TrueTypeEmbedder.isEmbeddingPermitted
> ------------------------------------------------------------------------
>
>                 Key: PDFBOX-4882
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4882
>             Project: PDFBox
>          Issue Type: Bug
>            Reporter: Alfred
>            Priority: Minor
>
>  
> IntelliJ the 2 conditions bellow are always false in TrueTypeEmbedder
> {code:java}
> private boolean isEmbeddingPermitted(TrueTypeFont ttf) throws IOException
> {
>     if (ttf.getOS2Windows() != null)
>     {
>         int fsType = ttf.getOS2Windows().getFsType();
>         int exclusive = fsType & 0x8; // bits 0-3 are a set of exclusive bits
>         if ((exclusive & OS2WindowsMetricsTable.FSTYPE_RESTRICTED) ==
>                          OS2WindowsMetricsTable.FSTYPE_RESTRICTED)
>         {
>             // restricted License embedding
>             return false;
>         }
>         else if ((exclusive & OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY) ==
>                              OS2WindowsMetricsTable.FSTYPE_BITMAP_ONLY)
>         {
>             // bitmap embedding only
>             return false;
>         }
>     }
>     return true;
> }
> {code}
> Can this be a bug?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org