[SOLVED] Best way to keep user installed fonts separate from default fonts?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Best way to keep user installed fonts separate from default fonts?
What would be the best way to keep the fonts I install separate from those which come with Slackware? I want to install a whole bunch of fonts for some graphic design testing - but ideally I'd rather not mix them with those already in /usr/share/fonts/TTF (the new ones are TTF fonts) - so that I can easily remove them later. Would creating a separate dir under /usr/share/fonts be acceptable?
I think ~/.local/share/fonts is the standard place for that.
That. Or build a Slackware package.
Code:
mkdir -p /tmp/package-myFonts-1.0/usr/share/fonts/TTF
cp *.ttf /tmp/package-myFonts-1.0/usr/share/fonts/TTF
cd /tmp/package-myFonts-1.0
makepkg -l y -c n /tmp/myFonts-1.0-noarch-1.tgz
Speaking of which is there a easy way to check which fonts are default Slackware installed, because dummy me a year ago copied a few foreign script fonts over to the default TTF dir and now I cant tell which from which out the standard Liberation, Deja Vu font and such
Speaking of which is there a easy way to check which fonts are default Slackware installed, because dummy me a year ago copied a few foreign script fonts over to the default TTF dir and now I cant tell which from which out the standard Liberation, Deja Vu font and such
I've asked myself the same question. I suppose the date of the font files might be a giveaway - if you can remember roughly when you've installed the new fonts.
I was under the impression that Slackware doesn't really tend to use /usr/local. But I could be wrong :-)
It generally isn't used with packages, so scripts from SBo don't use it. But if you need to add something specific to your machine, /usr/local/ is designed just for that.
Speaking of which is there a easy way to check which fonts are default Slackware installed, because dummy me a year ago copied a few foreign script fonts over to the default TTF dir and now I cant tell which from which out the standard Liberation, Deja Vu font and such
Grep /var/log/packages for /usr/share/fonts, and compare that to what's in fc-list?
I was under the impression that Slackware doesn't really tend to use /usr/local. But I could be wrong :-)
Note bassmadrigal's response. Also this -- one of my pet peeves is when upstream packagers and distro maintainers place their system files in my /usr/local/.
Just so you know, FHS 2.2 has been superseded in favor of FHS 3.0.
Quote:
Originally Posted by upnort
one of my pet peeves is when upstream packagers and distro maintainers place their system files in my /usr/local/.
Unfortunately, the language isn't specific enough in the FHS to make it definitive on what should go where. Some believe that only files from the OS should go there and all 3rd-party, whether packaged or self-compiled, should go in /usr/local/, while others believe that any packages should go in /usr/ and any self-compiled should go in /usr/local/.
I fall under the second group... specifically that files that are tracked by the package manager should go in /usr/ and files that won't be tracked (self-compiled, scripts, random system fonts, etc) should go in /usr/local/.
I fall under the second group... specifically that files that are tracked by the package manager should go in /usr/ and files that won't be tracked (self-compiled, scripts, random system fonts, etc) should go in /usr/local/.
This.
For reference, all you need to do is create a file called /etc/fonts/local.conf
And put the following in it:
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->
<fontconfig>
<!-- Font directory list -->
<dir>/usr/local/share/fonts</dir>
</fontconfig>
Copy your font files into /usr/local/share/fonts and run fc-cache. Job done.
I fall under the second group... specifically that files that are tracked by the package manager should go in /usr/ and files that won't be tracked (self-compiled, scripts, random system fonts, etc) should go in /usr/local/.
I even use a third method: big packages (that aren't _slackware_ packages), like Maple, GNU Octave etc go under /opt/<package_name> - with bin, lib and such under there:
/opt/octave:
drwxr-xr-x 2 root root 304 2018-05-25 12:48:48 bin
drwxr-xr-x 3 root root 80 2018-05-25 12:48:46 include
drwxr-xr-x 3 root root 80 2018-05-25 12:48:46 lib
drwxr-xr-x 3 root root 72 2018-05-25 12:48:46 libexec
drwxr-xr-x 6 root root 152 2018-05-25 12:49:00 share
and special startup scripts will add the needed directories to PATH, MANPATH, LD_LIBRARY_PATH etc.
This /opt can get rather big when you've got lots of third-party software:
/dev/sda2 11074 5063 6012 46% /opt
(in MB blocks). As you see I made it into its own partition.
For reference, all you need to do is create a file called /etc/fonts/local.conf
And put the following in it:
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->
<fontconfig>
<!-- Font directory list -->
<dir>/usr/local/share/fonts</dir>
</fontconfig>
Copy your font files into /usr/local/share/fonts and run fc-cache. Job done.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.