add tag
UdiB
I am writing a document in plainTeX, and compile it with LuaTeX.

How can I use some glyphs from the Fontawesome project in my document?

```
% !TEX TS-program = luatex
\input luaotfload.sty
\font\fontawesome={./fonts/FontAwesome.otf}
%probably a couple of extra font commands go here

\rm some text goes here
\fontawesome \faArrows
\rm continue regular text
\bye
```

My project files are located as follows
```
┌myproject
├─my_document.tex
└┬─fonts
 ├─fontawesome.otf
 ├─fontawesome.map
 └─fontawesome.enc
```

(These fontawesome files were downloaded from ctan).
Top Answer
frougon
In the current state of the .tex files shipped with the `fontawesome` package, the following should work for about everything, except the two special cases defined at the end of `fontawesome.sty`, namely `\faHourglass` and `\faBattery` commands that take an optional argument. For these, you can use simple, existing macros like `\faHourglassHalf` and `\faBatteryThreeQuarters`, or define your own commands using plain TeX syntax—hence no optional argument support without going to some lengths.

```
\input luaotfload.sty
\input fontawesomesymbols-generic.tex
\input fontawesomesymbols-xeluatex.tex

% Provide a few commands expected by these .tex files
\font\FA="FontAwesome"
\def\faicon#1{\csname faicon@#1\endcsname}
% \symbol is a LaTeX command used by fontawesomesymbols-xeluatex.tex
\protected\def\symbol#1{\char #1\relax}

\rm some text goes here
% \fontawesome  <--- not needed because fontawesomesymbols-xeluatex.tex uses
%                    \FA inside a group for every symbol command it defines
\faArrows\
% \rm           <--- not needed either, due to said grouping
continue regular text

\faHourglassHalf ~\faBatteryThreeQuarters
\bye
```

(I used the `\FA` name instead of your `\fontawesome` because `fontawesomesymbols-xeluatex.tex` requires the former; of course, you may `\let\fontawesome\FA` or do something similar if you wish.)

![fa.png](/image?hash=17427556c82b22b365ad749de139d8076eb384e87f3708411863994ed154f591)
Answer #2
Udi Fogiel
If you need only few symbols, you don't need to load more than 1000 lines of code with lots of macros you will probably won't use. Simply load the font with the `\font` primitive, as you did, than print the glyph using the `\char` primitive. You do not need the files `fontawesome.map` and `fontawesome.enc`, these are needed only with pdfTeX. 

```
\input luaotfload.sty
\font\fontawesome={./fonts/FontAwesome.otf}

some text goes here
\fontawesome \char"F047\
\rm continue regular text
\bye
```
![image.png](/image?hash=b3eb648865397382886bc128eb14f4dda7404a1fcd3e281ace4af6d88a82e76c)
If you need the symbol several times, you can define a macro for it, for convenience, something like
```
\protected\def \Arrows{{\fontawesome \char"F047\relax}}
```
## Edit:
Alternatively, if you are willing to use LuaHBTeX and the more [up to date fonts](https://fontawesome.com/download), you can use ligatures, which might be more convenient. This way you can simply type the name of the icon, no need to look up for the char slot or to use macros. 

```
\input luaotfload.sty
\font\fa={file:Font Awesome 6 Free-Solid-900.otf:mode=harf;}

some text goes here
\fa arrows % or arrows-up-down-left-right
\rm continue regular text
\bye
```
The result is the same as above.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.