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 2021/01/20 18:45:00 UTC
[jira] [Closed] (PDFBOX-5082) UnsupportedOperationException for
unsupported font?
[ https://issues.apache.org/jira/browse/PDFBOX-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tilman Hausherr closed PDFBOX-5082.
-----------------------------------
Resolution: Won't Do
> UnsupportedOperationException for unsupported font?
> ---------------------------------------------------
>
> Key: PDFBOX-5082
> URL: https://issues.apache.org/jira/browse/PDFBOX-5082
> Project: PDFBox
> Issue Type: Bug
> Reporter: Hao Zhong
> Priority: Major
>
> 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