[Dapper] Text is not rendered properly

Bug #31596 reported by Trouilliez vincent
14
Affects Status Importance Assigned to Milestone
Poppler
Invalid
Medium
fontconfig (Ubuntu)
Fix Released
Low
Ian Jackson

Bug Description

Evince doesn't display my PDF's properly (anymore, works fine in Breezy), the text is very difficult to read, horrible. I tried with Gpdf, and the text looks normal/correct. I attached a screenshot for a side by side comparison (Gpdf on top, Evince at the bottom).

Revision history for this message
Trouilliez vincent (vincent-trouilliez-modulonet) wrote :
  • Edit (204.7 KiB, image/png)

Side by side comparion:

Gpdf (top) renders properly, Evince (bottom) doesn't.

Revision history for this message
Trouilliez vincent (vincent-trouilliez-modulonet) wrote : Screenshot

Trying again, looks like the first attachement doesn't quite work, I can't click on it somehow...

Revision history for this message
Trouilliez vincent (vincent-trouilliez-modulonet) wrote : The PDF in question

Here is the PDF...

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for your bug, I've forwarded the issue upstream: https://bugs.freedesktop.org/show_bug.cgi?id=5907

Changed in evince:
assignee: nobody → desktop-bugs
status: Unconfirmed → Confirmed
Revision history for this message
In , Sebastien Bacher (seb128) wrote :

That bug has been opened on
https://launchpad.net/distros/ubuntu/+source/evince/+bug/31596

"Evince doesn't display my PDF's properly (anymore, works fine in Breezy), the
text is very difficult to read, horrible. I tried with Gpdf, and the text looks
normal/correct. I attached a screenshot for a side by side comparison (Gpdf on
top, Evince at the bottom).

http://librarian.launchpad.net/1573411/Screenshot.png
    * Screenshot

Trying again, looks like the first attachement doesn't quite work, I can't click
on it somehow...

http://librarian.launchpad.net/1573415/svn-book.pdf
    * The PDF in question

Here is the PDF..."

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

The pdf gives a http error, can you please attach it to the bug?

Revision history for this message
In , Jeff Muizelaar (jeff-infidigm) wrote :

This looks like a font substitution problem

Revision history for this message
In , Sebastien Bacher (seb128) wrote :

the URL works fine from here, what is your issue exactly?

Revision history for this message
In , Jeff Muizelaar (jeff-infidigm) wrote :

launchpad was down when albert tried it

Revision history for this message
In , Jeff Muizelaar (jeff-infidigm) wrote :

what version of poppler? and are you using the cairo backend?

Revision history for this message
In , Jeff Muizelaar (jeff-infidigm) wrote :

It works fine for me. Can you try running poppler's pdffonts on the pdf with
this patch applied: http://people.freedesktop.org/~jrmuizel/pdffonts.patch

Revision history for this message
In , Sebastien Bacher (seb128) wrote :

