fontawesome icons are getting too big using XeLaTeX

xdvipdfmx (XeTeX’s output driver) has a bug with handling CFF-flavoured OpenType fonts (fonts usually with a .otf extension) with non-1000 UPM. It is a known bug with no known fix, unfortunately.

The Font Awesome has a 1792 UPM, so it suffers from this bugs.

One possible work around is to change the font to use 1000 UPM. FontForge can do this easily, from the GUI Element → Font Info → General → Em Size and change the value to 1000 while keeping the [x] Scale Outlines selected, so that FontForge can do the necessary scaling to compensate for the UPM change. Then generate a new OTF file. Using FontForge’s Python scripting, this can be done as:

import fontforge
font = fontforge.open("FontAwesome.otf")
font.em = 1000
font.generate("FontAwesome-1000upm.otf")

Another solution is to just use the TTF version of the font, but I’m not sure how compatible is it with the OTF version encoding-wise.


Download https://fontawesome.com/v4.7.0/assets/font-awesome-4.7.0.zip

then under fonts, install ttf instead of otf and in your *.sty file replace

\newfontfamily{\FA}{FontAwesome} with \newfontfamily{\FA}{FontAwesome Regular}