Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts don't appear in applications on Ubuntu 24.04 because symlinked font directory doesn't work #74

Open
6 tasks done
tianyizheng02 opened this issue Jan 16, 2025 · 5 comments
Assignees

Comments

@tianyizheng02
Copy link

tianyizheng02 commented Jan 16, 2025

General troubleshooting steps

Description of issue

Similar to #72

Fonts installed with this tap don't appear in applications such as LibreOffice and Xournal++. I performed the necessary steps for fontconfig as stated in the README, but the fonts still can't be found in applications. This happens for symlinking both to /usr/local/share and to ~/.local/share.

However, I can install fonts just fine without Homebrew and symlinking (by placing font files directly into ~/.local/share/fonts). I think the problem is that applications can't find installed fonts if the font directory (/usr/local/share/fonts or ~/.local/share/fonts) is a symlink.

Output of your command with --verbose --debug

Example with font-libertinus:

$ brew install font-libertinus --verbose --debug
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading font-libertinus
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading font-libertinus
==> Fetching homebrew/linux-fonts/font-libertinus
/usr/bin/env /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Linuxbrew/4.4.16\ \(Linux\;\ x86_64\ Ubuntu\ 24.04.1\ LTS\)\ curl/8.5.0 --header Accept-Language:\ en --retry 3 -V
/usr/bin/env /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Linuxbrew/4.4.16\ \(Linux\;\ x86_64\ Ubuntu\ 24.04.1\ LTS\)\ curl/8.5.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://github.com/alerque/libertinus/releases/download/v7.051/Libertinus-7.051.tar.zst
==> Downloading https://github.com/alerque/libertinus/releases/download/v7.051/Libertinus-7.051.tar.zst
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/10892932/2ccf0e31-b582-40ec-9321-8d100e63e3f7?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250116%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250116T214232Z&X-Amz-Expires=300&X-Amz-Signature=49adc5db747e88ad522b250cbec123aaab799b868f908873c5db03a1130f71c0&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3DLibertinus-7.051.tar.zst&response-content-type=application%2Foctet-stream
/usr/bin/env /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Linuxbrew/4.4.16\ \(Linux\;\ x86_64\ Ubuntu\ 24.04.1\ LTS\)\ curl/8.5.0 --header Accept-Language:\ en --fail --retry 3 --remote-time --output /home/[username]/.cache/Homebrew/downloads/4bae8841ac26a9b42de4b724bd04c94c5157b78519bf83bcccc0540554d7a327--Libertinus-7.051.tar.zst.incomplete --location https://objects.githubusercontent.com/github-production-release-asset-2e65be/10892932/2ccf0e31-b582-40ec-9321-8d100e63e3f7\?X-Amz-Algorithm=AWS4-HMAC-SHA256\&X-Amz-Credential=releaseassetproduction\%2F20250116\%2Fus-east-1\%2Fs3\%2Faws4_request\&X-Amz-Date=20250116T214232Z\&X-Amz-Expires=300\&X-Amz-Signature=49adc5db747e88ad522b250cbec123aaab799b868f908873c5db03a1130f71c0\&X-Amz-SignedHeaders=host\&response-content-disposition=attachment\%3B\%20filename\%3DLibertinus-7.051.tar.zst\&response-content-type=application\%2Foctet-stream
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 6642k  100 6642k    0     0  6213k      0  0:00:01  0:00:01 --:--:-- 6219k
==> Verifying checksum for '4bae8841ac26a9b42de4b724bd04c94c5157b78519bf83bcccc0540554d7a327--Libertinus-7.051.tar.zst'
==> Installing font-libertinus from homebrew/linux-fonts
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromTapLoader): loading homebrew/linux-fonts/font-libertinus
/usr/bin/env /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/git --version
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromPathLoader): loading /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-linux-fonts/Formula/font-libertinus.rb
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading gcc@11
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading binutils
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading make
/usr/bin/env /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/git --version
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading gcc
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading gcc@13
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading gcc
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading gcc@13
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/build.rb (Formulary::FromAPILoader): loading zstd
/usr/bin/env PATH=/home/linuxbrew/.linuxbrew/opt/zstd/bin:/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super:/usr/bin:/bin:/usr/sbin:/sbin unzstd -T0 --rm -- /tmp/homebrew-tar20250116-479967-3vhvfj/4bae8841ac26a9b42de4b724bd04c94c5157b78519bf83bcccc0540554d7a327--Libertinus-7.051.tar.zst
/tmp/homebrew-tar20250116-479967-3vhvfj/4bae8841ac26a9b42de4b724bd04c94c5157b78519bf83bcccc0540554d7a327--Libertinus-7.051.tar.zst: 14583808 bytes 
/usr/bin/env tar --extract --no-same-owner --file /tmp/homebrew-tar20250116-479967-3vhvfj/4bae8841ac26a9b42de4b724bd04c94c5157b78519bf83bcccc0540554d7a327--Libertinus-7.051.tar --directory /tmp/homebrew-unpack-20250116-479967-wuo6a7
mv /tmp/homebrew-unpack-20250116-479967-wuo6a7/Libertinus-7.051 /tmp/font-libertinus-20250116-479967-gfrr2o/Libertinus-7.051
==> Cleaning
==> Finishing up
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Cask::CaskLoader::FromAPILoader): loading font-libertinus
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusKeyboard-Regular.otf LibertinusKeyboard-Regular.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusMath-Regular.otf LibertinusMath-Regular.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusMono-Regular.otf LibertinusMono-Regular.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSans-Bold.otf LibertinusSans-Bold.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSans-Italic.otf LibertinusSans-Italic.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSans-Regular.otf LibertinusSans-Regular.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSerif-Bold.otf LibertinusSerif-Bold.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSerif-BoldItalic.otf LibertinusSerif-BoldItalic.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSerif-Italic.otf LibertinusSerif-Italic.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSerif-Regular.otf LibertinusSerif-Regular.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSerif-Semibold.otf LibertinusSerif-Semibold.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSerif-SemiboldItalic.otf LibertinusSerif-SemiboldItalic.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSerifDisplay-Regular.otf LibertinusSerifDisplay-Regular.otf
ln -s ../../Cellar/font-libertinus/7.051/share/fonts/LibertinusSerifInitials-Regular.otf LibertinusSerifInitials-Regular.otf
==> Summary
🍺  /home/linuxbrew/.linuxbrew/Cellar/font-libertinus/7.051: 19 files, 3.7MB, built in 1 second
==> Running `brew cleanup font-libertinus`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromTapLoader): loading homebrew/linux-fonts/font-libertinus
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/libffi
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/zlib
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/unzip
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/mpdecimal
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/ncurses
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/libtirpc
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/sqlite
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/krb5
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/xz
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/[email protected]
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromTapLoader): loading homebrew/linux-fonts/font-jetbrains-mono
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/libnsl
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/openssl@3
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromTapLoader): loading homebrew/linux-fonts/font-iosevka
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromTapLoader): loading homebrew/linux-fonts/font-libertinus
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/expat
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/readline
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/ca-certificates
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/berkeley-db@5
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/bzip2
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/libxcrypt
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/libedit
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading bzip2
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ca-certificates
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading openssl@3
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ncurses
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading libedit
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading krb5
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ncurses
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading readline
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading zlib
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ca-certificates
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading openssl@3
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ncurses
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading libedit
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading mpdecimal
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ca-certificates
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading openssl@3
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ncurses
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading readline
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading zlib
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading sqlite
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading xz
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading berkeley-db@5
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading libedit
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading krb5
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading libtirpc
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading libnsl
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading bzip2
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading expat
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading libffi
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading libxcrypt
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading unzip
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ca-certificates
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading openssl@3
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ncurses
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading libedit
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading krb5
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading libtirpc
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ca-certificates
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ncurses
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading ncurses

Output of brew cask doctor

$ brew doctor
Your system is ready to brew.
@tani
Copy link
Member

tani commented Jan 17, 2025

Thank you for the report. I will inspect the issue. Could you please run the following commands? Note that this pertains to the legacy compatibility directory.

$ ln -s /home/linuxbrew/.linuxbrew/share/fonts -t ~/.fonts
$ fc-cache -fv

@tianyizheng02
Copy link
Author

I didn't already have a ~/.fonts directory, so I created one. This is my (abridged) output for the above commands:

$ mkdir ~/.fonts
$ ln -s /home/linuxbrew/.linuxbrew/share/fonts -t ~/.fonts
$ fc-cache -fv
Font directories:
	/home/tianyi/.local/share/fonts
	/usr/share/ubuntu/fonts
	/usr/share/gnome/fonts
	/usr/local/share/fonts
	/usr/share/fonts
	/var/lib/snapd/desktop/fonts
	/home/tianyi/.fonts
	...
	/home/tianyi/.fonts/fonts
	...
/home/tianyi/.local/share/fonts: caching, new cache contents: 162 fonts, 0 dirs
...
/home/tianyi/.fonts: caching, new cache contents: 0 fonts, 1 dirs
/home/tianyi/.fonts/fonts: caching, new cache contents: 211 fonts, 0 dirs
...
fc-cache: succeeded

