2

I had the "good" idea to update my Miktex distro (not just the packages, but the whole distro, by uninstalling my old version and installing the last one (2021.3)). And... obviously, everything is broken, even after reinstalling all my former packages.

My problem is related to fontawesome and xelatex. If I try to compile the following source:

\documentclass[11pt]{article}
\usepackage{fontawesome}

\begin{document}
Test \faLightbulbO
\end{document}

I get the error:

dvipdfmx:fatal: Invalid font: -1 (3)

Note: it works with Lualatex, but I like to understand where the problem comes from. Moreover, compilation with xelatex does work when using fontawesome5, but some icons I used to use have been renamed (and for some reasons, I prefer to keep my existing source files as is...)

12
  • it works fine for me. Which probably means that you have two versions of the font around and dvipdfmx finds the wrong one. Add \XeTeXtracingfonts=1 to the begin of your document, and then compile on the command line with xelatex --output-driver="xdvipdfmx -vv" yourfilename and then check the exact pathes of the fonts used in the terminal output and in the log. Side remark: not everything broke. You have one rather small problem with one rather small package. Apr 22 at 7:26
  • @UlrikeFischer I just reinstalled all from scratch (and cleaned my Program and %appdata% folders). First, I had a new error with pdflatex (Font FontAwesom e--fontawesometwo at 617 not found), but as you suggested here, rebuilding the font map files did the trick. Nevertheless, I still have the problem with xelatex; the suggested command line output gives the following file: C:/Program Files/MiKTeX/fonts/type1/public/fontawesome/FontAwesome.pfb, which exists
    – Greg82
    Apr 22 at 9:05
  • More precisely, the output is: fontmap: C:/Program Files/MiKTeX/fonts/type1/public/fontawesome/FontAwesome.pfb/0/H/65536/0/0 -> C:/Program Files/MiKTeX/fonts/type1/public/fontawesome/FontAwesome(Identity-H). The only file in fontmap: C:/Program Files/MiKTeX/fonts/type1/public/fontawesome/ is FontAwesome.pfb.
    – Greg82
    Apr 22 at 9:06
  • it is wrong that it uses the pfb, it should use the otf with xelatex. On my miktex is uses MiKTeX 2.9/fonts/opentype/public/fontawesome/FontAwesome.otf. Do you have this font? Apr 22 at 9:07
  • Yes I have. Putting it in C:/Program Files/MiKTeX/fonts/type1/public/fontawesome/ solves the compilation error... but the characters are not shown in the PDF...
    – Greg82
    Apr 22 at 9:25
1

Try to force xelatex to use the file name with

\documentclass[11pt]{article}
\usepackage{fontawesome}
\renewfontfamily{\FA}{fontawesome}[Extension=.otf]
\begin{document}
Test \faLightbulbO
\end{document}
1
  • It works! Thank you very much! I just wonder why I have to specify the extension, while it worked well before... :/
    – Greg82
    Apr 22 at 15:54

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.