[ 
https://issues.apache.org/jira/browse/PDFBOX-4882?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alfred updated PDFBOX-4882:
---------------------------
    Description: 
 

IntelliJ says 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?

 

  was:
 

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?

 


> 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
>    Affects Versions: 2.0.20
>            Reporter: Alfred
>            Priority: Minor
>             Fix For: 2.0.21, 3.0.0 PDFBox
>
>
>  
> IntelliJ says 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to