Evince doesn't show "fi"-ligatures in a pdf file when tex-gyre is installed

Bug #1317599 reported by Alexander Buchner
114
This bug affects 24 people
Affects Status Importance Assigned to Milestone
fontconfig (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

When I open the attached pdf file, evince doesn't show the "fi"-ligatures, e.g. on page 17 I only see "Preface to the rst edition".

But when I mark text and copy it, the "fi" is also in there. Also printing works fine.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: evince 3.10.3-0ubuntu10
ProcVersionSignature: Ubuntu 3.13.0-24.47-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Thu May 8 18:54:09 2014
ExecutablePath: /usr/bin/evince
InstallationDate: Installed on 2012-09-03 (612 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
SourcePackage: evince
UpgradeStatus: Upgraded to trusty on 2014-04-18 (20 days ago)

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in evince (Ubuntu):
status: New → Confirmed
Revision history for this message
John Reid (johnbaronreid) wrote :

Happening in evince and xpdf for me.

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

I see the same behavior also in okular.

Revision history for this message
Matthias Braun (matthias-braun-kit) wrote :
Revision history for this message
Lukas (lukas-ribisch) wrote :

Uninstalling "fonts-texgyre" seems to fix it, but I don't know what other problems that might cause.

Revision history for this message
asala (asala) wrote :

It was due to font substitution of standard Helvetica and Times by the TexGyre ones.
Uninstalling such package made the PDF readers use some pfb files in
/usr/share/fonts/X11/Type1/* (Nimbus Sans, Nimbus Roman, DIngbats, ...) which seem to display ligatures correctly (at least in the supplied PDF and another one I had: both results were correct in Evince and Okular).
So, I changed the target package from evince to fonts-texgyre.

In my machine, it was installed from the "recommendations" for package installation from texlive (in my case): it recommended texlive-fonts-recommended and this one recommended tex-gyre and the depending font-texgyre. Hopefully, as it is a "recommended" one this does not break anything essential outside LaTeX.

affects: evince (Ubuntu) → tex-gyre (Ubuntu)
Revision history for this message
James Cloos (launchpad-jhcloos) wrote :

The bug is in fontconfig.

Fontconfig added the Gyre font names to the list of suitable replacements for the base PostScript fonts because the shapes and metrics are compatible.

What they didn’t notice (until the bug reports started) is that the Gyre authors use the names /f_i, /f_l, /f_f, /f_f_i and /f_f_l for the f-ligs, whereas the original PS fonts — which predate the current glyph name best practices — used the names /fi, /fl.

When rendering a pdf file which uses fonts but does not embed them or embed subsets of them, the renderer needs to find a substitute. If fontconfig is used to find such a substitute, and it returns a font which lacks the glyph names said renderer wants — even if it has the glyphs under a different name ­— the desired glyph will not get painted.

Ideally, renderers would notice that the glyph name they want is unavailable and look for alternate names. Or in the case of a known ligature fall back to the un-ligated glyphs. But that hasn’t been written.

The quick fix is to limit font equivilents to those which also have the same glyph naming scheme.

Fontconfig did that in commit c6aa4d4bfc, in responce to the freedesktop bug report noted above.

Distributions should make the same change in their fontconfig packaging.

Distributions should do the same.

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

For me the bug is gone now.

Changed in tex-gyre (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Leopoldo (leops) wrote :

Bug still exists with this file using Tex Gyre Heros (it's a substitute of Helvetica) under same system (Ubuntu 14.04 clean install with texlive-full and fully updated). You can see it in the word "classification" in the whole PDF.

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

I can confirm that. So I reopened the bug.

Changed in tex-gyre (Ubuntu):
status: Fix Released → Confirmed
Changed in tex-gyre (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

The attached file is another example for this bug.

Revision history for this message
Leopoldo (leops) wrote :

Ubuntu 14.10 has the problem fixed. Any option of backport this?

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

The problem is NOT fixed in 14.10!

I still have the problem for the files posted in comments 10 and 12.

Revision history for this message
Leopoldo (leops) wrote :

I can read all the PDFs of this thread, I don't know why you can't. Here I attach the screenshot which proves that I can read all the fi ligatures of the PDFs in a Live CD of Ubuntu 14.10.

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

That's interesting!
My Ubuntu 14.10 (upgraded from 14.04 & fully updated) definitely still doesn't show these ligatures.

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

I also made a screenshot.

Revision history for this message
Leopoldo (leops) wrote :

So, it seems to be fixed in 14.10 in a clean install but not when you upgrade from 14.04. Maybe a configuration file that is not replaced in the system when upgrade? If we get the "diff" between the upgrade and the clean install, we can fix it in 14.04.

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

I will supply additional info about my system if needed.

Revision history for this message
Chinmay Rajhans (rajhanschinmay) wrote :

Any solution/

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

Reporting bugs gets annoying when there is nobody to fix them.

madbiologist (me-again)
summary: - Evince doesn't show "fi"-ligatures in a pdf file
+ Evince doesn't show "fi"-ligatures in a pdf file when tex-gyre is
+ installed
affects: tex-gyre (Ubuntu) → fontconfig (Ubuntu)
Changed in fontconfig (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

In which version of which package is this bug fixed?

Revision history for this message
madbiologist (me-again) wrote :

If you can't do a clean install of Ubuntu 14.10 and need a fix on a system that has been upgraded from trusty, try playing around with the files in /etc/fonts/conf.d and /etc/fonts/ and /etc/fonts/conf.avail
Firstly, read /etc/fonts/conf.d/README

Revision history for this message
madbiologist (me-again) wrote :

It's fixed on Utopic in fontconfig 2.11.1-0ubuntu3 and on Trusty in fontconfig 2.11.0-0ubuntu4.1

the Trusty changelog says:

  * 0001-Bug-73291-poppler-does-not-show-fl-ligature.patch: Don't alias TeX
    Gyre Termes to Times as it has a broken 'fi' ligature. (LP: #1325230)
 -- Iain Lane <email address hidden>

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

So people affected by this bug (14.10, coming from 14.04) won't get an automatic fix?

Revision history for this message
madbiologist (me-again) wrote :

I'm not sure about that.

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

I still have the bug and I don't think that a the solution can be
a) clean install
or
b) manually editing some files which most of the users don't understand

Changed in fontconfig (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
madbiologist (me-again) wrote :

Alexander - what output do you get from these commands?

fc-match Times
fc-match Helvetica

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

~$ fc-match Times
n021003l.pfb: "Nimbus Roman No9 L" "Regular"

~$ fc-match Helvetica
texgyreheros-regular.otf: "TeX Gyre Heros" "Regular"

Revision history for this message
madbiologist (me-again) wrote :

Thanks.

I get the same output for fc-match Times, but for fc-match Helvetica I get:

n019003l.pfb: "Nimbus Sans L" "Regular"

I've attached my copy of the relevant aliases configuration file. If you go to /etc/fonts/conf.avail and backup yours to something like 30-metric-aliases.old and then save mine in the same directory things should be fixed.

Revision history for this message
madbiologist (me-again) wrote :

If that is not sufficient, you might also need to check if you have a /etc/fonts/conf.avail/30-fonts-texgyre-aliases.conf file and rename it.

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

I tried your 30-metric-aliases.conf. Didn't change anything. Do I have to restart some service?

I don't have /etc/fonts/conf.avail/30-fonts-texgyre-aliases.conf.

Still I don't think that manually editing files which requires sudo is the way to fix this bug. 99 % of affected people don't read this bug report here.

Revision history for this message
Chinmay Rajhans (rajhanschinmay) wrote :

Can anyone post simple working solution for this/

Revision history for this message
madbiologist (me-again) wrote :

Sorry, the solution was in front of us all the time.

My 30-metric-aliases.conf was from a clean install of Trusty and is presumabley unmodified by tex-gyre or Latex as I didn't install them, even though it contains some references to tex-gyre as a lower priority match. As per comment #24 the Trusty update that you have installed only contains a fix to stop aliasing TeX Gyre Termes to Times. As Leopoldo said in comment #10, the file attached to comment #10 renders with Tex Gyre Heros (it's a substitute of Helvetica). I've just checked the file you attached to comment #12 and it also uses Helvetica.

Bug 1379375 contains a solution. I have combined this with the patch referenced in comment #24 (from http://cgit.freedesktop.org/fontconfig/commit/?id=c6aa4d4bfcbed14f39d070fe7ef90a4b74642ee7 ) and attached a new 30-metric-aliases.conf file.

As I am not affected by this bug, am not a programmer, and am not an Ubuntu team member I will be unable to assist further with this bug. I have, however, subscribed Canonical's Iain Lane to bug 1379375. You may wish to subscribe yourself to that bug so that you receive notifications about it.

Revision history for this message
Dweia (dweia) wrote :

@madbiologist: thanksa lot! This fixes the bug for me in Ubuntu 12.04 (for both Times and Helvetica)

dweia@zeitlinie:~$ fc-match Helvetica
n019003l.pfb: "Nimbus Sans L" "Regular"
dweia@zeitlinie:~$ fc-match Times
n021003l.pfb: "Nimbus Roman No9 L" "Regular"

Revision history for this message
Iain Lane (laney) wrote :

Thanks madbiologist. I want to keep this bug for the Times issue and use the other one for the general fix. Let's move over there (bug #1379375).

Changed in fontconfig (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Bernd Kreuss (prof7bit) wrote :

Same problem with the µ symbol

demo pdf: http://www.ichaus.de/upload/pdf/DP_datasheet_C3en.pdf (page 4 right side, µA, µs)

when disabling texgyreheros font in KDE font settings then it will use Nimbus-Sans L instead and the the problem disappears. But why does it use a replacement font in the first place when ms corefonts Arial ttf is installed and working?

Revision history for this message
madbiologist (me-again) wrote :

Bernd Kreuss - what version of Ubuntu are you using?

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :

I can confirm Bernd's problem. I don't see the "µ" either with Ubuntu 14.10.
Should we open a new bug for this problem?

Revision history for this message
madbiologist (me-again) wrote :

It would be best to open a new bug for the new issue.

Revision history for this message
Alexander Buchner (alexander-buchner) wrote :
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.