diogo-fernan / academicons

LaTeX academicons package for high qual­ity icons of on­line aca­demic pro­files.
https://www.ctan.org/pkg/academicons
60 stars 16 forks source link

fix `\newfontfamily` to work with XeLaTeX #1

Closed e-kwsm closed 6 years ago

e-kwsm commented 6 years ago

originally reported in https://tex.stackexchange.com/questions/296294/missing-font-with-academicons-sty/296300#296300

diogo-fernan commented 6 years ago

See https://github.com/xdanaux/moderncv/pull/35#issuecomment-376162173.

e-kwsm commented 6 years ago

XeLaTeX cannot compile

\documentclass{article}
\usepackage{academicons}
\begin{document}
\aiOrcid
\end{document}

under my environment, frozen TeX Live 2017:

while LuaLaTeX Version 1.0.4 (TeX Live 2017) can.

The error messages are

(/usr/local/texlive/2017/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
kpathsea: Running mktextfm academicons
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input academicons
This is METAFONT, Version 2.7182818 (TeX Live 2017) (preloaded base=mf)

kpathsea: Running mktexmf academicons
! I can't find file `academicons'.
<*> ...our; mag:=1; nonstopmode; input academicons

Please type another input file name
! Emergency stop.
<*> ...our; mag:=1; nonstopmode; input academicons

Transcript written on mfput.log.
grep: academicons.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input academicons' failed to make academicons.tfm.
kpathsea: Appending font creation commands to missfont.log.

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

l.12 \newfontfamily{\AI}{academicons}

?

This patch solves the error.

diogo-fernan commented 6 years ago

@e-kwsm the error reads The font "academicons" cannot be found.. Have you installed the Academicons font on your system? Please read the package instructions before using it.

e-kwsm commented 6 years ago

@diogo-fernan

Have you installed the Academicons font on your system?

Yes.

$ tlmgr info --list academicons 2> /dev/null | tail -n9
Included files, by type:
run files:
  texmf-dist/fonts/truetype/public/academicons/academicons.ttf
  texmf-dist/tex/latex/academicons/academicons.sty
doc files:
  texmf-dist/doc/fonts/academicons/README details="Readme"
  texmf-dist/doc/fonts/academicons/academicons.pdf details="Package documentation"
  texmf-dist/doc/fonts/academicons/academicons.tex

Only LuaLaTeX can find the bundled font, as documented in fontspec:

Or, you mean we have to manually do something like cp /usr/local/texlive/2017/texmf-dist/fonts/truetype/public/academicons/academicons.ttf /usr/local/share/fonts/truetype/academicons? I don't think it's a good idea.

diogo-fernan commented 6 years ago

The packages requires the font to be installed on the system, as per the documentation, where it is visible to all programs, not just TeX.

e-kwsm commented 6 years ago

The packages requires the font to be installed on the system

The design is not good. This patch simplifies installation and maintenance. I was confused the situation where LuaLaTeX worked but XeLaTeX didn't though academicons was installed by tlmgr. Why not? Those who wants to use academicons for other softwares can install it on a system by themselves.

diogo-fernan commented 6 years ago

Implemented the suggestion in https://github.com/diogo-fernan/academicons/commit/8fe8286188d1940fc2f3ab3b4a363057f1298095 and uploaded a new version to CTAN, which should be synchronized across repositories during the next day.

Thanks. :)