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

Maruan Sahyoun commented on PDFBOX-4692:
----------------------------------------

I'd like to add some information specific for Type 3 fonts. As Tilman already 
pointed out for some fonts having a font descriptor is required. But for type 3 
fonts the spec (1.5) has this

{quote}
Font descriptors shall not be used with Type 0 fonts. Beginning with PDF 1.5, 
font descriptors may be used with Type 3 fonts.
{quote}

So for that it's perfectly fine that there is no font descriptor and thus the 
call returns {{null}}

And event if there is one regarding ascent/descent the spec has this 

{quote}
Ascent number (Required, except for Type 3 fonts)
The maximum height above the baseline reached by glyphs in this font. The 
height of glyphs for accented characters shall be excluded.
Descent number (Required, except for Type 3 fonts)
The maximum depth below the baseline reached by glyphs in this font. The value 
shall be a negative number.
{quote}

Hope that clarifies that you can not depend on having that information even in 
a conforming file. And as Tilman pointed out there are many non conforming 
files out there.

> Document if and when PDFont.getFontDescriptor() may return null
> ---------------------------------------------------------------
>
>                 Key: PDFBOX-4692
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4692
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 2.0.17
>         Environment: Windows 10.0.18362.418
>            Reporter: Gili
>            Priority: Major
>         Attachments: image-2019-11-16-22-03-15-015.png
>
>
> Please document under which conditions {{PDFont.getFontDescriptor()}} may 
> return null and what can be done to calculate the text ascent/descent. 
> Clearly, this should be possible to calculate as the text ends up getting 
> rendered.
> Background information:
> I have a PDF file (credit card statement, so it cannot be shared easily) that 
> contains an embedded {{PDType3Font}} called "C0EX06Q0". When I invoke 
> {{PDFont.getFontDescriptor()}} I get null. 
> I have a screenshot of what it looks like. 
> !image-2019-11-16-22-03-15-015.png|thumbnail! 



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