You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Hao Zhong (Jira)" <ji...@apache.org> on 2021/01/16 09:02:00 UTC

[jira] [Created] (PDFBOX-5082) UnsupportedOperationException for unsupported font?

Hao Zhong created PDFBOX-5082:
---------------------------------

             Summary: UnsupportedOperationException for unsupported font?
                 Key: PDFBOX-5082
                 URL: https://issues.apache.org/jira/browse/PDFBOX-5082
             Project: PDFBox
          Issue Type: Bug
            Reporter: Hao Zhong


I notice that CFFParser throws IOException for unsupported fonts.
{code:java}
 public List<CFFFont> parse(byte[] bytes) throws IOException
{
 CFFDataInput input = new CFFDataInput(bytes);        String firstTag = readTagName(input);
        // try to determine which kind of font we have
        switch (firstTag)
        {
            case TAG_OTTO:
                input = createTaggedCFFDataInput(input, bytes);
                break;
            case TAG_TTCF:
                throw new IOException("True Type Collection fonts are not supported.");
            case TAG_TTFONLY:
                throw new IOException("OpenType fonts containing a true type font are not supported.");
            default:
                input.setPosition(0);
                break;
        }
...
}

{code}
Is it more reasonable and specific to throw UnsupportedOperationException?



--
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