libreoffice: Fonts don't show up after install

  • Done
  • quality assurance status badge
Details
7 participants
  • Nicolò Balzarotti
  • Felix Lechner
  • hmk
  • John Soo
  • Ludovic Courtès
  • Pierre Neidhardt
  • Maxim Cournoyer
Owner
unassigned
Submitted by
hmk
Severity
normal
H
(address . submit@debbugs.gnu.org)
bad1fc034ed4a0a4dbf14f74d431b7ae@posteo.de
Package: guix

After installing and running libreoffice with
$ guix package -i libreoffice@5.3.7.2
$ soffice
no fonts show up (see attached screenshot).

Following the instructions provided by
I did
$ guix package -i fontconfig font-gnu-freefont-ttf
$ fc-cache -f
and this solves the issue.

Is this a missing dependency? Even though instructions to fix this
problem are given, from an end-user's perspective it would be nicer
perhaps to
have it automated?

(It's the first time I am posting to debbugs.gnu.org -- apologies if
something is not done in the proper way or form.)
Attachment: soffice-no-fonts.png (.05 MiB)
P
P
Pierre Neidhardt wrote on 2 Apr 2020 11:09
(name . hmk)(address . hmk42@posteo.de)
87a73ui78x.fsf@ambrevar.xyz
I can reproduce this on guix ce226e9d8d52d2530f057f2000d36c0d55380ade.

But libreoffice is not the only victim: it seems that most applications
fail to see the fonts installed in the user profile (on Guix System).
Emacs is one example.

Running

Toggle snippet (3 lines)
fc-cache -fv

fixes the issue.

Should we run this command in a profile hook?

--
Pierre Neidhardt
N
N
Nicolò Balzarotti wrote on 2 Apr 2020 11:19
878sje453l.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me
Pierre Neidhardt <mail@ambrevar.xyz> writes:

Hi, I wanted to add that the opposite is also true: removing a font
without running fc-cache always makes my emacs die on start, so I agree
that running the command automatically makes sense.

Are there any unwanted side-effects?

Thanks, Nicolò

Toggle quote (19 lines)
> I can reproduce this on guix ce226e9d8d52d2530f057f2000d36c0d55380ade.
>
> But libreoffice is not the only victim: it seems that most applications
> fail to see the fonts installed in the user profile (on Guix System).
> Emacs is one example.
>
> Running
>
> --8<---------------cut here---------------start------------->8---
> fc-cache -fv
> --8<---------------cut here---------------end--------------->8---
>
> fixes the issue.
>
> Should we run this command in a profile hook?
>
> --
> Pierre Neidhardt
> https://ambrevar.xyz/
J
J
John Soo wrote on 2 Apr 2020 11:37
(name . Nicolò Balzarotti)(address . anothersms@gmail.com)
01603B20-79F4-4CE2-898A-8C7BECCA465C@asu.edu
Hi there,

I think this is the same issue as 26877.

Can font information be compiled into a fonts.conf?

- John
L
L
Ludovic Courtès wrote on 2 Apr 2020 17:46
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
875zehopqf.fsf@gnu.org
Hi,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

Toggle quote (8 lines)
> Running
>
> fc-cache -fv
>
> fixes the issue.
>
> Should we run this command in a profile hook?

Profile hooks are normal derivations; as such, they don’t have access to
anything but their dependencies and their output(s).

There’s currently no infrastructure to run arbitrary code upon package
installation (which I think is a feature more than a bug :-)). We could
make an exception, but it’s kinda ugly.

I wonder if, instead, we could have Fontconfig realize that the cache is
stale somehow.

Alternately, we could generate the cache in a profile hook and have
Fontconfig use that cache instead of the one in ~/.cache. However,
Fontconfig would need to be able to:

1. Be told which cache to use, not just the one from ~/.guix-profile,
so that it works equally well with other profiles.

2. Merge several caches, so it can also account for fonts installed in
/run/current-system/profile.

We discussed all this several times in the past but I don’t think it
went further.

Ludo’.
L
L
Ludovic Courtès wrote on 2 Apr 2020 17:47
(name . Nicolò Balzarotti)(address . anothersms@gmail.com)
871rp5opoo.fsf@gnu.org
Hi Nicolò,

Nicolò Balzarotti <anothersms@gmail.com> skribis:

Toggle quote (4 lines)
> Hi, I wanted to add that the opposite is also true: removing a font
> without running fc-cache always makes my emacs die on start, so I agree
> that running the command automatically makes sense.

Actually, if you can capture a stack trace of Emacs, that may tell us
what part of Fontconfig to look at if we want to change it to gracefully
handle stale cache entries.

Ludo’.
P
P
Pierre Neidhardt wrote on 2 Apr 2020 17:59
(name . Ludovic Courtès)(address . ludo@gnu.org)
877dyxvpy9.fsf@ambrevar.xyz
OK, thanks for the details.

So the solution is the same as the one we discussed
previously about installing fonts to the non-default profile.
Makes sense.

I might give it a shot when I find the time ;)

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl6GC94ACgkQm9z0l6S7
zH80Ngf/THwCGZv90JclegiQQg85XugZlc1c2+itgYvRz9Bbg/jn4KrEmvd+xYh+
9HNskQTdaxEQVfY0gqsRyCFfo2k+hednN08BuVrdRD5uGyPGMn6Gs0gQv1k5jxtR
S6/0e7AxNgOB3GzfTDb1XM2V0zli+l9h8CSvERfg0zwThgd+4fAG4zzu+d8rMNPQ
9l8g8wc2LKMYZR/100Xg4W0pqRXTlwlY7SLRGUKFJ6kSfWWnAFJaCTr+nOBNzpqg
yGX/oXQWmTw3UMpsBEabXyudo4luZccO6aek449L+YAoCcxGbgOsd29exUgc1DT+
+zKA2f0owBc6dzrPFbTmJ73cSZ6rbA==
=pCyO
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 20 Feb 2023 17:05
(name . Ludovic Courtès)(address . ludo@gnu.org)
87pma4l3ug.fsf@gmail.com
Hi Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (29 lines)
> Hi,
>
> Pierre Neidhardt <mail@ambrevar.xyz> skribis:
>
>> Running
>>
>> fc-cache -fv
>>
>> fixes the issue.
>>
>> Should we run this command in a profile hook?
>
> Profile hooks are normal derivations; as such, they don’t have access to
> anything but their dependencies and their output(s).
>
> There’s currently no infrastructure to run arbitrary code upon package
> installation (which I think is a feature more than a bug :-)). We could
> make an exception, but it’s kinda ugly.
>
> I wonder if, instead, we could have Fontconfig realize that the cache is
> stale somehow.
>
> Alternately, we could generate the cache in a profile hook and have
> Fontconfig use that cache instead of the one in ~/.cache. However,
> Fontconfig would need to be able to:
>
> 1. Be told which cache to use, not just the one from ~/.guix-profile,
> so that it works equally well with other profiles.

That's possible since adding support to XDG_DATA_DIRS in fontconfig
itself (see c738a054cac00441a4f697f0b40705d0b3f4a7a7, "gnu: fontconfig:
Add a search path for XDG_DATA_DIRS.").

Toggle quote (3 lines)
> 2. Merge several caches, so it can also account for fonts installed in
> /run/current-system/profile.

There was also something contributed that should have improved/fix cache
invalidity in 6f12880a76a6c91058718d15845f8b9d9b529a5a ("gnu:
fontconfig: Use (locally) deterministic caching").

I haven't seen this problem in a long while, so I'm inclined to think
it's been resolved.

--
Thanks,
Maxim
F
F
Felix Lechner wrote on 20 Feb 2023 18:32
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
CAFHYt56MJn=rXZTqvnjNb4dQGBXx55GoZM6i+zd+SswiSUP+pQ@mail.gmail.com
Hi,

On Mon, Feb 20, 2023 at 8:06 AM Maxim Cournoyer
<maxim.cournoyer@gmail.com> wrote:
Toggle quote (4 lines)
>
> I haven't seen this problem in a long while, so I'm inclined to think
> it's been resolved.

I think I had that issue with a fresh install within the last year and
based on advice in IRC (thanks nckx!) ran 'fc-cache -fv'.

For what it's worth, I believe Debian's packaging tools (in this case,
Debhelper) detect changes to the font directories and add a font
update hook to the package installation scripts. Since we do not have
such scripts—and I am with Ludo' that it's probably a feature worth
preserving—maybe our package manager could run the hook?

Kind regards
Felix Lechner
M
M
Maxim Cournoyer wrote on 20 Feb 2023 19:22
(name . Felix Lechner)(address . felix.lechner@lease-up.com)
874jrgkxhx.fsf@gmail.com
Hi Felix,

Felix Lechner <felix.lechner@lease-up.com> writes:

Toggle quote (11 lines)
> Hi,
>
> On Mon, Feb 20, 2023 at 8:06 AM Maxim Cournoyer
> <maxim.cournoyer@gmail.com> wrote:
>>
>> I haven't seen this problem in a long while, so I'm inclined to think
>> it's been resolved.
>
> I think I had that issue with a fresh install within the last year and
> based on advice in IRC (thanks nckx!) ran 'fc-cache -fv'.

OK, thanks for the information; let's leave this bug open then.

Toggle quote (6 lines)
> For what it's worth, I believe Debian's packaging tools (in this case,
> Debhelper) detect changes to the font directories and add a font
> update hook to the package installation scripts. Since we do not have
> such scripts—and I am with Ludo' that it's probably a feature worth
> preserving—maybe our package manager could run the hook?

Another idea: modify fontconfig so that it never creates or uses cache.
Revisit later if it causes performance problems (I doubt it would).

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 29 Aug 2023 05:28
(name . Felix Lechner)(address . felix.lechner@lease-up.com)
87edjmedc4.fsf@gmail.com
Hello,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (15 lines)
> Hi Felix,
>
> Felix Lechner <felix.lechner@lease-up.com> writes:
>
>> Hi,
>>
>> On Mon, Feb 20, 2023 at 8:06 AM Maxim Cournoyer
>> <maxim.cournoyer@gmail.com> wrote:
>>>
>>> I haven't seen this problem in a long while, so I'm inclined to think
>>> it's been resolved.
>>
>> I think I had that issue with a fresh install within the last year and
>> based on advice in IRC (thanks nckx!) ran 'fc-cache -fv'.

On a second thought, let's close this issue and reopen a new one if it
rears its ugly head again :-).

--
Thanks,
Maxim
Closed
?