Location of truetype fonts

I would like to create a small script that installs a few truetype fonts on the user's system. On my Ubuntu machine the truetype fonts are located at /usr/share/fonts/truetype. However, I'm not sure if this location is the same on all machines. Is there a way to find out where truetypes fonts are stored on any Linux system?

Update
After some research I found that the path usr/share/fonts/truetype is specified in the XML file /etc/fonts/fonts.conf. It's an XML file, so I can use XPath to get the dir:

xpath -q -e 'fontconfig/dir[1]/text()[1]' /etc/fonts/fonts.conf

I don't know however if this file will exist on all (or most) Linux systems.


Every font that is located under any subdirectory of /usr/share/fonts and ~/.fonts is scanned and added to the collection you're able to use. So as long as your font is inside one of those two directories it is correclty located, that location is the same for almost every major linux distro.

Update:

By the way I can confirm that fonts.conf file is present on both Fedora and Ubuntu (and their derivates: Xubuntu, Lubuntu, Linux Mint, Cinnammon, Peppermint OS, Fedora and all its spins, to mention some).


In Fedora the folder path is /home/{user}/.local/share/fonts

you can copy/paste font files here.