LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-24-2020, 12:32 AM   #1
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Slackware,Linux From Scratch
Posts: 482
Blog Entries: 82

Rep: Reputation: 104Reputation: 104
Some installed fonts do not appear


Some fonts installed in my system are visible by programs (gimp as our specific example) and some are not. I've had this problem in every distro (including Debian, Gentoo, Slackware, LFS) for over ten years. It seems to me an easy and obvious newb question, which is why I'm posting this here, but I've never solved it in all of this time.

My googling, now, as over ten years ago, simply says to use fc-cache. Well, if one uses a program in every permutation without results for ten years, one eventually realizes that the program, fc-cache in this case, is utterly useless.

Let's get specific: a run of fc-cache as root:
Code:
root@moonshadow:~ # fc-cache -f -v
/usr/share/fonts/OTF: caching, new cache contents: 58 fonts, 0 dirs
/usr/share/fonts/TTF: caching, new cache contents: 169 fonts, 0 dirs
/usr/share/fonts/Type1: caching, new cache contents: 64 fonts, 0 dirs
/usr/share/fonts/Speedo: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/cyrillic: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/misc: caching, new cache contents: 125 fonts, 0 dirs
/root/.local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
But then to reveal the problem, a run of ls on the fonts directory...
Code:
root@moonshadow:~ # ls /usr/share/fonts
100dpi/  OTF/     TTF/    cantarell/  encodings/          misc/  util/
75dpi/   Speedo/  Type1/  cyrillic/   kanjistrokeorders/  plex/
root@moonshadow:~ #
Note the directories that fc-cache did not see, including plex and cantarell. What's with that?

I can run fc-cache in the plex directory and it will appear to run without error ... and still the fonts are not visible in gimp.

So now, finally, my newbie-level question... how the hell do I get all the fonts to be recognized?

Last edited by jr_bob_dobbs; 04-24-2020 at 12:33 AM.
 
Old 04-24-2020, 01:06 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 1,460

Rep: Reputation: Disabled
The directories that fc-cache scans for fonts are defined in font configuration files. E.g.
Code:
$ xmlstarlet pyx /etc/fonts/fonts.conf|sed -n 's/^)dir$/&\n-\\n/;/^(dir$/,/^)dir/p'|xmlstarlet depyx
<dir>/usr/share/fonts</dir>
<dir>/usr/share/X11/fonts/Type1</dir>
<dir>/usr/share/X11/fonts/TTF</dir>
<dir>/usr/local/share/fonts</dir>
<dir prefix="xdg">fonts</dir>
<dir>~/.fonts</dir>
____
See xmlstarlet(1)

Last edited by shruggy; 04-24-2020 at 01:28 PM.
 
1 members found this post helpful.
Old 05-03-2020, 12:25 PM   #3
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Slackware,Linux From Scratch
Posts: 482

Original Poster
Blog Entries: 82

Rep: Reputation: 104Reputation: 104
While I don't have a xmlstarlet program, your post did lead me to which files & man pages to read so that I was able to create a small & simple configuration file in the proper directory so that the fonts were finally recognized, thank you.
 
Old 05-06-2020, 02:27 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 16,643
Blog Entries: 10

Rep: Reputation: 4919Reputation: 4919Reputation: 4919Reputation: 4919Reputation: 4919Reputation: 4919Reputation: 4919Reputation: 4919Reputation: 4919Reputation: 4919Reputation: 4919
Quote:
Originally Posted by jr_bob_dobbs View Post
While I don't have a xmlstarlet program, your post did lead me to which files & man pages to read so that I was able to create a small & simple configuration file in the proper directory so that the fonts were finally recognized, thank you.
Please share your solution.
Others will benefit.
Thank you.
 
Old 05-24-2020, 08:04 PM   #5
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Slackware,Linux From Scratch
Posts: 482

Original Poster
Blog Entries: 82

Rep: Reputation: 104Reputation: 104
Quote:
Originally Posted by ondoho View Post
Please share your solution.
Others will benefit.
Thank you.
All right.

Warning, for all I know, the directories and file names could be different per distro. I did this on Slackware.

Make a xml file called 08_xxy_more_font_dirs.conf (or whatever name you feel like using, the two leading numeric digits and the .conf I beleive are the only things that need to be adhered to) and put it in the /etc/fonts/conf.avail directory.

I wanted to add two fonts: Cantarell and Plex, which had already been installed. Contents of this file, six lines to follow:
Code:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
   <dir>/usr/share/fonts/cantarell</dir>
   <dir>/usr/share/fonts/plex</dir>
</fontconfig>
Then, in the /etc/fonts/conf.d directory, make a sym-link to that just-made file:
Code:
cd /etc/fonts/conf.d
ln -s ../conf.avail/08_xxy_more_font_dirs.conf
The syntax of ln can get very weird. In the above, I only specify where the symlink should link, not the actual name of the sym link. ln takes the name from the link and makes the actual sym link file in the current directory, which is why I cd'd there before running the ln command.

Run "fc-cache -f -v" and the output *should* show that the new
directories are being recognized and indexed.

Again, per-distro this may vary.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/.fonts from /etc/fonts/fonts.conf barunparichha Linux - Software 3 11-27-2009 09:16 AM
Fonts, fonts and more fonts raysr SUSE / openSUSE 2 02-09-2009 09:43 PM
upgraded to SUSE 9.1 -> some fonts (e.g. accented) do not appear right yurodivye Linux - Newbie 3 01-10-2005 01:00 AM
Some fonts print, some fonts don't! cneal Linux - Software 4 09-14-2004 06:43 AM
Fonts, fonts and more fonts ... terran4000 Linux - Software 1 03-19-2004 04:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration