2

Consider the following minimal example:

% !TEX program = xelatex
\documentclass{article}

\usepackage{fontawesome}

\begin{document}
\faTwitter{} Some Text \faLinkedin
\end{document}

On my MacTeX 2016 basic system (up to date), the icons are missing in the PDF and I get the following error message:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
/usr/local/texlive/2016basic/texmf-dist/tex/latex/fontawesome/fontawesome.sty:45: fontspec error: "font-not-found"
! 
! The font "FontAwesome" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................

The example does work when I change the engine to

% !TEX program = latex

or

% !TEX program = luatex

I don't have the font installed on my system because according to the documentation the package should use the font bundled with the package (which obviously works with latex and luatex, but not with xelatex).

cbrnr
  • 141
  • On linux and similar systems xetex can't find fonts in the texmf tree by name unless you add them first to your fontconfig configuration. See https://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-340003.4.4 and e.g. http://tex.stackexchange.com/questions/257231/using-the-tex-live-fonts-in-xelatex. – Ulrike Fischer Jan 27 '17 at 10:15
  • These instructions only work for Linux systems. I didn't find this information on the MacTeX website - could you point me to the relevant steps? – cbrnr Jan 27 '17 at 10:35
  • Hm. Isn't a mac a linux system? In any case I have windows, so can't help you with the details. – Ulrike Fischer Jan 27 '17 at 10:41
  • No, not really - they're both Unix, but differ in many aspects. Thanks anyway, I guess since this is a xelatex-related issue, I'll just switch to lualatex, which works just fine :-). – cbrnr Jan 27 '17 at 10:43
  • Sure what I mean: both are unix and the fontconfig should work similar. – Ulrike Fischer Jan 27 '17 at 10:58
  • No, fontconfig on Linux and Mac seem to be fundamentally different, since e.g. fc-cache doesn't exist. Anyway, I guess switching to lualatex seems to be the solution. – cbrnr Jan 27 '17 at 11:04
  • And the code above works fine on ubuntu using xelatex without change and without me having done anything additional to make that happen. – JPi Jan 27 '17 at 14:21
  • @JPI nice - that's how it should be. Unfortunately, this doesn't seem to be the case for all Linux distributions, since it is not working on my Arch Linux out of the box. – cbrnr Jan 30 '17 at 09:32
  • 1
    @cbrnr here are some MacTex specific instructions: https://tug.org/mactex/TeXLive2018+Changes.pdf (linked from https://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-340003.4.4) – Epimetheus Feb 22 '22 at 08:23

1 Answers1

1

As already mentioned here, all I had to do to get it to work with xelatex was install the FontAwesome font on my machine (e.g. by downloading it from here and installing the file FontAwesome.otf).

cbrnr
  • 141