Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Message "True type font doesn't contain cmap table" #1487

Open
pbroissiat opened this issue Oct 29, 2024 · 4 comments
Open

Invalid Message "True type font doesn't contain cmap table" #1487

pbroissiat opened this issue Oct 29, 2024 · 4 comments

Comments

@pbroissiat
Copy link

test.pdf

We got this message with this pdf : True type font doesn't contain cmap table.(object key = 21 0 obj)

We are using CIDFontType2 embedded font and pdf 1.7 documentation says :

These TrueType tables shall always be present if present in the original TrueType font program: “head”, “hhea”, “loca”, “maxp”, “cvt”, “prep”, “glyf”, “hmtx”, and “fpgm”. If used with a simple font dictionary, the font program shall additionally contain a cmap table defining one or more encodings, as discussed in 9.6.6.4, "Encodings for TrueType Fonts". If used with a CIDFont dictionary, the cmap table is not needed and shall not be present, since the mapping from character codes to glyph descriptions is provided separately.

cmap is replaced by CIDToGIDMap. It already contains mapping from CID to glyph.

@bdoubrov
Copy link
Contributor

@pbroissiat I wonder which version of veraPDF do you use?

When running veraPDF version 1.26 (the latest release) on your test file I see a different warning in the logs:

Can't parse CMap CMap 25 0 obj, using default

And a bit more detail in the strerr:

java.io.IOException: CMap contains invalid entry in bfchar. Expected TT_NAME or TT_HEXSTRING but got TT_CLOSEARRAY

When checking the CMap stream (not to confuse with cmap table in the TrueType font), I see that it is indeed broken. For example, it contains lines like this:

30 beginbfrange
<0000> <0002> [  ] <0003> <0061> <0020> <0062> <00ff> [ ...

which looks like a garbage.

@pbroissiat
Copy link
Author

testok.pdf
Sorry, it's my fault, we already solved this problem but I chose wrong file.

I have tried developement build and this message (Can't parse CMap CMap 25 0 obj, using default) seems to have disappeared. That's why I chose bad file. I agree that test.pdf was wrong.

@pbroissiat
Copy link
Author

There are also 2 other messages that have disappeared in dev release. I opened an issue for that and answer is that they were wrong messages. Thats's why I have tried dev release but I think it's better to come back to 1.26 release.

@bdoubrov
Copy link
Contributor

bdoubrov commented Nov 1, 2024

Ah, dev version is indeed a bit different as we are in process of cleaning up undesired log messages. I was able to reproduce your initial log. It has level FINE, which means this is mainly additional information, not a deviation from any standards or requirements. These messages are not shown by default. So, maybe you set up higher log level.

I do fully agree that cmap subtables are not required for CIDType2Fonts. We'll check if we can optimize our code and avoid attempts to access cmap subtables in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants