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.
Can anyone point me in the right direction for installing fonts (specifically truetype fonts) ? I've come across a few threads that mentioned taking a look at /etc/xorg.conf but the file doesn't seem to exist (a user mentioned it's not needed anymore or something..).
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
It's generally a good idea to not mix add-on fonts with the distribution fonts -- you might overwrite something you don't want overwritten (files with the same name and the like).
You need to do the following as root.
I keep add-on fonts in /usr/local/share/fonts in directories named Adobe (the Adobe Type Library is in there), MSfonts (TTFs copies from Winders, naughty, I know) and myfonts (fonts I've picked up over the years that don't fit anywhere else).
For your TrueType font files you should
Code:
cd /usr/local/share/fonts/dirname (the directory name you put them in)
mkfontscale (see the man page)
mkfontdir (see the man page)
Not mandatory but recommended.
Then, in /etc/fonts I create a local.conf file that contains
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->
<fontconfig>
<dir>/usr/local/share/fonts/Adobe</dir>
<dir>/usr/local/share/fonts/MSfonts</dir>
<dir>/usr/local/share/fonts/myfonts</dir>
</fontconfig>
and that takes care of that -- they're available system-wide to all applications.
It's generally a good idea to not mix add-on fonts with the distribution fonts -- you might overwrite something you don't want overwritten (files with the same name and the like).
You need to do the following as root.
I keep add-on fonts in /usr/local/share/fonts in directories named Adobe (the Adobe Type Library is in there), MSfonts (TTFs copies from Winders, naughty, I know) and myfonts (fonts I've picked up over the years that don't fit anywhere else).
For your TrueType font files you should
Code:
cd /usr/local/share/fonts/dirname (the directory name you put them in)
mkfontscale (see the man page)
mkfontdir (see the man page)
Not mandatory but recommended.
Then, in /etc/fonts I create a local.conf file that contains
Code:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/local.conf file to configure system font access -->
<fontconfig>
<dir>/usr/local/share/fonts/Adobe</dir>
<dir>/usr/local/share/fonts/MSfonts</dir>
<dir>/usr/local/share/fonts/myfonts</dir>
</fontconfig>
and that takes care of that -- they're available system-wide to all applications.
Hope this helps some.
Thanks, that was very helpful.
Though, I do understand why there are so many font folders. Wouldn't it be easier to just have a single folder and then divide those into sub-folders that were application specific fonts? What's the difference between putting them in /usr/local/share/fonts/ and /usr/share/fonts if they both end up being available system-wide? One more question, how does the system know to read "local.conf" (I don't seem to have one by default)?
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Quote:
Though, I do understand why there are so many font folders. Wouldn't it be easier to just have a single folder and then divide those into sub-folders that were application specific fonts? What's the difference between putting them in /usr/local/share/fonts/ and /usr/share/fonts if they both end up being available system-wide? One more question, how does the system know to read "local.conf" (I don't seem to have one by default)?
Generally, you want to have "like" font files in a "same" directory. Not for any real "technical" reasons but simply to keep things neat and orderly. There are a number of font directories in your installation
as above, each containing unique types of font files.
If you put your "local" font files in with the distribution fonts, that's perfectly all right but it turns out the be a little more neat and orderly to put "local" stuff in "local" directories if for no other reason than you'll know where they are.
The system reads whatever ".conf" files it finds in /etc/fonts. No magic involved; if you add one or more local .conf files in /etc/fonts, they'll be read (but there's no need to use multiples, one local configuration file is sufficient). In your case, the file /etc/fonts/local.conf would only contain one entry for the TrueType fonts.
Generally, you want to have "like" font files in a "same" directory. Not for any real "technical" reasons but simply to keep things neat and orderly. There are a number of font directories in your installation
as above, each containing unique types of font files.
If you put your "local" font files in with the distribution fonts, that's perfectly all right but it turns out the be a little more neat and orderly to put "local" stuff in "local" directories if for no other reason than you'll know where they are.
The system reads whatever ".conf" files it finds in /etc/fonts. No magic involved; if you add one or more local .conf files in /etc/fonts, they'll be read (but there's no need to use multiples, one local configuration file is sufficient). In your case, the file /etc/fonts/local.conf would only contain one entry for the TrueType fonts.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.