Reputation: 586
I am trying to use FontAwesome in XeLaTex on OS X. So I followed the steps described on this github:
So that the beginning of my .tex file look like this:
\documentclass{.......}
\usepackage{fontspec}
\usepackage{fontawesome}
\newfontfamily{\FA}{FontAwesome Regular}
\begin{document}
But I keep getting this error:
kpathsea:make_tex: Invalid fontname `FontAwesome Regular', contains ' '
kpathsea:make_tex: Invalid fontname `FontAwesome Regular', contains ' '
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "FontAwesome Regular" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................
It seems like it is not finding the font. After some research, I tried loading the font with:
\defaultfontfeatures{
Path = /usr/local/texlive/2013/texmf-dist/fonts/opentype/public/fontawesome/ }
\usepackage{fontawesome}
instead of \newfontfamily{\FA}{FontAwesome Regular} but it was not working either.
I am still new with LaTex and I do appreciate your time, thank you
Upvotes: 6
Views: 19904
Reputation: 147
Had same problem! After hours struggling, I solved by using fontawesome5
instead, there are small changes with icon names following by this link: https://mirrors.ibiblio.org/CTAN/fonts/fontawesome5/doc/fontawesome5.pdf
Upvotes: 0
Reputation: 600
Once download the font file from FontAwesome and install to be system font, open the font application and confirm the FontAwesome name.
Due to FontAwesome version is 5.7.2 at this time, this version has three font type in system font.
Their names are
Font Awesome 5 Free Regular
Font Awesome 5 Free Solid
Font Awesome 5 Brands Regular
So define command for FontAwesome:
\newfontfamily{\FAFR}{Font Awesome 5 Free Regular}
\newfontfamily{\FAFS}{Font Awesome 5 Free Solid}
\newfontfamily{\FAB}{Font Awesome 5 Brands Regular}
Simply redefine:
\def\faEmail{{\FAFR \symbol{"F0E0}}} % Email
\def\faPhone{\FAFS \symbol{"F095}} % Phone
\def\faLinkedin{\FAB \symbol{"F08C}} % Linkedin
\def\faGithub{\FAB \symbol{"F09B}} % Github
\def\faStackOverflow{\FAB \symbol{"F16C}} % StackOverflow
Upvotes: 5
Reputation: 137
I found this video (https://www.youtube.com/watch?v=OlpVKUpraao) particularly useful. Please do the following.
Upvotes: 1
Reputation: 53597
Fontspec taps into your system fonts by default, so: FontAwesome needs to be installed as a normal system font like every other. If you don't see it in Fontbook or the like, you didn't install it properly.
(lines 7 and 8 of the gist you quote mention this, but I'm reiterating it just in case)
If instead you want to run it "from file" rather than installing it as system font, don't use \newfontfamily{\FA}{FontAwesome Regular}
but use the "from path" way to load a font file, as explained over on the tex.stackexchange site, in https://tex.stackexchange.com/questions/12565/load-fonts-that-are-in-a-fonts-directory
Upvotes: 4