49

How can I find out which fonts are currently available in my TeX installation? (I'm using a Mac, OS 10.6.x, if that matters, although I'd prefer a machine-independent TeX-based answer). Thanks.

As a followup, I tried googling for an answer to this question, without much success. Is there somewhere I could have looked for myself?

1

6 Answers 6

20

There isn't a definitive "these are the fonts installed" reference, but you can usually discover them by poking around in your TeX distribution. For example, look in /usr/local/texlive/2009/texmf-dist/fonts/ ; you'll find a bunch of subdirectories with type1 fonts, tfm files, and so on. To load a font in LaTeX, however, you need .fd files, and these are found alongside any .sty files for the fonts. For example, t1lmr.fd is the font definition for loading the Latin modern roman fonts with \fontfamily{lmr} (assuming the T1 encoding).

Anyway, the directory names for the fonts themselves will give you clues about packages to load if you're using LaTeX; otherwise, any font with a tfm file (such as ec-lmr10.tfm for Latin modern roman at 10pt) can be loaded in plain TeX with

\font\tenrm=ec-lmr10 at 10pt

You might font individual font packages easier to locate by browsing through CTAN, since the support files will be located alongside the fonts themselves.

Update

You could grep through the LaTeX support files to find a comprehensive listing of available font families, if you liked; not sure how useful this is, but try:

 find /usr/local/texlive/2010/texmf-dist/tex/latex/ -name '*.fd' | xargs grep '\\DeclareFontFamily' | sed 's#.*\\DeclareFontFamily{\([a-zA-Z0-9]*\)}{\([a-zA-Z0-9]*\)}.*#  \1    \2#'

(My shell scripting skills are a little rusty, but you get the idea.) Change the first [a-zA-Z0-9]* into, say, T1 if you want only fonts with that encoding.

6
  • 5
    It's unfortunate that there's no way to get the LaTeX-available font-family names. Seems like a useful thing to have (at least for me).
    – rogerl
    Commented Aug 25, 2010 at 16:38
  • Shell script looks fine but I'd put single quotes around *.fd.
    – gknauth
    Commented Feb 6, 2011 at 18:53
  • @gknauth I'm sure you're correct but could you also explain why? Commented Feb 6, 2011 at 23:50
  • '*.fd' lets find do the expansion, whereas *.fd has the shell do the expansion, and if there are too many files, the whole thing could fail.
    – gknauth
    Commented Feb 9, 2011 at 18:52
  • 1
    @gknauth, @Will: I agree that the pattern *.fd should be enclosed in single quotes, but I don't think gknauth's reason is fully correct. Without quotes the shell will try to expand the pattern. This will break if there are any files ending with .fd in the current directory.
    – Olof
    Commented Feb 10, 2011 at 8:34
25

Besides searching for font files with the appropriate extension or looking below the texmf-dist/fonts/ directory, I would check the font map files.

This command gives an system wide overview of the active and inactive font map files:

updmap-sys --listmaps

Use it at the command prompt. The output looks like:

Map      euler.map
MixedMap cm.map
MixedMap cmextra.map
MixedMap cyrillic.map
MixedMap symbols.map
Map bera.map
MixedMap cm-super-t1.map
MixedMap cm-super-t2a.map
MixedMap cm-super-t2b.map
MixedMap cm-super-t2c.map
MixedMap cm-super-ts1.map
MixedMap cm-super-x2.map
Map cmcyr.map
Map dstroke.map
Map fourier-utopia-expert.map
Map fourier.map
Map kpfonts.map
Map libertine.map
Map lm.map
MixedMap lxfonts.map
Map marvosym.map
Map MnSymbol.map
Map charter.map
...

So I know among others there are installed: euler, cm-super, dstroke, fourier, kpfonts, libertine, marvosym, MnSymbol, charter, etc.

For a reference of updmap-sys or updmap go to the command prompt (terminal) and type

man updmap-sys

or for a brief overview

updmap-sys --help