fc-cache is able to find the newly added, symlinked directories, but this was already the case when I had symlinked usr/local/share/fonts and ~/.local/share/fonts directories. In any case, applications (I checked LibreOffice Writer and Xournal++) still aren't able to find my symlinked fonts from Homebrew, so the symlinked ~/.fonts directory doesn't work either.

@tani
Copy link
Member

tani commented Jan 17, 2025

Thank you for verifying this. I’ve identified the cause of this issue. On Linux, fonts located under ~/.fonts or ~/.local/share/fonts should indeed be recognized, including those accessed via symlinks. However, this behavior might depend on matching the glob patterns ~/.fonts/*.ttf or ~/.local/share/fonts/*.ttf.

In your case, though, the structure appears to be ~/.fonts/fonts/ or ~/.local/share/fonts/fonts, which seems to be the root of the problem.

Therefore, I suggest deleting ~/.fonts and creating a symlink. Specifically, please try running the following command:

rm -rf ~/.fonts && ln -s /home/linuxbrew/.linuxbrew/share/fonts -t ~/.fonts

Could you give this a try and see if it resolves the issue?

@tianyizheng02
Copy link
Author

Yes, in my previous comment I had ~/.fonts/fonts because ln -s ... -t ~/.fonts would fail if ~/.fonts didn't already exist as the target directory. I can run

ln -s /home/linuxbrew/.linuxbrew/share/fonts -T ~/.fonts

to get a structure of ~/.fonts, but this doesn't change the outcome at all. fc-cache still succeeds:

$ fc-cache -fv
Font directories:
	/home/tianyi/.local/share/fonts
	/usr/share/ubuntu/fonts
	/usr/share/gnome/fonts
	/usr/local/share/fonts
	/usr/share/fonts
	/var/lib/snapd/desktop/fonts
	/home/tianyi/.fonts
	...
/home/tianyi/.local/share/fonts: caching, new cache contents: 162 fonts, 0 dirs
...
/home/tianyi/.fonts: caching, new cache contents: 211 fonts, 0 dirs
...
fc-cache: succeeded

but I still don't see my Homebrew-installed fonts in my applications. I've always had ~/.local/share/fonts as the file structure, never ~/.local/share/fonts/fonts, and even still I'm experiencing the same issue, so the file structure shouldn't be the problem.

@tani
Copy link
Member

tani commented Jan 17, 2025

Thank you very much. So it was -T, was it? I’ll correct that right away. Thank you again. Now, I understand that the issue still persists despite the fix. That’s indeed quite strange. Since fc-cache is functioning, it seems fontconfig (the common font management system used on Linux) is recognizing the fonts. However, I wonder if LibreOffice manages fonts independently of fontconfig? I will investigate to see if I can reproduce the issue on my side. Please give me some time over the weekend to work on this. Thank you for your patience.

@tani tani self-assigned this Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants