Bug 5758

Summary: GlobalParams::getDisplayFont fails if best font is not TrueType/Type1
Product: poppler Reporter: Ed Catmur <ed>
Component: generalAssignee: Jeff Muizelaar <jmuizelaar>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: high CC: dberkholz, dynamotwain, ghepeu, jmuizelaar, sschweizer, uws+freedesktop
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: 5758.bugs.fdo-try-all-fonts.patch
revised patch
Backtrace

Description Ed Catmur 2006-01-29 19:38:43 UTC
$ evince blah.pdf
Error: Couldn't find a font for 'Times Bold'
some font thing failed
Error: Couldn't find a font for 'Times Italic'
some font thing failed

Result: garbage displayed, crash on exit.

$ fc-match --sort 'Times'
timR12-ISO8859-1.pcf.gz: "Times" "Regular"
timR12.pcf.gz: "Times" "Regular"
n021004l.pfb: "Nimbus Roman No9 L" "Medium"
times.ttf: "Times New Roman" "Regular"
luxirr.ttf: "Luxi Serif" "Regular"
msbm10.ttf: "msbm10" "Medium"
etc.

GlobalParams::getDisplayFont fails if the first font found is not TrueType
(*.ttf) or Type1 (*.pfa, *.pfb). This is stupid; it should loop through the list
of matches and return the first (best) TrueType/Type1 font that matches.
Comment 1 Ed Catmur 2006-01-29 19:52:31 UTC
Probably the same as bug 4030 (yeah, I found it when I looked for a downstream
bug - meaningful bug names, people). However the patch here is IMO superior.
Comment 2 Ed Catmur 2006-01-29 19:55:15 UTC
Created attachment 4503 [details] [review]
5758.bugs.fdo-try-all-fonts.patch

Oh yeah, here's the patch as suggested above.

Leaving this separate from bug 4030 as there are other possible triggers for
this condition (and it's generally good code cleanup).
Comment 3 Wouter Bolsterlee 2006-01-30 10:47:31 UTC
You so totally rock, dude.
Comment 4 Wouter Bolsterlee 2006-01-30 10:54:21 UTC
Btw, why can't OpenType fonts be used properly?
Comment 5 Wouter Bolsterlee 2006-02-01 23:52:09 UTC
2006-01-31  Jeff Muizelaar  <jeff@infidigm.net>

        * poppler/GlobalParams.cc (GlobalParams::getDisplayFont):
        Allow ttc fonts to be used.


This commit rendered the patch from comment 2 useless. Can anyone please look
into this?
Comment 6 Ed Catmur 2006-02-02 01:44:47 UTC
Created attachment 4528 [details] [review]
revised patch

This should work.
Comment 7 Wouter Bolsterlee 2006-02-02 02:11:12 UTC
Confirming that this patch fixes the problems. Can someone commit this? It fixes
bug #4030 too.
Comment 8 Jeff Muizelaar 2006-02-02 04:52:13 UTC
It doesn't actually fix bug #4030 just avoids the problem. Nonetheless I'll 
commit this soon.
Comment 9 Wouter Bolsterlee 2006-02-02 04:55:21 UTC
The file at [1] still causes crashes and font warnings on the console. Can you
confirm?

[1] http://www.rovernet.nl/nieuws/berichten/ber060118bijl3.pdf
Comment 10 Jeff Muizelaar 2006-02-02 05:02:56 UTC
That is probably caused by bug #4030. What are the font warnings it gives you?
Comment 11 Wouter Bolsterlee 2006-02-02 05:16:50 UTC
evince ber060118bijl3.pdf
Error: could not create truetype face

some font thing failed
Error: could not create truetype face

some font thing failed


Will attach a backtrace...
Comment 12 Wouter Bolsterlee 2006-02-02 05:18:02 UTC
Created attachment 4533 [details]
Backtrace

Crash on exit...
Comment 13 Stefan Schweizer 2006-02-04 10:18:40 UTC
Any progress here?
Comment 14 Jeff Muizelaar 2006-02-05 07:44:22 UTC
committed.

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.