Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix \newfontfamily to work with XeLaTeX #1

Closed
wants to merge 1 commit into from
Closed

fix \newfontfamily to work with XeLaTeX #1

wants to merge 1 commit into from

Conversation

e-kwsm
Copy link

@e-kwsm e-kwsm commented Mar 26, 2018

@diogo-fernan
Copy link
Owner

See xdanaux/moderncv#35 (comment).

@e-kwsm
Copy link
Author

e-kwsm commented Mar 27, 2018

XeLaTeX cannot compile

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

under my environment, frozen TeX Live 2017:

  • XeLaTeX Version 3.14159265-2.6-0.99998 (TeX Live 2017)
  • academicons 2017/05/15 v1.8.0
  • fontspec 2017/11/09 v2.6g

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
Copy link
Owner

diogo-fernan commented Mar 27, 2018

@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
Copy link
Author

e-kwsm commented Mar 27, 2018

@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:

  • fontspec-doc-fontsel.tex#L67

    In \LuaTeX, fonts found in the \textsc{texmf} tree can also be loaded by name.

  • fontspec-doc-fontsel.tex#L97-L102

    \XeTeX\ and \LuaTeX\ also allow fonts to be loaded by file name instead of font name.
    When you have a very large collection of fonts, you will sometimes not
    wish to have them all installed in your system's font directories.
    In this case, it is more convenient to load them from a different location on your disk.
    This technique is also necessary in \XeTeX\ when loading OpenType fonts that are present within your \TeX\ distribution, such as \path{/usr/local/texlive/2013/texmf-dist/fonts/opentype/public}.
    Fonts in such locations are visible to \XeTeX\ but cannot be loaded by font name, only file name; \LuaTeX\ does not have this restriction.

    (Emphasis added)

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
Copy link
Owner

diogo-fernan commented Mar 27, 2018

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
Copy link
Author

e-kwsm commented Mar 27, 2018

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 diogo-fernan reopened this Mar 27, 2018
diogo-fernan added a commit that referenced this pull request Mar 27, 2018
@diogo-fernan
Copy link
Owner

Implemented the suggestion in 8fe8286 and uploaded a new version to CTAN, which should be synchronized across repositories during the next day.

Thanks. :)

@e-kwsm e-kwsm deleted the fix-xelatex branch March 28, 2018 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants