# FontAwesome font not found?

I'm using the latest version of MacTeX 2013 on OS X 10.8.4. All of my Tex Live packages are fully up-to-date. Tex Live also lists the fontawesome package as installed.

I'm trying to use the FontAwesome font with XeLatex or LuaLatex and getting font-not-found errors. The exact message is:

kpathsea: Running mktexmf FontAwesome
! I can't find file FontAwesome'.


There's a longer traceback which I am omitting for brevity. Let me know if it's needed to resolve this problem.

I have already tried running the following commands, to no avail:

sudo -H mktexlsr
sudo -H updmap-sys


Other than the above two commands, this is a 100% new out-of-the-box installation, with no modifications whatsoever.

Here's a minimal broken example:

\documentclass{article}
\usepackage{fontawesome}

\begin{document}
\faTwitter
\end{document}


How can I add this missing font?

• FontAwesome can be found at CTAN at this location. I am not sure how you can add this to your OS X 10.8.4, I do not use this OS or MacText. But did you take a look at this one? – Masroor Sep 12 '13 at 4:02
• FontAwesome provides an OTF font, which apparently is not being copied to the correct font directory. This post suggests how you might proceed – Llaves Sep 12 '13 at 5:28
• @Llaves - It's probably not so much an issue of the font file not being copied to the correct directory but of the font not having been "activated" correctly. Just copying a font file to the user's ~/Library/Fonts directory doesn't activate it, at least not in a way suitable for use under MacOSX. Under MacOSX, the easiest way I know to "activate" a font is to load it in the FontBook application and click on the "Install Font" button. Doing so also copies the font file to ~/Library/Fonts... – Mico Sep 12 '13 at 6:45
• @Mico Luaotfload doesn’t care for a font’s “activation state” (whatever that is). As long as it is in a system path the font will be indexed. I suggest that OP remove the package and copy the otf files into the system font path manually. Then run luaotfload-tool --update and retry. – Philipp Gesang Sep 12 '13 at 8:36
• @phg -- I may not have expressed myself sufficiently clearly. As I noted in the "full" answer, LuaLaTeX was able to compile the MWE even before the otf version of the font was downloaded and "officially activated". It was XeLaTeX that couldn't compile the MWE before the font was properly activated. – Mico Sep 12 '13 at 11:38

## 9 Answers

On my MacBook (running MacTeX 2013 under MacOSX 10.7.5), your example compiles correctly under LuaLaTeX if I add the instruction \usepackage{fontspec}:

% !TEX TS-program = lualatex
\documentclass[border=2pt]{standalone}
\usepackage{fontspec}
\usepackage{fontawesome}
\begin{document}
\faTwitter
\end{document}


Addendum: After I downloaded the OpenType version of this font -- BTW, the version at http://fortawesome.github.io/Font-Awesome/ seems to be slightly newer than the one on the CTAN -- and "activated" it by opening it in the FontBook application and clicking on the "Install" button, the MWE above also compiles correctly under XeLaTeX. This is not exactly surprising, I suppose, as Xe(La)TeX depends heavily on the underlying operating system for activities such as loading fonts.

Addendum, mid-February 2020: The demo document shown above continues to work correctly under LuaLaTeX when run under TeXLive2019 or MacTeX2019. To get it to compile under XeLaTeX, you will probably need to insert the instruction

\defaultfontfeatures{Path = /usr/local/texlive/2019/texmf-dist/fonts/opentype/public/fontawesome/}


between the instructions \usepackage{fontspec} and \usepackage{fontawesome}.

The file FontAwesome.otf that's distributed with MacTeX2019 has version number 4.6.3. There is a slightly newer version of the OpenType font file -- version 4.7.0, to be precise -- on github. Both 4.6.3 and 4.7.0 date back to 2016. A minor caveat: I haven't actually tested out the slightly newer version of FontAwesome.otf. However, I believe it should be compatible with the fontawesome package.

• \usepackage{fontspec} did the trick. I'm actually using the moderncv package, which recently added support for FontAwesome icons. I'll contact the author and suggest he add the fontspec package to his template. – knite Sep 12 '13 at 18:09
• Hi, can you update your answer with tex.stackexchange.com/a/472090/166923 ? – ColonD Mar 8 '19 at 9:30
• @ColonD - Ok. Am away from my Mac laptop all day -- will update this answer tonight. – Mico Mar 8 '19 at 9:40
• The link should now be github.com/FortAwesome/Font-Awesome/blob/v4.7.0/fonts/… since Font Awesome 5 isn’t compatible with fontawesome package. – Franklin Yu Feb 14 at 9:48
• I didn’t notice that it dates back to 2016! They seems to have stopped maintenance on that branch. Maybe the MacTex one is easier then. – Franklin Yu Feb 14 at 10:26

