flathub / org.gnome.Evince

https://flathub.org/apps/details/org.gnome.Evince
2 stars 15 forks source link

Missing fonts and message: some font thing failed #33

Closed codingepaduli closed 2 years ago

codingepaduli commented 4 years ago

Pdf file (in attachment) is opened, but fonts are missing.

When I start Evince, I got these lines:

flatpak run  --verbose org.gnome.Evince 
F: No installations directory in /etc/flatpak/installations.d. Skipping
F: Opening system flatpak installation at path /var/lib/flatpak
F: Opening user flatpak installation at path /home/io/.local/share/flatpak
F: Opening user flatpak installation at path /home/io/.local/share/flatpak
F: Opening system flatpak installation at path /var/lib/flatpak
F: Opening user flatpak installation at path /home/io/.local/share/flatpak
F: Opening system flatpak installation at path /var/lib/flatpak
F: Cleaning up unused container id 2739479457
F: Allocated instance id 1352683812
F: Add values in dir '/org/gnome/evince/', prefix is '/org/gnome/Evince/'
F: Add defaults in dir /org/gnome/Evince/
F: Add locks in dir /org/gnome/Evince/
F: writing D-Conf values to /home/io/.var/app/org.gnome.Evince/config/glib-2.0/settings/keyfile
F: Disallowing network access
F: Allowing host-fs access
F: Allowing wayland access
F: Allowing x11 access
F: Running 'bwrap --args 32 xdg-dbus-proxy --args=34'
F: Running 'bwrap --args 32 evince

When Evince has been started and I choose to open the file (in the recent documents), I got these lines in output:

some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed
some font thing failed

This is the file to test.

LETTERA_NOTIFICA_TRASFERIMENTO_SECONDARIA_II_GRADO_202021_7.pdf

When I open it with Chromium, I get this image:

Istantanea_Chromium

When I open it with Evince, I get this:

Istantanea_Evince

gpoo commented 3 years ago

The document does not have embedded the font. The font it references is Helvetica, which is non-free, and there does not seem to have an alternative font or poppler is not finding it.

codingepaduli commented 3 years ago

When I use Evince, not installed by Flatpak, but by Debian repository with apt-get install, I can see the document. Running evince LETTERA_NOTIFICA_TRASFERIMENTO_SECONDARIA_II_GRADO_202021_7.pdf I will see this image: LETTERA_etc

So I have some font installed from the Debian repository. How can I check I'm using Helvetica and NOT an alternative free font? Any suggestion?

Can't you add an extra non-free package to install ?

Thanks for your great work

nsmlzl commented 3 years ago

I have the same issue! This issue is really frustrating.

codingepaduli commented 3 years ago

There are a lot of bugs about fonts in flatpak.

Searching in the original repository https://github.com/flatpak/flatpak/ , in the issue page with the filter "is:issue is:open font", it will show a lot of bugs, as you can see here: https://github.com/flatpak/flatpak/issues?page=1&q=is%3Aissue+is%3Aopen+font

hadess commented 3 years ago

I can't reproduce the problem here.

Outside the sandbox:

Screenshot from 2021-08-07 20-20-46

Inside the sandbox

Screenshot from 2021-08-07 20-21-50

In both cases it's an Helvetica replacement font that's getting chosen, and it's exported by the host (though it's a user font in the latter case). What does the font properties dialogue look like on your systems when opening a broken file?

You can check whether the font that gets selected is available inside the sandbox with:

flatpak run --command="fc-list" org.gnome.Evince | grep -i arial

for example

thalesmaoa commented 2 years ago

I can't figure how to fix it. But it seems to point to a font that doesn't exist.

$ flatpak run --command=sh org.gnome.Evince

[πŸ“¦ org.gnom[πŸ“¦ org.gnome.Evince ~]$ ls -lha /run/host/fonts/X11/Type1/qhvr.pfb 
lrwxrwxrwx 1 nfsnobody nfsnobody 51 fev 28  2019 /run/host/fonts/X11/Type1/qhvr.pfb -> ../../../texmf/fonts/type1/public/tex-gyre/qhvr.pfb

[πŸ“¦ org.gnome.Evince ~]$ ls -lha /run/host/fonts/X11/Type1/../../../texmf/fonts/type1/public/tex-gyre/
ls: nΓ£o foi possΓ­vel acessar '/run/host/fonts/X11/Type1/../../../texmf/fonts/type1/public/tex-gyre/': Arquivo ou diretΓ³rio inexistente
christianrauch commented 2 years ago

I am facing the same issue with the document passport-application-form-data.pdf. This document has form fields that will not show the content after entering text. I am using flatpak 1.12.4 on Ubuntu 20.04. Another example of a PDF that is affected by this issue is given in the Ubuntu bug tracker at https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1448778. The file theory_scalar.pdf will not show correctly due to missing fonts.

I originally reported the issue to Evince https://gitlab.gnome.org/GNOME/evince/-/issues/1739 where others could not reproduce this issue using this flatpak. And I also don't have these issues with flatpak 1.12.4 on a Arch Linux VM.

Running flatpak run --command="fc-list" org.gnome.Evince | grep -i arial will not return anything on either settings (Ubuntu, Arch).

gpoo commented 2 years ago

Try:

flatpak run --command=fc-cache org.gnome.Evince -f -v

and then open the document again.

thalesmaoa commented 2 years ago

I confirm that it does solve the problem.

gpoo commented 2 years ago

This is a known issue in flatpak: https://github.com/flatpak/flatpak/issues/3191

christianrauch commented 2 years ago

I can also confirm that running fc-cache inside the flatpak fixes the issues that I saw with my form and the example PDF with the graph.

However, you have to run this every time the flatpak is installed in a new setup or after cleaning left-over files as the font cache will not persists.

before:

β”œβ”€β”€ cache
β”‚Β Β  β”œβ”€β”€ fontconfig
β”‚Β Β  └── tmp
β”œβ”€β”€ config
β”‚Β Β  β”œβ”€β”€ glib-2.0
β”‚Β Β  β”‚Β Β  └── settings
β”‚Β Β  β”œβ”€β”€ ibus
β”‚Β Β  β”‚Β Β  └── bus
β”‚Β Β  └── user-dirs.dirs
└── data
    └── recently-used.xbel

9 directories, 2 files

after flatpak run --command=fc-cache org.gnome.Evince -f -v:

$ tree $HOME/.var/app/org.gnome.Evince/
β”œβ”€β”€ cache
β”‚Β Β  β”œβ”€β”€ fontconfig
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ 02c3d2a553cc0a59ef9c1e729da08704-le64.cache-7
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ 0ddbdbd750e3249d438f72b69cb90ce5-le64.cache-7
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ [...]-le64.cache-7
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ CACHEDIR.TAG
β”‚Β Β  β”‚Β Β  └── [...]-le64.cache-7
β”‚Β Β  └── tmp
β”œβ”€β”€ config
β”‚Β Β  β”œβ”€β”€ glib-2.0
β”‚Β Β  β”‚Β Β  └── settings
β”‚Β Β  β”œβ”€β”€ ibus
β”‚Β Β  β”‚Β Β  └── bus
β”‚Β Β  └── user-dirs.dirs
└── data
    └── recently-used.xbel

9 directories, 104 files