Global wine/fonts location

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
alkisg
Level 1
Level 1
Posts: 7
Joined: Mon Sep 19, 2022 11:41 pm

Global wine/fonts location

Post by alkisg »

Hi, in the previous Wine versions I was able to put fonts in /usr/share/wine/fonts/*.ttf, and these fonts would be seen by Wine applications but not by Linux applications, as expected.
Starting from Ubuntu 22.04 and Wine 6, this location doesn't seem to be used anymore.
An `strace -fe trace=file wine program.exe 2>&1 | grep ttf` command shows that currently, fonts are only read from /usr/share/fonts and $HOME.

Is there a global fonts location now, where we can put fonts for Wine applications, that should not be seen by the whole OS?
Thank you.
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Global wine/fonts location

Post by jkfloris »

You can put the fonts in the ~/.wine/drive_c/windows/Fonts/ directory.
alkisg
Level 1
Level 1
Posts: 7
Joined: Mon Sep 19, 2022 11:41 pm

Re: Global wine/fonts location

Post by alkisg »

Hi jkfloris, thank you for your input, but unfortunately ~/.wine is per user, it's not global.
E.g. a portable-app.deb package wouldn't be able to add fonts there for all users.
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Global wine/fonts location

Post by jkfloris »

If I install a font in the /opt/wine-<branch>/share/wine/fonts folder, the programs running under Wine do recognize it. Maybe this a bug in Ubuntu's Wine package?
alkisg
Level 1
Level 1
Posts: 7
Joined: Mon Sep 19, 2022 11:41 pm

Re: Global wine/fonts location

Post by alkisg »

Thank you, I will test with other distributions and report back.
alkisg
Level 1
Level 1
Posts: 7
Joined: Mon Sep 19, 2022 11:41 pm

Re: Global wine/fonts location

Post by alkisg »

I'll be recording my test progress in this post:
  • Following https://wiki.winehq.org/Ubuntu, /opt/wine-staging/share/wine/fonts is indeed searched. Note that wine-stable doesn't yet exist for Ubuntu 22.04.
  • TODO: test with upstream wine in /usr/bin, not in /opt, as it might involve a different code path.
  • TODO: test with wine packages from other distributions.
Useful test line:
WINEDEBUG=+file sebran 2>&1 | grep -v home | grep -v 'Z:\\\\usr\\\\share\\\\fonts' | grep -v /usr/share/fonts | grep -v 'C:\\\\windows\\\\fonts' | grep -i fonts
alkisg
Level 1
Level 1
Posts: 7
Joined: Mon Sep 19, 2022 11:41 pm

Re: Global wine/fonts location

Post by alkisg »

I tested on Fedora 36 and wine 7.12, the problem didn't happen there.
I will test on Ubuntu 22.10 and wine 7, if it happens there too I'll report it there as distribution specific.

Thanks!
wuwbobo2023
Newbie
Newbie
Posts: 3
Joined: Thu Jan 19, 2023 10:54 am

Re: Global wine/fonts location

Post by wuwbobo2023 »

On my Ubuntu 22.04 with Wine 7.0.1/8.0.0.0 installed (without remaining configuration files from previous versions), the path /usr/share/wine does not exist. All global files are in /opt/wine-stable.
Locked