Cairo backend shows a glyph when rendering a text using Type3 font even if there is no glyph for current char code. This was reported to me downstream here together with reproducer:
The PDF seems wrong because it does not have glyph for space in its Type3 font.
Looking at the code, the codeToGID table of CairoFont is initialized with zeros and only existing glyphs get a valid index.
I propose to initialize the table with -1s and propagate this information through getGlyph() so the CairoOutputDev::drawChar() can check whether the index was actually set.
Created attachment 140132 [details] [review]
Fix showing of non-existent glyphs
This probably needs to run through a regression test.
Maybe some warning would be helpful there. What do you think?
Is the patch wrong? It's about attachments and you're speaking about glyphs?
Created attachment 140262 [details] [review]
Don't show non-existent glyphs
(In reply to Albert Astals Cid from comment #3)
> Is the patch wrong? It's about attachments and you're speaking about glyphs?
You are right, I'm sorry, it was wrong patch.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/316.