I'm a TeX Newbie and I'm trying to get XeTex to work with FontAwesome. Initially I got the error : The font "FontAwesome" cannot be found. So I added the path defaultfontfeatures as suggested in: FontAwesome font not found?

      \usepackage{fontspec}
\defaultfontfeatures{
Path = /usr/local/texlive/2013/texmfdist/fonts/opentype/public/fontawesome/ }
\usepackage{fontawesome,url}


Now I want to choose some other fonts like these:

       \setromanfont[Mapping={tex-text},
Numbers={OldStyle},
Ligatures={Common}]{Minion Pro}
\setsansfont[Mapping=tex-text,
Ligatures={Common},
Colour=AA0000]{Unit-Medium}
\setmonofont[Mapping=tex-text,Scale=0.72]{Consolas}

Numbers={OldStyle},
Ligatures={Common}]{Minion Pro Medium Caption}


I get the following error:

       kpathsea:make_tex: Invalid fontname [/usr/local/texlive/2013/texmf-dist/fonts/opentype/public/fontawesome/Minion Pro]/ICU', contains '['

The font "Minion Pro" cannot be found.


What can I do to fix this?

EDIT:

The error regarding fontawesome:

                )) (/usr/local/texlive/2013/texmf-dist/tex/latex/fontawesome/fontawesome.sty
kpathsea: Running mktextfm FontAwesome
/usr/local/texlive/2013/texmf-dist/web2c/mktexnam: Could not map source abbreviation F for FontAwesome.
/usr/local/texlive/2013/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2013/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input FontAwesome
This is METAFONT, Version 2.718281 (TeX Live 2013)

kpathsea: Running mktexmf FontAwesome
! I can't find file FontAwesome'.
<*> ...our; mag:=1; nonstopmode; input FontAwesome

Please type another input file name
! Emergency stop.
<*> ...our; mag:=1; nonstopmode; input FontAwesome

Transcript written on mfput.log.
grep: FontAwesome.log: No such file or directory
mktextfm: mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input FontAwesome' failed to make FontAwesome.tfm.
kpathsea: Appending font creation commands to missfont.log.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "FontAwesome" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.27 \newfontfamily{\FA}{FontAwesome}

?

• What does MinionPro do in a Fontawesome directory? Usually MinionPro is in a subdirectory of where Adobe Reader is installed (at least that's the way it is under Windows). Also, texmf- dist shouldn't have a space. – Bernard Aug 6 '15 at 11:50
• My guess is that when I set the path to FontAwesome with \defaultfontfeatures then Tex automatically looks for all fonts in this directory? ... the dist space is because of the copy paste, will edit that. – user3063381 Aug 6 '15 at 11:54
• Tex automatically looks in the relevant directories in texmf-dist. You don't have whatever to do, if your installation is correct. Btw you forgot the hyphen in texmf-diston setting the path. Also, you should update you installation. A lot of packages have changed (in particuler FontAwesome, which has many more icons now). – Bernard Aug 6 '15 at 12:06
• I updated the my distribution. The problem persists. FontAwesome is not located. – user3063381 Aug 6 '15 at 12:44

If you've installed the font in a proper texmf directory, run texhash or the equivalent for your system. XeTeX will then find the font without having to specify the location.

Secondly, including Path in \defaultfontfeatures is almost certainly wrong in almost all cases. This is what is causing your error — after specifying a Path, fontspec assumes that the font to be loaded is specified by filename. So when you write

\setromanfont[Mapping={tex-text},
Numbers={OldStyle},
Ligatures={Common}]{Minion Pro}


this is equivalent to

\setromanfont[
Path = /usr/local/texlive/2013/texmfdist/fonts/opentype/public/fontawesome/ ,
Mapping={tex-text},
Numbers={OldStyle},
Ligatures={Common}]{Minion Pro}


which in turn means that "Minion Pro" will be attempted to be loaded by filename from the fontawesome directory. This obviously fails!

Short answer: just delete the line including \defaultfontfeatures and you should be right, as long as fontawesome is installed correctly.

(By the way, \setromanfont has now been deprecated for many many years; you should use \setmainfont instead.)

• I understand. How do I check that Fontawesome is installed correctly? I run texhash and this is the output: texhash: /usr/local/texlive/2013/../texmf-local: directory not writable. Skipping... texhash: /usr/local/texlive/2013/texmf-config: directory not writable. Skipping... texhash: /usr/local/texlive/2013/texmf-dist: directory not writable. Skipping... texhash: /usr/local/texlive/2013/texmf-var: directory not writable. Skipping... texhash: Done – user3063381 Aug 6 '15 at 13:01
• If you find that it does work to load the package with \defaultfontfeatures setting the path (does fontawesome use fontspec internally?) then just do that and then follow it up with \defaultfontfeatures{} to clear the setting. – Will Robertson Aug 6 '15 at 13:04
• You need to execute sudo texhash` – Will Robertson Aug 6 '15 at 13:04
• I have done that. Still I get the same error, which I posted in an edit. – user3063381 Aug 6 '15 at 13:08
• Also, the reason I set default path to fontawesome is because of the answer in tex.stackexchange.com/questions/132888/…. I have added this in the question. – user3063381 Aug 6 '15 at 13:21