[Tex/LaTex] fontawesome does not show symbols – xelatex, lualatex

fontawesomeluatextexmakerxetex

I am trying to use fontawesome package with BasicTex distribution with the following code:

\documentclass{article}
\usepackage{fontawesome}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} 
\newfontfamily{\FA}{Font Awesome 5 Brands}

\begin{document}

\end{document}   

It compiles and doesn't give me any errors. However, it doesn't show any symbols when I try to use the logos such as:

\faTwitter
\faLinkedin
\faEnvelope

I am new to latex so I tried to solve this problem by trying other people's
answers but none of them worked. But, if I set the main font :

 \setmainfont{Font Awesome 5 Brands Regular}

it shows ALL the logos except envelope and phone. However, it automatically changes some text into symbols such as Java, python. Any ideas on how to solve this?

note: I am using texmaker with BasicTex. I have all the packages in the current folder that I am compiling. I installed the fonts Font Awesome 5 Free Regular and Font Awesome 5 Brands Regular in Font Book. When I compile it doesn't give me any errors but these warnings:

Underfull \hbox (badness 4279) in paragraph at lines 78--80
You are not using babel.sty

Best Answer

You try to use the fontawesome package, but this package is only compatible with Font Awesome 4. It will lead to problems with Font Awesome 5, especially since there is no longer a single font including all of Font Awesome.

Instead you can use the fontawesome5 package:

\documentclass{article}
\usepackage{fontawesome5}

\begin{document}
Twitter: \faTwitter
LinkedIn: \faLinkedin
Envelope: \faEnvelope
\end{document}   

enter image description here

Disclaimer: I am the maintainer of fontawesome5.

Related Question