or have a look at this web manpage.

2
  • 1
    +1 Stefan. I was going to add a comment to Will's answer about ls -lr'ing / dir /S'ing the texmf for .map's then grep'ing them for ^map or mixedmap. But your answer is way more elegant! Sadly (for me), updmap-sys is not part of MikTeX, and updmap itself doesn't provide this function. Heck, it's back to dir /s \*.map I go. :) Commented Aug 25, 2010 at 18:14
  • this should the accepted answer for the question!
    – scot
    Commented Feb 1, 2019 at 9:37
16

The above solutions make more sense depending on what you want to do, but the output can be confusing, since it includes things like symbol-only fonts, and doesn't actually show you what the fonts look like or even what their full names are.

I find that if I have a complete, up-to-date installation of TeXlive, however, that the fonts I can choose from (unless I've installed my own custom package) are usually pretty much exactly the ones listed in the LaTeX font catalogue online, and that's usually my go-to source if I'm trying to decide between fonts on aesthetic grounds alone.

Of course, there are other reasons I might want a font list where Stefan's or Will's methods would be more appropriate.

1
  • 1
    That's probably the best way to go, really. Commented Aug 26, 2010 at 1:51
11

On modern Linux systems there's an incredibly useful set of cli tools provided by the Fontconfig (http://www.freedesktop.org/wiki/Software/fontconfig/) package. These include fonts for quering installed fonts, scanning directories for fonts, printing information about the contents of font files, testing the fonts matched by a given name and others, they are a complete lifesaver and along with fontconfig's other capabilities (Defining user-wide substitutions of fonts very flexibally) turns what once was very painful into a relatively easy and managable process.

Specifically, the fc-list command shows you the paths system-wide installed fonts and fc-query lets you find the proper font fnaily name to use with fontspec.

I use these all the time with xelatex, relying heavily on system fonts rather then fonts available through my TexLive install.

6

I can't offer a TeX distribution independent answer as requested but, as some great but nevertheless distribution specific answers have already been provided, I won't feel too out of place about filling in the gaps for MikTeX distro users. It's as easy-as in MikTeX -- load up Package Manager (Admin), click the Category column header to sort on that field, check out the "Installed On" date in the \Fonts\METAFONT and \Fonts\Outline fonts categories. Repeat the process with Package Manager (User) for local configs.

Unfortunately, despite its simplicity, this approach is not a perfect bet; there are still some big 'ifs' involved:

  • it doesn't tell you anything about "non-packaged" fonts (for that, you'll need to run solutions closer to the metal, as already mentioned, e.g., by Will)
  • it doesn't tell you anything about "hand installed" fonts (ditto above)
  • it doesn't say anything PSNFSS standard fonts (however, let's assume you at least have these)

Nevertheless, for those with MikTeX, it'll take less than a minute to complete, and it can take them quite a long way to their goal. Besides being super quick and simple, you can right-click on any entry in Package Manager, click on Properties, to see the detailed description bundled with the package, whether installed on the box or not.

0

With TeX Live and MiKTeX, you can use

albatross -tdb0 a | tail -n+6

which gives a nice output similar to:

Name: 0swald Bold
Type: Type 1
Files:
- /usr/share/texmf-dist/fonts/type1/public/oswald/0swald-Bold.pfb

Name: 0swald ExtraLight Regular
Type: Type 1
Files:
- /usr/share/texmf-dist/fonts/type1/public/oswald/0swald-ExtraLight.pfb

...

This also includes system fonts, which is good if you are using XeTeX or LuaTeX. If you want only LaTeX fonts, you have to filter the texmf tree directories. For a standard TeX Live setup, you can do this with:

albatross -tdb0 a | tail -n+6 | awk '{FS=":"; OFS=":"; RS="\n\n"; ORS="\n\n"} /texmf-dist/' 

The result is pretty much the same, except you are omitting records where there's no /texmf-dist/ in file paths.

For more options, see albatross man page.

You must log in to answer this question.

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