How to know which fonts are installed on CentOS?
Solution 1
As for question one, fc-list
gives you all fonts.
${HOME}/.fonts
will contain additional fonts for your user.
fc-list | grep "Courier New"
allows you to check if that particular font is installed.
Solution 2
Besides
# fc-list
You can find all true type fonts in your disk with find: (caution: it can take long time to process)
# find / -type f -name "*.ttf"
Solution 3
you can also try with python. For example using matplotlib:
python -c 'import matplotlib.font_manager; print "\n".join(matplotlib.font_manager.findSystemFonts(fontpaths=None, fontext="ttf"))'
on my linux it gives me output like:
/usr/share/fonts/truetype/kacst/KacstTitle.ttf
/usr/share/fonts/truetype/tlwg/TlwgTypo-Oblique.ttf
/usr/share/fonts/truetype/ttf-indic-fonts-core/Malige-b.ttf
/usr/share/fonts/truetype/msttcorefonts/verdanab.ttf
/usr/share/fonts/truetype/tlwg/Umpush.ttf
/usr/share/fonts/truetype/horai-umefont/ume-tgo5.ttf
/usr/share/fonts/truetype/tlwg/Garuda-Bold.ttf
...
UPDATE: Ofcourse you need python-matplotlib package for that. Try with yum, if not found , you can install it via pip or easy install, so:
sudo yum install python-matplotlib
or
pip install matplotlib
or
easy_install matplotlib
Solution 4
There is a command xlsfonts
to list all fonts available in X.
Related videos on Youtube
Prakash K
Updated on September 18, 2022Comments
-
Prakash K almost 2 years
Question-1: Is there a way to know what all fonts are installed on the
CentOS 6.2
through command-line?I have checked the fonts with the following command
ls /usr/share/fonts/default/ghostscript/
and have got the following results:bchb.afm bchri.afm fcyri.afm fkarw.pfm hrgero.gsf hrgrro.gsf hrpldb.gsf hrplrbo.gsf hrpls.gsf hrplt.pfa hrscso.gsf putri.pfa u004006t.afm bchbi.afm bchri.pfa fcyri.gsf fonts.dir hrger.pfa hrgrr.pfa hrpldbi.gsf hrplr.gsf hrplso.gsf hrsccb.gsf hrscs.pfa putr.pfa u004006t.gsf bchbi.pfa bchr.pfa fhirw.gsf fonts.scale hrgkc.gsf hritrb.gsf hrpldi.pfa hrplro.gsf hrpltb.gsf hrscco.gsf hrsyr.gsf u003043t.afm u004006t.pfm bchb.pfa fcyr.afm fhirw.pfm hrgerb.gsf hrgks.gsf hritro.gsf hrpld.pfa hrplsb.gsf hrpltbi.gsf hrscc.pfa putbi.pfa u003043t.gsf bchr.afm fcyr.gsf fkarw.gsf hrgerd.gsf hrgrrb.gsf hritr.pfa hrplrb.gsf hrplsbo.gsf hrplti.pfa hrscsb.gsf putb.pfa u003043t.pfm
and similar results I have got from running
ls /usr/share/fonts/default/Type1
but I am not able to make out what kind font files are these (I know about .ttf, .otn and .fnt) and what all fonts does it contain like "courier new", "times new roman" etc.Also there are other directories which have fonts:
ls /usr/share/fonts/opensymbol/
hasopens___.ttf
ls /usr/share/fonts/dejavu/
hasDejaVuSans-BoldOblique.ttf DejaVuSansCondensed.ttf DejaVuSansMono.ttf DejaVuSerifCondensed-BoldItalic.ttf DejaVuSerif.ttf DejaVuSans-Bold.ttf DejaVuSans-ExtraLight.ttf DejaVuSans-Oblique.ttf DejaVuSerifCondensed-Bold.ttf DejaVuSansCondensed-BoldOblique.ttf DejaVuSansMono-BoldOblique.ttf DejaVuSans.ttf DejaVuSerifCondensed-Italic.ttf DejaVuSansCondensed-Bold.ttf DejaVuSansMono-Bold.ttf DejaVuSerif-BoldItalic.ttf DejaVuSerifCondensed.ttf DejaVuSansCondensed-Oblique.ttf DejaVuSansMono-Oblique.ttf DejaVuSerif-Bold.ttf DejaVuSerif-Italic.ttf
Question-2:: Are there other directories for fonts and are these fonts installed on my system?
Question-3: Also is there a way to check if a particular font is installed on the system, for eg: I want to see whether
Courier New
is installed on my system or not.Any help would be appreciated.
Thanks -
Prakash K almost 11 yearsdoesn't work:
-bash: xlsfonts: command not found
-
Prakash K almost 11 yearssorry to sound naive but what path would be
{HOME}
? -
rwxrwxrwx almost 11 years${HOME} is your home directory, you can check it using: echo ${HOME} in terminal. It might be such path like: /home/username
-
Michał Šrajer almost 11 years@PrakashK: you may need to install x11-utils package
-
Michał Šrajer almost 11 years@PrakashK: see update