Posts: 1,308
BitJam
Joined: 31 Aug 2009
#1
I had installed some fonts and they weren't showing up in xlsfonts so I decided to fix the FontPath in xorg.conf. I wrote this little script to automatically generate the correct section for xorg.conf:

Code: Select all

#!/usr/bin/perl
use strict;
use warnings;

my $ME = $0; $ME =~ s{.*/}{};      # name of this program

open FONTDIRS, qq(find /usr/share/fonts -name"fonts.dir" |) or
    die"$ME: Couldn't open find pipe.  $!\n";

print"#-- Files section generated by $ME\n";
print qq(Section"Files"\n);
while (<FONTDIRS>) {
    s/\/fonts.dir$/"/;
    s/^/    FontPath"/;
    print;
}
print qq(endSection\n);
You can then either >> the output to /etc/X11/xorg.conf or manually add it to xorg.conf if you already have a Files section that needs to be replaced.

If there is some other/better way to make sure fonts show up, PLMK.