Bug 106898 - Poppler shows a glyph when it should not
Summary: Poppler shows a glyph when it should not
Status: RESOLVED MOVED
Alias: None
Product: poppler
Classification: Unclassified
Component: cairo backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-12 15:36 UTC by Marek Kasik
Modified: 2018-08-21 10:40 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Fix showing of non-existent glyphs (2.75 KB, patch)
2018-06-12 15:39 UTC, Marek Kasik
Details | Splinter Review
Don't show non-existent glyphs (2.99 KB, patch)
2018-06-21 14:24 UTC, Marek Kasik
Details | Splinter Review

Description Marek Kasik 2018-06-12 15:36:42 UTC
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:

https://bugzilla.redhat.com/show_bug.cgi?id=1589594

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.
Comment 1 Marek Kasik 2018-06-12 15:39:31 UTC
Created attachment 140132 [details] [review]
Fix showing of non-existent glyphs

This probably needs to run through a regression test.
Comment 2 Marek Kasik 2018-06-12 15:43:08 UTC
Maybe some warning would be helpful there. What do you think?
Comment 3 Albert Astals Cid 2018-06-13 21:16:15 UTC
Is the patch wrong? It's about attachments and you're speaking about glyphs?
Comment 4 Marek Kasik 2018-06-21 14:24:18 UTC
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.
Comment 5 GitLab Migration User 2018-08-21 10:40:07 UTC
-- 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.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.