If anyone wants to get this working with xelatex without installing the font into your system, see section 4.2 By file name of the fontspec.pdf manual:

[Loading the font by file name] is also necessary in XeTeX when loading OpenType fonts that are present within your TEX distribution, such as /usr/local/texlive/2013/texmf-dist/fonts/opentype/public. Fonts in such locations are visible to XeTeX but cannot be loaded by font name, only file name; LuaTEX does not have this restriction.

Since fontawesome.sty simply references the font by name:

% definition of \FA as a shortcut to load the Font Awesome font
\newfontfamily{\FA}{FontAwesome}


We have to set the default Path to locate the font, before loading fontawesome:

\documentclass{article}
\usepackage{fontspec}

\defaultfontfeatures{
Path = /usr/local/texlive/2013/texmf-dist/fonts/opentype/public/fontawesome/ }
\usepackage{fontawesome}

\begin{document}
\faTwitter
\end{document}


You may have to change Path depending on where fontawesome is installed. Assuming you're using TeX Live, you can find the relative path to the font file by running:

tlmgr info --list fontawesome


Output:

package:     fontawesome
category:    Package
shortdesc:   Font containing web-related icons.
longdesc:    The package offers access to the large number of web-related icons provided by the included font. The package requires the package, fontspec, running under XeTeX or LuaTeX.
installed:   Yes
revision:    31020
sizes:       doc: 173k, run: 101k
relocatable: Yes
cat-version: 3.1.1
cat-date:    2014-04-26 20:05:48 +0200
cat-license: other-free
collection:  collection-fontsextra
Included files, by type:
run files:
texmf-dist/fonts/opentype/public/fontawesome/FontAwesome.otf
texmf-dist/tex/latex/fontawesome/fontawesome.sty
doc files:
texmf-dist/doc/latex/fontawesome/README details="Readme"
texmf-dist/doc/latex/fontawesome/fontawesome.pdf
texmf-dist/doc/latex/fontawesome/fontawesome.tex


Ultimately, you need /path/to/FontAwesome.otf to be produced by \newfontfamily\FA[Path=/path/to/,Extension=.otf]{FontAwesome}.

Note this answer assumes you didn't add the TeX Live fonts to the system environment variables such that they are found when fontspec searches the system fonts. (either because you don't know how or because it isn't practical e.g. multi-client Version Control System situation where you can't guarantee that every client has the same system environment variables).

Assuming you are using XeLaTeX: To minimize maintenance with each sequential TeX Live release (2015,2016, etc.), I chose to add \defaultfontfeatures{Extension = .otf} rather than provide an explicit path.

This is because XeLaTeX automatically loads $(kpsewhich -var-value TEXMFSYSVAR)/fonts/conf/texlive-fontconfig.conf into its path. # texlive-fontconfig.conf from TeX Live 2015 <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <dir>/usr/local/texlive/2015/texmf-dist/fonts/opentype</dir> <dir>/usr/local/texlive/2015/texmf-dist/fonts/truetype</dir> <dir>/usr/local/texlive/2015/texmf-dist/fonts/type1</dir> </fontconfig>  With each release, this gets updated, so you don't have any maintenance costs ;) So you only need to add the extension parameter to \newfontfamily{\FA}{FontAwesome} indirectly this way. This is of course provided that the fonts you're using are OTF. \documentclass{article} \usepackage{fontspec} \defaultfontfeatures{Extension = .otf}% adds .otf to end of path when font loaded without ext parameter e.g. \newfontfamily{\FA}{FontAwesome} > \newfontfamily{\FA}{FontAwesome.otf} \usepackage{fontawesome} % Relevant path loaded (TeX Live 2015 expansion): /usr/local/texlive/2015/texmf-dist/fonts/opentype/FontAwesome causing missing font \begin{document} \faTwitter This is a test. \end{document}  As a fun exercise to prove your understanding, you could create a document like this: \listfiles \documentclass{article} \usepackage{fontspec} %\defaultfontfeatures{ % Extension = .otf %} %\usepackage{fontawesome} \newfontfamily\fatest{FontAwesome.otf} % Explicitly provide .otf %or %\newfontfamily\fatest[Extension=.otf]{FontAwesome} \begin{document} %\faTwitter This is a test {\fatest\char"F099} This is a test \end{document}  This works because the following are equivalent: • \newfontfamily\fatest{FontAwesome.otf} • \newfontfamily\fatest[Extension=.otf]{FontAwesome} • \defaultfontfeatures{Extension = .otf}\newfontfamily{\fatest}{FontAwesome} because they all yield a platform-independent paths. e.g. Unix-based: /usr/local/texlive/2015/texmf-dist/fonts/opentype/FontAwesome.otf  and fontspec will try to load a font by adding each prefix listed in this xml file: <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> ANYTHING IN HERE GETS PREFIXED to the font file </fontconfig>  • with your command \newfontfamily\fatest{FontAwesome.otf}, how can I join it with FA[Path=\@fontdir]... where I have an example which originally used \newfontfamily\FA[Path=\@fontdir]{FontAwesome} – lukeg Apr 2 '17 at 12:12 • @lukeg I am not sure what you mean by "join it", but I assume you mean "make it compatible with". Without knowing what your \@fontdir contains, I would venture to guess that you just need to add ,Extension = .otf as a parameter to \newfontfamily\FA. Do not forget to add a trailing slash to the path! If your \@fontdir contains a path other than the built-in TeX Live FontAwesome.otf path, then you'd need to put a copy of FontAwesome.otf at that path. Ultimately, you need /path/to/FontAwesome.otf to be produced by \newfontfamily\FA[Path=\@fontdir,Extension=.otf]{FontAwesome}. – Jonathan Komar Apr 3 '17 at 14:48 On Ubuntu, you can install fontawesome using the following command: sudo apt-get install texlive-fonts-extra  You just need to install (by double clicking) the FontAwesome.otf that comes with MacTeX on the macOs system fonts. (The new fonts downloaded from github didn't work for me.) My FontAwesome.otf is in: /usr/local/texlive/2018/texmf-dist/fonts/opentype/public/fontawesome  You can locate your file with: tlmgr info --list fontawesome  • you need to be higher, this is the best method to get the correct version of the font – ColonD Mar 8 '19 at 9:24 • This is the only answer that helped me to get Developer CV working. Thanks! – user190341 Aug 19 '19 at 19:25 • This answer did it for me. I used lualatex and ran it twice. First time it compiled the font, then the second time it picked itup. However, I imagine I could add more search paths to the ${TEXMFSYSVAR}/fonts/conf/fonts.conf. – FilBot3 Oct 1 '19 at 1:37
• GitHub still works, but you need a different link because the developers decide to make breaking change in Font Awesome 5. Font Awesome 4 is still available on GitHub via github.com/FortAwesome/Font-Awesome/blob/v4.7.0/fonts/…. – Franklin Yu Feb 14 at 9:47

I guess it might be caused by missing a step of post-installation of TeX Live. From the instruction provided tug.org, it would be like this below.

1. Make sure you have imported TeX Live binaries to your PATH. If not, you may refer this section.
2. Check the value of TEXMFSYSVAR.

$kpsewhich --var-value TEXMFSYSVAR  3. Copy TEXMFSYSVAR/fonts/conf/texlive-fontconfig.conf to your font config directory (e.g. to /etc/fonts/conf.d/09-texlive.conf). Or if you have not enough privileges to do, you may copy to your HOME direcotory as well, e.g. $ cp kpsewhich --var-value TEXMFSYSVAR/fonts/conf/texlive-fontconfig.conf \
~/.fonts.conf

4. Run fc-cache to refresh fontconfig

$fc-cache -fv  If you copy the conf file to a system-wide directory, e.g. /etc/fonts/conf.d as mentioned before, probably you need to run $ sudo fc-cache -fsv


or

# fc-cache -fsv

5. Eventually, check fc-list to make sure you've installed fontawesome

\$ fc-list | grep 'fontawesome'


The fontawesome package when using XeLaTeX assumes that the file FontAwesome.otf exists in the right place, but recent versions of FontAwesome, will install Font Awesome 5 Free-Regular-400.otf and Font Awesome 5 Free-Solid-900.otf.

I thought about playing with defaultfontFeatures[FontAwesome] after \usepackage{fontspec} and before \usepackage{fontawesome}, but a much simpler approach was to find an version of FontAwesome.oft and simply install that on my Mac.

• This is a useful answer for anyone who did install the current Font Awesome desktop files. Just to add to it, the last Font Awesome 4 release (4.7.0) provides a FontAwesome.otf. – Sean Leather Apr 1 '19 at 13:25

On Ubuntu 19.04:

sudo apt install texlive-fonts-recommended


Then use fontawesome5:

 \documentclass{article}
\usepackage{fontawesome5}

\begin{document}
\faTwitter
\end{document}


For Alpine Linux, since the package ttf-font-awesome only has Font Awesome 5, you need to manually download Font Awesome 4 from

https://github.com/FortAwesome/Font-Awesome/blob/v4.7.0/fonts/FontAwesome.otf

and place it in folder /usr/share/fonts/X11/OTF`. You can replace the tag 4.7.0 with latest release in 4.x branch.

• ? This works for me, why downvote? – Franklin Yu Feb 15 at 6:20