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

Tilman Hausherr edited comment on PDFBOX-5942 at 1/30/25 11:58 AM:
-------------------------------------------------------------------

They all look like this:
{code}
/FontType 1 def
/FontInfo 10 dict def
/FontMatrix [0.001 0 0 0.001 0 0] def
/FontBBox [-176 -214 1124 1036] def
/PaintType 0 def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
{code}
After "dict" we expect "begin" or "dup begin".

I looked into the PostScript reference, it has one example with {{/mydict 5 
dict def}}. I suspect that this defines an empty dictionary. (Update: I asked 
ChatGPT and it agrees 😂
 !image-2025-01-30-12-58-38-863.png! 
)

This is how it usually looks in type1 fonts:
{code}
/FontInfo 9 dict dup begin
 /version (Version 2.33) readonly def
 /Notice (Copyright [c] 2003 by Bitstream, Inc. All Rights Reserved.) readonly 
def
 /FullName (DejaVu Serif Condensed) readonly def
 /FamilyName (DejaVu Serif Condensed) readonly def
 /Weight (Book) readonly def
 /ItalicAngle 0 def
 /isFixedPitch false def
 /UnderlinePosition -63 def
 /UnderlineThickness 44 def
end readonly def
{code}


was (Author: tilman):
They all look like this:
{code}
/FontType 1 def
/FontInfo 10 dict def
/FontMatrix [0.001 0 0 0.001 0 0] def
/FontBBox [-176 -214 1124 1036] def
/PaintType 0 def
/Encoding 256 array
0 1 255 {1 index exch /.notdef put} for
{code}
After "dict" we expect "begin" or "dup begin".

I looked into the PostScript reference, it has one example with {{/mydict 5 
dict def}}. I suspect that this defines an empty dictionary. (Update: I asked 
ChatGPT and it agrees 😂)

This is how it usually looks in type1 fonts:
{code}
/FontInfo 9 dict dup begin
 /version (Version 2.33) readonly def
 /Notice (Copyright [c] 2003 by Bitstream, Inc. All Rights Reserved.) readonly 
def
 /FullName (DejaVu Serif Condensed) readonly def
 /FamilyName (DejaVu Serif Condensed) readonly def
 /Weight (Book) readonly def
 /ItalicAngle 0 def
 /isFixedPitch false def
 /UnderlinePosition -63 def
 /UnderlineThickness 44 def
end readonly def
{code}

>  Can't read the embedded Type1 font: Found Token[kind=NAME, text=def] but 
> expected begin
> ----------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-5942
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5942
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.33, 3.0.4 PDFBox
>            Reporter: Richard Kwasnicki
>            Assignee: Tilman Hausherr
>            Priority: Major
>              Labels: type1, type1font
>             Fix For: 2.0.34, 3.0.5 PDFBox, 4.0.0
>
>         Attachments: image-2025-01-30-12-58-38-863.png, sample-font-1.type1, 
> sample-font-2.type1, sample-font-3.type1
>
>
> Im using Apache PDFBox for a while, right now in Version 3.0.4 but
> also with previous Versions I have a bunch of errors loading some
> Fonts.
> Some examples I provided here, the specific error is for the first one, but 
> they all follow the same error. 
> It says: Can't read the embedded Type1 font ZSQJQL+GuardianSans-Light_00
> >  java.io.IOException: Found Token[kind=NAME, text=def] but expected begin at
> > org.apache.fontbox.type1.Type1Parser.read(Type1Parser.java:893) at
> > org.apache.fontbox.type1.Type1Parser.readSimpleDict(Type1Parser.java:326)
> > at org.apache.fontbox.type1.Type1Parser.parseASCII(Type1Parser.java:136)
> > at org.apache.fontbox.type1.Type1Parser.parse(Type1Parser.java:63) at
> > org.apache.fontbox.type1.Type1Font.createWithSegments(Type1Font.java:85)
> > at org.apache.pdfbox.pdmodel.font.PDType1Font.<init>(PDType1Font.java:243)
> > at 
> > org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:140)
> > at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:170)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to