The following example must be compiled with XeLaTeX to reproduce the issue.

% arara: xelatex
Text Text \faMobilePhone\ Text Text

Normally I am using TeXworks to compile and view the output. With the internal viewer I am getting the desired result. The following image demonstrates it:

enter image description here

However if I open the pdf with Preview (viewer of Mac) the scaling of the icon fails.

enter image description here

If I open the pdf file with Adobe Acrobat Reader the icon is still scaled correctly. If I print the page my printer is also not able to scale the icons correctly.

If I use LuaLaTeX everything seems to work correctly.

Can you reproduce the issue and do you know a solution?

  • 3
    Confirmed; seems to be a problem with the PDF engine on Mac OS X. If opened with Adobe Reader the size is correct; both it and the internal viewer of TeXworks don't rely on the PDF toolkit of Mac OS X. – egreg Sep 19 '13 at 15:07
  • @egreg: Thanks for your replay. I couldn't find any related issue and I thought it was my flaw ;-). – Marco Daniel Sep 19 '13 at 15:16
  • Is it a CFF-flavoured OpenType font (usually with a .otf extension) with a non-1000 UPM? If yes, then it is a known bug. – Khaled Hosny Sep 19 '13 at 16:54
  • @KhaledHosny: Interesting. I am not enough familiar with fonts to know whether it's a non 1000 upm or not. But the bug seems to be similar. Thanks. – Marco Daniel Sep 19 '13 at 18:29
  • 2
    The .otf file available from fortawesome.github.io/Font-Awesome, do indeed have a 1792 UPM size, so that is the bug. The only immediate solution is to convert the font to 1000 UPM units (using FontForge or similar). – Khaled Hosny Sep 19 '13 at 18:53

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

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.

  • I'm facing the same trouble and, as I didn't succeed to generate the FontAwesome-1000upm.otf file, is it possible for you to make it available for download? BTW, what is then necessary (and sufficient)? Just to replace \newfontfamily{\FA}{FontAwesome} by \newfontfamily{\FA}{FontAwesome-1000upm} in the fontawesome.sty file? – Denis Bitouzé Jun 16 '14 at 16:20

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}
  • 2
    While I don't doubt that this answer works, could you explain why it does? – ChrisS Aug 17 '14 at 10:33
  • thanks a lot! Just wanted to point out, that this solution also solved the "inverse problem" (wrong scaling in Adobe Reader; correct scaling in every other reader I tried) – JBantje Dec 1 '14 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.