Ubuntu uses evince and poppler 0.5 (with some of the CVS changes for
#4030,#5758) at the moment with splash

$ pdffonts svn-book.pdf
name type emb sub uni object ID
------------------------------------ ------------ --- --- --- ---------
new name: Helvetica-Bold
Helvetica-Bold Type 1 no no no 3608 0 file:
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBd.ttf
new name: Courier-Oblique
Courier-Oblique Type 1 no no no 3607 0 file:
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoIt.ttf
new name: Helvetica
Helvetica Type 1 no no no 3609 0 file:
/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf
new name: Courier
Courier Type 1 no no no 3610 0 file:
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMono.ttf
new name: Times-Bold
Times-Bold Type 1 no no no 3611 0 file:
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraSeBd.ttf
new name: Times-Italic
Times-Italic Type 1 no no no 3612 0 file:
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraSe.ttf
new name: Times-Roman
Times-Roman Type 1 no no no 3613 0 file:
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraSe.ttf
new name: Courier-Bold
Courier-Bold Type 1 no no no 3614 0 file:
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraMoBd.ttf

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

What does
fc-match Helvetica-Bold
returns in your computer?

Revision history for this message
In , Sebastien Bacher (seb128) wrote :

Without "ttf-bitstream-vera ttf-dejavu" installed the pdf is fine

$ fc-match Helvetica-Bold
helvR12.pcf.gz: "Helvetica" "Regular"

Revision history for this message
In , Albert Astals Cid (aacid) wrote :

Closing the bug because what we do is as fontconfig what font is better to
handle

Helvetica Bold

and in [K]Ubuntu it answers

/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBd.ttf
/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBI.ttf
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraIt.ttf
/usr/share/fonts/type1/gsfonts/n019004l.pfb
/usr/share/fonts/type1/gsfonts/n019044l.pfb
/usr/share/fonts/type1/gsfonts/n019003l.pfb
..... lots more of fonts .....

If you want to get the "nice" n019004l.pfb that is really Helvetica Bold you
have to bug Ubuntu packagers to get the "correct" fontconfig configuration.

That is also why when removing those packages you get what you think it is
"correct" rendering

Revision history for this message
Sebastien Bacher (seb128) wrote :

Upstream rejected the bug with that comment, doing the same for that task:

"Closing the bug because what we do is as fontconfig what font is better to
handle

Helvetica Bold

and in [K]Ubuntu it answers

/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBd.ttf
/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraBI.ttf
/usr/share/fonts/truetype/ttf-bitstream-vera/VeraIt.ttf
/usr/share/fonts/type1/gsfonts/n019004l.pfb
/usr/share/fonts/type1/gsfonts/n019044l.pfb
/usr/share/fonts/type1/gsfonts/n019003l.pfb
..... lots more of fonts .....

If you want to get the "nice" n019004l.pfb that is really Helvetica Bold you
have to bug Ubuntu packagers to get the "correct" fontconfig configuration.

That is also why when removing those packages you get what you think it is
"correct" rendering "

Changed in poppler:
status: Unconfirmed → Rejected
Revision history for this message
Sebastien Bacher (seb128) wrote :

Reassigning to fontconfig

Revision history for this message
Christian Göbel (christiangoebel) wrote : Another test-file

pdf file created by Lyx/latex using standard latex fonts.

Revision history for this message
Christian Göbel (christiangoebel) wrote :

Not sure if this is the same bug. I just uploadet another test-file.
When I open the file on dapper (using Evince) then rendering the file takes minutes.
The displayed file is hardly readable.

The attached file is created by using Lyx/latex and standard latex-fonts.

The file shows up fine in Breezy.
The file shows up fine using Adobe Acrobat (in Dapper and Breezy)

Revision history for this message
Sebastien Bacher (seb128) wrote :

That other example is a different issue, the first one is loading without any issue, could you open a different bug about it?

Revision history for this message
Miguel Martinez (el-quark) wrote :

Hi all,

Opening a text pdf* from Physical Review Letters and Physical Review B in evince also shows the wrong fonts in all the document. I would attach pdf if it were free. However, this doesn't happen with Review of Modern Physics**, although this one uses a different LaTeX document class.

Curiously, if I create a pdf (not with pdfetex, but dvi->ps->pdf) using LaTeX and revtex4 document class (which is what PR* uses), it is displayed properly in evince.

I would post a screenshot for comparison between xpdf (correct) and evince, but it is a similar issue to the screenshot above. If there is anyone interested...

Revision history for this message
Christian Göbel (christiangoebel) wrote :

The issues with the other test-file are solved with the newest updates (yesterday). Thanks a lot!
The problem with the wrong fonts, however, seems to persist.

Revision history for this message
edschofield (schofield) wrote :

The bug is still present as of 2006-03-07. It seems to occur with PDF files that use fonts such as Times Roman without embedding them. Here is an example:

www.latex-project.org/papers/xo-pfloat.pdf

Dapper's fontconfig seems to substitute Bitstream Charter here for Times; hence the incorrect letter spacing.

Revision history for this message
edschofield (schofield) wrote :

Adding the following lines to fonts.conf solves the problem:

<!--
  Alias well known Type1 font names to metric-equivalent TrueType fonts
-->
        <alias>
                <family>Times</family>
                <accept><family>FreeSerif</family></accept>
        </alias>
        <alias>
                <family>Helvetica</family>
                <accept><family>FreeSans</family></accept>
        </alias>
        <alias>
                <family>Courier</family>
                <accept><family>FreeMono</family></accept>
        </alias>
        <alias>
                <family>Symbol</family>
                <accept><family>Standard Symbols L</family></accept>
        </alias>

I think these fonts are metrically equivalent to the Adobe fonts. The alias for Symbol is necessary for some PDF files that use Times-compatible math fonts without embedding them.

After this change, the command
    fc-match Times
gives:
    FreeSerif.ttf: "FreeSerif" "Medium"
instead of:
    VeraSe.ttf: "Bitstream Vera Serif" "Roman".
Then the svn-book.pdf file that Vincent Trouilliez identified as a problem looks fine under evince, as do the others I've tested.

I don't think it's necessary to substitute the Microsoft equivalents of these fonts (like SUSE does), even if the msttcorefonts package is installed. Substituting Times New Roman for Times, in particular, look worse than substituting FreeSerif in my humble opinion. See attached screenshots.

Revision history for this message
edschofield (schofield) wrote : Current font config

Screenshot showing current evince rendering of a document with non-embedded fonts

Revision history for this message
edschofield (schofield) wrote : Screenshot with suggested font config

Screenshot showing evince rendering of a document with non-embedded fonts with the suggested modification to /etc/fonts.conf

Revision history for this message
edschofield (schofield) wrote : Screenshot with substitution of Microsoft fonts

Screenshot showing evince rendering of a document with non-embedded fonts with the substitution of Microsoft fonts.

Revision history for this message
Daniel Holbach (dholbach) wrote :

Michael, do you think the suggested fontconfig changes are reasonable?

Revision history for this message
edschofield (schofield) wrote :

Actually, it seems that fonts.conf supplied with the upstream fontconfig package does something similar, substituting the URW Nimbus fonts for Times, Helvetica, and Courier, but that the Ubuntu package comments these lines out. See http://archive.ubuntu.com/ubuntu/pool/main/f/fontconfig/fontconfig_2.3.2-1.1ubuntu5.diff.gz

I don't know the rationale behind the Ubuntu fontconfig package maintainer's decision to do this, but this is the cause of the incorrect fonts in e.g. evince.

The removed lines from the above diff are:
 <!--
- URW provides metric and shape compatible fonts for these 3 Adobe families.
- -->
- <alias>
- <family>Times</family>
- <accept><family>Nimbus Roman No9 L</family></accept>
- </alias>
- <alias>
- <family>Helvetica</family>
- <accept><family>Nimbus Sans L</family></accept>
- </alias>
- <alias>
- <family>Courier</family>
- <accept><family>Nimbus Mono L</family></accept>
- </alias>
-

One further note --- restoring these lines fixes these three fonts, but not the substitution for the Adobe Symbol font:

user@host:~$ fc-match Symbol
DejaVuSans.ttf: "DejaVu Sans" "Book"

This causes evince to render PDF documents with non-embedded Symbol characters (such as mathematical papers) incorrectly, as in the attached screenshot. So I would also recommend making a Symbol substitution such as
        <alias>
                <family>Symbol</family>
                <accept><family>Standard Symbols L</family></accept>
        </alias>
or an equivalent.

Revision history for this message
edschofield (schofield) wrote : Screenshot of evince rendering a PDF with non-embedded fonts with the font substitutions for Adobe Times etc restored to fontconfig defaults

Screenshot of evince rendering a PDF with non-embedded fonts with the font substitutions for Adobe Times etc restored to fontconfig defaults.

Note that the font substituted for Symbol (greek delta, alpha) is still a poor choice, not consistent with Times etc.

Revision history for this message
Michael Vogt (mvo) wrote :

From the debian/changelog it seems that Keith Packard (upstream author of fontconfig) lowered the priority of the URW fonts (changelog for 2.3.2-1). Unfortunately there is no reasoning why this was done.

Cheers,
 Michael

Revision history for this message
Matt Zimmerman (mdz) wrote :

Please contact Keith about this issue and see if he can offer any advice

Revision history for this message
Ian Jackson (ijackson) wrote :

I think we have probably improved this situation with recent changes to fontconfig to support the anymetrics=1 property. Can you confirm whether there are still problems, and if so indicate which of the test cases described here are still broken ? (Or failing that, attach a new test case file.)

Changed in fontconfig:
assignee: desktop-bugs → ijackson
status: Confirmed → Needs Info
Revision history for this message
Trouilliez vincent (vincent-trouilliez-modulonet) wrote :

Nope, no problems anymore at first sight, my documents are readable again now.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Closing as fixed then. Feel free to reopen if you get the issue again

Changed in fontconfig:
status: Needs Info → Fix Released
Revision history for this message
edschofield (schofield) wrote :

Yes, the font matching is much better now. Well done!

Revision history for this message
edschofield (schofield) wrote :

I'd still be interested to know why the upstream fontconfig developers substitute the URW Nimbus fonts for Adobe Times etc rather than substituting the free UCS outline fonts (FreeSerif, FreeSans etc.) I think these are closer to the Adobe fonts, and look very respectable (see the screenshot above, dated 2006-03-14 12:40:37).

Changed in poppler:
importance: Unknown → Medium
Changed in poppler:
importance: Medium → Unknown
Changed in poppler:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.