Bug 3975

Summary: Text misrenderings in >=2005-07-29 poppler
Product: poppler Reporter: Tarmo Tänav <tarmo>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: high CC: tarmo
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: example pdf
screenshot of broken text rendering
screenshot of what the correct rendering should be (ggv)
Dont ask for bitmap fonts

Description Tarmo Tänav 2005-08-04 08:07:18 UTC
From poppler cvs starting 2005-07-29 to current HEAD I have found several text
misrenderings, they seem to be related to fonts because sometimes pdf's contain
partly working and partly broken text, also evince outputs:
---
Error: Couldn't find a font for 'Times Roman'
some font thing failed
Error: Couldn't find a font for 'Times Bold'
some font thing failed
Error: Couldn't find a font for 'Helvetica'
some font thing failed
---

I'm using latest CVS versions of freetype, cairo and evince. I'll attach one of
the broken pdf's which forks fine in evince with poppler <=2005-07-28, and in
gpdf, ggv.
Comment 1 Tarmo Tänav 2005-08-04 08:08:23 UTC
Created attachment 3246 [details]
backtrace with debug info
Comment 2 Tarmo Tänav 2005-08-04 08:09:06 UTC
Created attachment 3247 [details] [review]
hw-xfree86-x86emu-validate_c.patch
Comment 3 Tarmo Tänav 2005-08-04 08:09:38 UTC
Created attachment 3248 [details] [review]
configure-ac-no-source-on-freebsd.patch
Comment 4 Tarmo Tänav 2005-08-04 08:10:04 UTC
Created attachment 3249 [details] [review]
patch
Comment 5 Kristian Høgsberg 2005-12-04 14:15:11 UTC
Oops, these attachments got messed up by the disk corruption some months ago. 
Closing bug, please reopen and attach files again if problem persists.  Sorry
for the inconvenience.
Comment 6 Tarmo Tänav 2005-12-04 15:20:48 UTC
Created attachment 3981 [details]
example pdf

This file fails to render correct donts with the latest poppler, evince (and
cairo) from cvs.
Comment 7 Tarmo Tänav 2005-12-04 15:22:51 UTC
Created attachment 3982 [details]
screenshot of broken text rendering
Comment 8 Tarmo Tänav 2005-12-04 15:23:46 UTC
Created attachment 3983 [details]
screenshot of what the correct rendering should be (ggv)
Comment 9 Tarmo Tänav 2005-12-04 15:25:42 UTC
Let me know if this pdf renders ok for you because I really don't run a very
clean setup and this problem could easily be caused by something else.
Comment 10 Kristian Høgsberg 2005-12-04 16:13:43 UTC
With cvs head this file renders as it should, I'm guessing this is the same
issue as bug 5149.  If cvs head doesn't work for you, please reopen this bug. 
Thanks.

*** This bug has been marked as a duplicate of 5149 ***
Comment 11 Tarmo Tänav 2005-12-04 17:21:15 UTC
I'm already using poppler and evince cvs HEAD. The pdf in bug 5149 renders fine,
but the one attached to this bug does not. Which library/program or
configuration file could cause poppler not to find these fonts?:
Error: Couldn't find a font for 'Times Roman'
some font thing failed
Error: Couldn't find a font for 'Times Bold'
some font thing failed
Error: Couldn't find a font for 'Helvetica'
some font thing failed
Comment 12 Tarmo Tänav 2005-12-04 17:27:44 UTC
I think bug 4764 is the same as mine (and possibly not a duplicate of 5149
because the pdf in 5149 works fine here(?)), at least the screenshot in that bug
shows exactly the same rendering errors as I get in evince with the pdf in that bug.
Comment 13 Tarmo Tänav 2005-12-05 06:14:26 UTC
Updated to HEAD again, which this time actually included the 'Fix text
corruption bug (#5149)' change, but it did not help.
Comment 14 Kristian Høgsberg 2005-12-10 07:11:59 UTC
What version of freetype are you using and which distro?  Also could you try
latest head which has a different fix for the problem.
Comment 15 Tarmo Tänav 2005-12-10 12:31:22 UTC
One both boxes I'm using gentoo, unstable branch, often updated.
One has freetype 2.1.10 but I also just tried 2.1.9 which made no difference,
cairo version is 1.0.2. Fontconfig (not sure if it's related to this problem
though) is 2.3.2 but I also tried 2.2.3, also, no help.
Second box has freetype cvs (just updated), cairo was some cvs version, not sure
which, but I just downgraded it to 1.0.2.
On both boxes I just upgraded to poppler and evince latest cvs HEAD.

As the checkout date where the problem first appeared is 2005-07-29 I think the
problem is caused or related to the change by Albert Astals Cid 
<aacid@kde.org>: 'Use fontconfig for finding which font use for not embeded
fonts'. Although poppler 0.4.2 was relased after that date, that specific change
is not in 0.4.2 which explains why 0.4.2 does not have this problem.

I could provide an ssh account on one of the boxes for testing, it's a home
server and thus always on, it even has vnc although not a very good upload
speed. Send me an e-mail if you'd like that.
Comment 16 Tarmo Tänav 2005-12-14 02:50:15 UTC
Well, I found something, in GlobalParams.cc, there is an extension check for
.ttf fonts and .pfa/.pfb, but here the extensions for all the fonts which are
not found are .gz.
Comment 17 Tarmo Tänav 2005-12-14 02:50:59 UTC
For 'Times Roman' it finds /usr/X11R6/lib/X11/fonts/75dpi/timR12-ISO8859-1.pcf.gz
Comment 18 Tarmo Tänav 2005-12-17 10:10:08 UTC
ln -s /etc/fonts/conf.d/no-bitmaps.conf /etc/fonts/conf.d/30no-bitmaps.conf
fixed the problem (it disables bitmap fonts for fontconfig). But should poppler
ask fontconfig for fonts in such a way that it would never get bitmap fonts?
Comment 19 Kristian Høgsberg 2005-12-22 06:00:04 UTC
Created attachment 4144 [details] [review]
Dont ask for bitmap fonts

Please give this patch a try.
Comment 20 Tarmo Tänav 2005-12-22 08:27:23 UTC
This patch does not have exactly the same effect as doing what I described in
comment#18. Evince still outputs:
Error: Couldn't find a font for 'Times Roman'
Error: Couldn't find a font for 'Helvetica'
Error: Couldn't find a font for 'Helvetica BoldOblique'
It does render the pdf, although all the fonts in it have the same style, so it
found at least one font; this is with cairo-output disabled. When cairo-output
is enabled the patch changes nothing.
Comment 21 Albert Astals Cid 2009-06-17 13:41:51 UTC
Works for me on current poppler, please reopen if it does not work for you.

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.