34

I'd like to have a list of all the monospace fonts that fontconfig knows of, which command do I have to use?

1 Answer 1

34

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).

7
  • 2
    I knew fc-list but "… the spacing corresponding to mono, that would be 100 …" was waay above my fontconfigosciousness. Thanks
    – gboffi
    Commented May 6, 2017 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
    Commented May 6, 2017 at 14:43
  • 1
    May I suggest that you add the reference in your comment to the body of your answer? Ciao
    – gboffi
    Commented May 6, 2017 at 14:49
  • Depending on distribution, the documentation may simply be in /usr/share/doc/fontconfig/fontconfig-user.html without version number.
    – mivk
    Commented Sep 17, 2019 at 11:15
  • 4
    To get a readable list of just the font names of monospaced fonts, try fc-list :mono | awk -F: '{print $2}' | sort -u
    – mivk
    Commented Aug 27, 2020 at 12:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .