I'd like to have a list of all the monospace fonts that fontconfig knows of,
which command do I have to use?
Asked
Active
Viewed 1.3k times
32
1 Answers
33
The command fc-list can list all available fonts according to their properties. In your case one needs to search for the spacing corresponding to mono, that would be 100, so fc-list :spacing=100. Simpler form fc-list :mono should probably work too.
Example:
$ fc-list :spacing=100
/usr/share/fonts/urw-fonts/n022003l.pfb: Nimbus Mono L:style=Regular
/usr/share/texmf-dist/fonts/opentype/public/semaphor/smftt10.otf: Semafor:style=Mono
/usr/share/fonts/TTF/luximbi.ttf: Luxi Mono:style=Bold Oblique
/usr/share/texmf-dist/fonts/type1/public/droid/DroidSansMono.pfb: Droid Sans Mono:style=Regular
/usr/share/texmf-dist/fonts/type1/public/bera/fvmbo8a.pfb: Bera Sans Mono:style=Bold Oblique
/usr/share/fonts/dejavu/DejaVuSansMono-BoldOblique.ttf: DejaVu Sans Mono:style=Bold Oblique
/usr/share/texmf-dist/fonts/type1/public/bera/fvmr8a.pfb: Bera Sans Mono:style=Regular
/usr/share/texmf-dist/fonts/opentype/public/semaphor/smfptt10.otf: Semafor:style=PersonPillar-Mono
/usr/share/texmf-dist/fonts/type1/urw/courier/ucrr8a.pfb: Nimbus Mono L:style=Regular
A good documentation of fontconfig library (including font properties and their values selected in the fc-list) is available in the file /usr/share/doc/fontconfig-2.12.1/fontconfig-user.html (change version number to yours).
jimmij
- 46,064
- 19
- 123
- 136
-
2I knew `fc-list` but "_… the spacing corresponding to mono, that would be 100 …_" was waay above my fontconfigosciousness. Thanks – gboffi May 06 '17 at 14:24
-
1@gboffi You may take a look at `/usr/share/doc/fontconfig-2.12.1/fontconfig-user.html` (change version number to yours) - there is detailed description of different font properties and their values. – jimmij May 06 '17 at 14:43
-
1May I suggest that you add the reference in your comment to the body of your answer? Ciao – gboffi May 06 '17 at 14:49
-
Depending on distribution, the documentation may simply be in `/usr/share/doc/fontconfig/fontconfig-user.html` without version number. – mivk Sep 17 '19 at 11:15
-
In fact `fc-list :spacing=mono` also works. The named aliases for values (like `mono` for 100) are documented in `man fonts.conf`. – q.undertow Jul 28 '20 at 14:53
-
4To get a readable list of just the font names of monospaced fonts, try `fc-list :mono | awk -F: '{print $2}' | sort -u` – mivk Aug 27 '20 at 12:50
-
Or, shorter, `fc-list :mono family |sort` – Mr Lister May 22 '22 at 06:14