tectonic-typesetting / tectonic

A modernized, complete, self-contained TeX/LaTeX engine, powered by XeTeX and TeXLive.
https://tectonic-typesetting.github.io/
Other
3.98k stars 162 forks source link

moderncv example won't compile on Tectonic #157

Closed kozross closed 3 years ago

kozross commented 6 years ago

This is what I get in the terminal when I try:

[koz@Sebastian data-wrangling-2018]$ make
tectonic --outdir=intermediate cv.tex
note: this is a BETA release; ask questions and report bugs at https://tectonic.newton.cx/
Running TeX ...
note: indexing https://purl.org/net/pkgwpub/tectonic-default
note: resolved to https://dl.bintray.com/pkgw/tectonic/tl2016extras/2016.0r4/tlextras-2016.0r4.tar
note: downloading SHA256SUM
note: downloading moderncv.cls
note: downloading colortbl.sty
note: downloading ecrm1095.tfm
note: downloading lmodern.sty
note: downloading tweaklist.sty
note: downloading moderncvcollection.sty
note: downloading moderncvcompatibility.sty
note: downloading moderncvstylecasual.sty
note: downloading moderncviconsawesome.sty
error: something bad happened inside TeX; its output follows:

===============================================================================
(cv.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(moderncv.cls
Document Class: moderncv 2015/07/28 v2.0.0 modern curriculum vitae and letter d
ocument class
(size11.clo) (etoolbox.sty) (ifthen.sty) (xcolor.sty (color.cfg) (xetex.def
(infwarerr.sty) (ltxcmds.sty)) (colortbl.sty (array.sty))) (ifxetex.sty)
(ifluatex.sty) (fontenc.sty (t1enc.def)) (lmodern.sty) (url.sty) (graphicx.sty
(keyval.sty) (graphics.sty (trig.sty) (graphics.cfg))) (fancyhdr.sty)
(tweaklist.sty) (calc.sty) (xparse.sty (expl3.sty (expl3-code.tex)
(l3xdvipdfmx.def))) (microtype.sty (microtype-xetex.def) (microtype.cfg))
(moderncvcollection.sty) (moderncvcompatibility.sty)) (moderncvstylecasual.sty
(moderncviconsawesome.sty (fontawesome.sty (fontawesomesymbols-generic.tex)
(fontspec.sty (fontspec-xetex.sty (fontenc.sty (eu1enc.def) (eu1lmr.fd))
(xunicode.sty (t3enc.def (eu1lmss.fd))) (fontspec.cfg)))

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
! 
! The font "FontAwesome" cannot be found.
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

l.45 \newfontfamily{\FA}{FontAwesome}

No pages of output.
Transcript written on cv.log.
===============================================================================

error: halted on potentially-recoverable error as specified
make: *** [makefile:4: cv.pdf] Error 1

Example in question (download link).

HaoZeke commented 6 years ago

Do you have FontAwesome installed?

kozross commented 6 years ago

The only thing called FontAwesome I have in my distro's package manager is an .sty, which I assume Tectonic should pull down.

HaoZeke commented 6 years ago

No, you'll need a .otf or a .ttf installed... Does this work without tectonic?

kozross commented 6 years ago

@HaoZeke: Yes, it can be built using TeXLive with latexmk. fontawesome is a LaTeX package which TeXLive contains.

thomaseizinger commented 6 years ago

I ran into the same problem. The casual style of moderncv depends on FontAwesome being locally installed. On my ubuntu machine, I could install it through sudo apt install fonts-font-awesome. I also run tectonic through a docker image, so I had to mount my /usr/share/fonts folder into the docker image.

You may also need to reload your font-cache after installing the font.

kozross commented 6 years ago

@thomaseizinger Perhaps, but the fact is that it does work with TeXLive, or at least it did in my case. I certainly didn't locally install anything like FontAwesome, and I'm not sure if Gentoo even packages it.

thomaseizinger commented 6 years ago

@kozross Did you check if the resulting PDF had the actual FontAwesome icons in it? Maybe some kind of fallback was selected on your local installation?

Also, if you installed the full TeXLive package, it may have come as a peer-dependency.

kozross commented 6 years ago

I just found and installed Font Awesome. This is the list of files the Gentoo package in question contains:

[koz@Sebastian downloads]$ equery f fontawesome
 * Searching for fontawesome ...
 * Contents of media-fonts/fontawesome-5.1.0:
/usr
/usr/share
/usr/share/fonts
/usr/share/fonts/fontawesome
/usr/share/fonts/fontawesome/Font Awesome 5 Brands-Regular-400.otf
/usr/share/fonts/fontawesome/Font Awesome 5 Free-Regular-400.otf
/usr/share/fonts/fontawesome/Font Awesome 5 Free-Solid-900.otf
/usr/share/fonts/fontawesome/encodings.dir
/usr/share/fonts/fontawesome/fa-brands-400.ttf
/usr/share/fonts/fontawesome/fa-regular-400.ttf
/usr/share/fonts/fontawesome/fa-solid-900.ttf
/usr/share/fonts/fontawesome/fonts.dir
/usr/share/fonts/fontawesome/fonts.scale

I then ran fc-cache to reload the font cache. Tried to compile the given example with Tectonic again - still same error.

thomaseizinger commented 6 years ago

FYI, I have an actual FontAwesome.otf file installed. I am not aware on the details about the font resolution works but maybe you need some kind of alias so that the font can be found as FontAwesome?

➜  ~ fc-list | grep -i FontAwesome
/usr/share/fonts/opentype/font-awesome/FontAwesome.otf: FontAwesome:style=Regular
/usr/share/fonts/woff/font-awesome/fontawesome-webfont.woff: FontAwesome:style=Regular
/usr/share/fonts/truetype/font-awesome/fontawesome-webfont.ttf: FontAwesome:style=Regular
kozross commented 6 years ago

Perhaps. For reference, this is the result of ``fc-list | grep -i FontAwesome' for me:

/usr/share/fonts/fontawesome/fa-regular-400.ttf: Font Awesome 5 Free:style=Regular
/usr/share/fonts/fontawesome/fa-brands-400.ttf: Font Awesome 5 Brands:style=Regular
/usr/share/fonts/fontawesome/Font Awesome 5 Free-Solid-900.otf: Font Awesome 5 Free,Font Awesome 5 Free Solid:style=Solid
/usr/share/fonts/fontawesome/fa-solid-900.ttf: Font Awesome 5 Free:style=Solid
/usr/share/fonts/fontawesome/Font Awesome 5 Brands-Regular-400.otf: Font Awesome 5 Brands,Font Awesome 5 Brands Regular:style=Regular
/usr/share/fonts/fontawesome/Font Awesome 5 Free-Regular-400.otf: Font Awesome 5 Free,Font Awesome 5 Free Regular:style=Regular
jmatraszek commented 5 years ago

I had the same issue, but it seems that this is an issue with fontawesome.sty package — it only supports Font Awesome version 4. Version 5 was released AFAIR ~1 year ago and most distros already package version 5, which uses different naming convention for font files. There is a fontawesome5 package by the same author, but moderncv will probably always stay on fontawesome & 4th version of Font Awesome.

For Arch the fix was to uninstall otf-font-awesome official package which packages version 5, and install ttf-font-awesome-4 which packages version 4.

maximevince commented 3 years ago

@jmatraszek fix for Arch worked for me, too!

pkgw commented 3 years ago

OK, I'm gonna close this issue since it sounds like it doesn't call for any changes in Tectonic. Thanks for everyone's comments!

batisteo commented 3 years ago

For Fedora I just had to install texlive-fontawesome to make it work.

I just don’t get why we need the font on the local machine. Why tectonic doesn’t download it for us?

pkgw commented 3 years ago

@batisteo It shouldn't be necessary, but if there's a bug in the way that the bundle is put together, it may help to install fonts on the local system. The current default bundle includes the following files with "fontawesome" in their names:

FontAwesome--fontawesomeone.tfm
FontAwesome--fontawesomethree.tfm
FontAwesome--fontawesometwo.tfm
FontAwesome.otf
FontAwesome.pfb
FontAwesome5Brands-Regular-400.otf
FontAwesome5Brands-Regular.pfb
FontAwesome5Free-Regular-400.otf
FontAwesome5Free-Regular.pfb
FontAwesome5Free-Solid-900.otf
FontAwesome5Free-Solid.pfb
fontawesome.sty
fontawesome5-generic-helper.sty
fontawesome5-mapping.def
fontawesome5-utex-helper.sty
fontawesome5.sty
fontawesomeone.enc
fontawesomesymbols-generic.tex
fontawesomesymbols-pdftex.tex
fontawesomesymbols-xeluatex.tex
fontawesomethree.enc
fontawesometwo.enc
lwarp-fontawesome.sty
lwarp-fontawesome5.sty
tufontawesomebrands.fd
tufontawesomefree.fd
tufontawesomepro.fd
ufontawesomebrands0.fd
ufontawesomebrands1.fd
ufontawesomefree0.fd
ufontawesomefree1.fd
ufontawesomefree2.fd
ufontawesomefree3.fd
ufontawesomeone.fd
ufontawesomethree.fd
ufontawesometwo.fd

So I would hope that with a patch this could maybe work without needing to install any system fonts. (This would be a bug associated with the tectonic-texlive-bundles repo.)

0x7969 commented 3 years ago

I had the same issue, but it seems that this is an issue with fontawesome.sty package — it only supports Font Awesome version 4. Version 5 was released AFAIR ~1 year ago and most distros already package version 5, which uses different naming convention for font files. There is a fontawesome5 package by the same author, but moderncv will probably always stay on fontawesome & 4th version of Font Awesome.

For Arch the fix was to uninstall otf-font-awesome official package which packages version 5, and install ttf-font-awesome-4 which packages version 4.

I'm on Arch aswell, unfortunately this didn't work for me. What worked though was adding a path to your fontawesome.sty (which is e.g. provided with https://github.com/posquit0/Awesome-CV) by editing the \newfontfamily command to look for the font directly like so: \newfontfamily{\FA}[Path = fonts/]{FontAwesome}. Provided that your FontAwesome.ttf is in a subfolder fonts/ relative to the texfile you are compiling. You could also try entering an absolute path to your systems font directories.

diohabara commented 2 years ago

I'm facing the same issue when compiling on macOS Monterey by Tectonic 0.9.0.

pkgw commented 2 years ago

OK, in https://github.com/tectonic-typesetting/tectonic-texlive-bundles/pull/10 I have finally added a patch to fontawesome.sty to fix the loading issue in future editions of the Tectonic bundle.

Until that bundle comes out, you should be able to work around this problem by saving this patched version of fontawesome.sty alongside your document source code. All it does is add a .otf extension to the \newfontfamily command.

Note also that if you're using TeXLive 2021, it looks like the latest version of moderncv uses the fontawesome5 package which avoids this issue.

vlasakm commented 1 year ago

Just to link the issues: I am fairly sure the crux of this issue is #9.