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

Tilman Hausherr edited comment on PDFBOX-5843 at 6/19/24 2:17 PM:
------------------------------------------------------------------

Lets assume that the font is correct. I fixed the bug locally that empty 
entries now get skipped in CFFParser.java, by adding {{if (bytes.length == 0) 
continue;}} after {{for (byte[] bytes : fdIndex)}}.

My first thought was that something goes wrong with the offsets because there 
is more than one fdindex entry. But I haven't been able to prove this.

I also tried to install FontForge but it doesn't show anything.

readIndexData char strings:
code 9987 len 153 at offset 298684
code 12431 len 245 at offset 301280
code 14225 len 135 at offset 303318

for code 9987 (which has this "over the top" path) I checked that position and 
length make sense, all the other bytes before/after are 0x0e, which is ENDCHAR

type2 charstring:
[-79, 67, 592, 63, HSTEM|, 164, 64, 388, 66, VSTEM|, 453, 414, RMOVETO|, -29, 
-122, -48, -120, -64, -78, 17, -9, 28, -18, 13, -10, 62, 84, 54, 127, 33, 132, 
RRCURVETO|, 242, 1, RMOVETO|, 56, -106, 52, -142, 17, -92, 63, 22, RCURVELINE|, 
-17, 92, -52, 139, -59, 106, RRCURVETO|, -353, 414, RMOVETO|, -33, -149, -57, 
-145, -74, -94, 16, -10, 26, -22, 12, -11, 36, 49, 33, 60, 29, 68, RRCURVETO|, 
160, -575, HLINETO|, -13, -5, -4, -12, -14, -43, -1, 2, -49, VHCURVETO|, 10, 
-19, 11, 9342, 8, 21, 39, VVCURVETO|, 575, 200, VLINETO|, -9, -53, -10, -55, 
-7, -37, 57, -11, RCURVELINE|, 13, 53, 18, 86, 13, 72, -46, -55, -419, 
HLINETO|, 21, 56, 18, 60, 14, 60, RRCURVETO|, -265, 16, -102]

converted to type1 sequence:
[0, 1000.0, HSBW|, 453, 414, RMOVETO|, -29, -122, -48, -120, -64, -78, 
RRCURVETO|, 17, -9, 28, -18, 13, -10, RRCURVETO|, 62, 84, 54, 127, 33, 132, 
RRCURVETO|, CLOSEPATH|, 242, 1, RMOVETO|, 56, -106, 52, -142, 17, -92, 
RRCURVETO|, 63, 22, RLINETO|, -17, 92, -52, 139, -59, 106, RRCURVETO|, 
CLOSEPATH|, -353, 414, RMOVETO|, -33, -149, -57, -145, -74, -94, RRCURVETO|, 
16, -10, 26, -22, 12, -11, RRCURVETO|, 36, 49, 33, 60, 29, 68, RRCURVETO|, 160, 
HLINETO|, -575, VLINETO|, 0, -13, -5, -4, -12, 0, RRCURVETO|, -14, 0, -43, -1, 
-49, 2, RRCURVETO|, 0, 10, -19, 11, 0, 9342, RRCURVETO|, 575, VLINETO|, 200, 
HLINETO|, -9, -53, -10, -55, -7, -37, RRCURVETO|, 57, -11, RLINETO|, 13, 
HLINETO|, 53, VLINETO|, 18, HLINETO|, 86, VLINETO|, 13, HLINETO|, 72, VLINETO|, 
-46, HLINETO|, -55, VLINETO|, -419, HLINETO|, 21, 56, 18, 60, 14, 60, 
RRCURVETO|]

The many negative values are a "zone of interest".The many negative values are 
a "zone of interest".


was (Author: tilman):
Lets assume that the font is correct. I fixed the bug locally that empty 
entries now get skipped in CFFParser.java, by adding {{if (bytes.length == 0) 
continue;}} after {{for (byte[] bytes : fdIndex)}}.

My first thought was that something goes wrong with the offsets because there 
is more than one fdindex entry. But I haven't been able to prove this.

I also tried to install FontForge but it doesn't show anything.

readIndexData char strings:
code 9987 len 153 at offset 298684
code 12431 len 245 at offset 301280
code 14225 len 135 at offset 303318

for code 9987 (which has this "over the top" path) I checked that position and 
length make sense, all the other bytes before/after are 0x0e, which is ENDCHAR

type2 charstring:
[-78, 63, 362, 64, 158, 63, 69, 61, HSTEM|, 664, 69, VSTEM|, 67, 290, RMOVETO|, 
54, -35, 57, -42, 52, -43, -54, -90, -68, -64, -81, -40, 15, -12, 20, -25, 8, 
-16, 85, 47, 70, 65, 57, 90, 43, -39, 37, -39, 25, -33, 47, 56, RCURVELINE|, 
-27, 35, -42, 41, -49, 41, 55, 112, 36, 143, 16, 182, -42, -55, -153, HLINETO|, 
14, 70, 12, 69, 9, 63, -66, 4, RCURVELINE|, -7, -63, -12, -71, -14, -72, 
RRCURVETO|, -110, -63, 97, HLINETO|, -22, -105, -27, -102, -24, -72, 
RRCURVETO|, 286, 279, RMOVETO|, -16, -135, -31, -112, -43, -92, -39, 30, -42, 
30, -40, 26, 21, 73, 22, 89, 19, 91, RRCURVETO|, 460, -39, 12902, ENDCHAR|]

converted to type1 sequence:
[0, 1000.0, HSBW|, 453, 414, RMOVETO|, -29, -122, -48, -120, -64, -78, 
RRCURVETO|, 17, -9, 28, -18, 13, -10, RRCURVETO|, 62, 84, 54, 127, 33, 132, 
RRCURVETO|, CLOSEPATH|, 242, 1, RMOVETO|, 56, -106, 52, -142, 17, -92, 
RRCURVETO|, 63, 22, RLINETO|, -17, 92, -52, 139, -59, 106, RRCURVETO|, 
CLOSEPATH|, -353, 414, RMOVETO|, -33, -149, -57, -145, -74, -94, RRCURVETO|, 
16, -10, 26, -22, 12, -11, RRCURVETO|, 36, 49, 33, 60, 29, 68, RRCURVETO|, 160, 
HLINETO|, -575, VLINETO|, 0, -13, -5, -4, -12, 0, RRCURVETO|, -14, 0, -43, -1, 
-49, 2, RRCURVETO|, 0, 10, -19, 11, 0, 9342, RRCURVETO|, 575, VLINETO|, 200, 
HLINETO|, -9, -53, -10, -55, -7, -37, RRCURVETO|, 57, -11, RLINETO|, 13, 
HLINETO|, 53, VLINETO|, 18, HLINETO|, 86, VLINETO|, 13, HLINETO|, 72, VLINETO|, 
-46, HLINETO|, -55, VLINETO|, -419, HLINETO|, 21, 56, 18, 60, 14, 60, 
RRCURVETO|]

The many negative values are a "zone of interest".

> There is an exception when getting embedded font, is it compatible?
> -------------------------------------------------------------------
>
>                 Key: PDFBOX-5843
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5843
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.31, 3.0.2 PDFBox
>            Reporter: liu
>            Priority: Major
>         Attachments: 123.pdf, image-2024-06-19-16-49-40-186.png, 
> screenshot-1.png, screenshot-2.png, xxx.cff
>
>




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