Wherever you place font files, in
${HOME}/.fonts,
/usr/local/share/fonts or
/usr/share/fonts, you will need to "tell" the system where to find them (the font files you've added).
The system fonts are located in
/usr/share/fonts
Code:
ls /usr/share/fonts
100dpi/ OTF/ TTF/ cyrillic/ kanjistrokeorders/ util/k
75dpi/ Speedo/ Type1/ encodings/ misc/
The
/usr/share/fonts/TTF directory contains all the TrueType fonts; e.g.,
Code:
ls /usr/share/fonts/TTF/Malig*
/usr/share/fonts/TTF/Malige-b.ttf /usr/share/fonts/TTF/Malige-n.ttf
/usr/share/fonts/TTF/Malige-i.ttf /usr/share/fonts/TTF/Malige-t.ttf
are a few of them.
It's not a good idea to add any additional fonts to the system directories, that sort of thing can come back to haunt you, so it's better to install "local" font files in
/usr/local/share/fonts (or in your
${HOME} but then they won't be available system-wide, only for you). Better system-wide than personal.
So, let's say you've acquired one or more TTF files from somewhere and you'd like to use them on your Slackware system:
- su -
- mkdir -p /usr/local/share/fonts/TTF
- cd /usr/local/share/fonts/TTF
- cp <path to font files>/*.[Tt][Tt][Ff] .
- chown root.root *
- chmod 644 *
- mkfontscale
- mkfontdir
That copies all the TTF files, makes root the owner and group, makes them readable and creates the
fonts.scale and
fonts.dir files in the directory for you. As @gnashley mentions, TTF fonts are scaleable, thus you need to run
mkfontscale and
mkfontdir.
OK, so now you need to tell the system how to find those fonts (still as su), save the following in a file named
/etc/fonts/local.conf
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/TTF</dir>
</fontconfig>
Almost done -- the last step is to execute
fc-cache:
Code:
/usr/bin/fc-cache -f
(you probably won't need to type /usr/bin though).
Don't forget to exit from
su.
Once you've done this, it's dirt simple to add more fonts -- if you acquire some additional TTF fonts, simply add them to
/usr/local/share/fonts/TTF, run
mkfontscale,
mkfontdir, and
fc-cache -f and you're good to go. If you happen to acquire some Type 1 fonts, just create the directory
/usr/local/share/fonts/Type1, copy the font files into it, run
mkfontscale and
mkfontdir (in that order, by the way), add a line to
/etc/fonts/local.conf and run
fc-cache -f and you're done.
The local fonts you add will be available to everything, system-wide;
LibreOffice,
OpenOffice, whatever.
Hope this helps some.