tectonic icon indicating copy to clipboard operation
tectonic copied to clipboard

Error building document dependent on FontAwesome

Open sug0 opened this issue 4 years ago • 6 comments

Running tectonic to produce a build of my CV fails with the following output:

$ tectonic CV.tex
Running TeX ...
error: fontawesome.sty:46: Package fontspec Error: The font "FontAwesome" cannot be found.

For immediate help type H <return>
error: halted on potentially-recoverable error as specified

The default bundle found in archive.org that tectonic points to does seem to contain FontAwesome.otf, so I'm not sure why the build fails...

Edit: I am using tectonic 0.7.0

sug0 avatar Jul 01 '21 23:07 sug0

Thanks for reporting! The issue might be as simple as the font specification requiring a .otf extension ... if you can post a minimal example that demonstrates the error, that would be helpful, but my guess is that a \usepackage{fontawesome} will be all that it takes.

pkgw avatar Jul 02 '21 14:07 pkgw

Thanks for reporting! The issue might be as simple as the font specification requiring a .otf extension ... if you can post a minimal example that demonstrates the error, that would be helpful, but my guess is that a \usepackage{fontawesome} will be all that it takes.

Correct. Here's a snippet:

...
\usepackage{fancyhdr}
\usepackage[english]{babel}
\usepackage{fontawesome}
...
\faStar

sug0 avatar Jul 02 '21 14:07 sug0

Just wanted to note that a temporary solution for this is to install FontAwesome on the system.

sug0 avatar Jul 06 '21 00:07 sug0

See also #157, I had forgotten about that one.

pkgw avatar Jul 06 '21 12:07 pkgw

Some quick notes-to-self on this:

The key routine is find_native_font. For a minimal example the usages are:

Breakpoint 2, find_native_font (uname=0x55555738ea00 "[lmroman10-regular]:mapping=tex-text;", scaled_size=655360)
Breakpoint 2, find_native_font (uname=0x55555737ea00 "[lmroman10-bold]:mapping=tex-text;", scaled_size=655360)
Breakpoint 2, find_native_font (uname=0x555557d9baa0 "FontAwesome", scaled_size=655358) at xetex/xetex-ext.c:713

The bracketed versions search for specific files; the non-bracketed FontAwesome version ends up invoking XeTeXFontMgr::findFont. This doesn't seem to try to open any files by name.

pkgw avatar Jul 08 '21 12:07 pkgw

See this comment — this should be fixed the next time I release an updated bundle. In the meantime, the workaround is pretty straightforward.

pkgw avatar Sep 10 '22 18:09 pkgw

\documentclass{article}
\usepackage{fontawesome}
\begin{document}

\faStar

\end{document}

Thanks to the workaround, this works in the latest release. So the issue can be closed I think.

For future reference, see also #157 and #9 which is the crux of the issue.

vlasakm avatar Dec 13 '22 17:12 vlasakm