# XeLaTeX: Some font shapes were not available, defaults substituted

When I compile the following code

\documentclass{article}

\usepackage{mathspec}
\setmathsfont(Latin){Neo Euler}

\begin{document}
$$A$$
\end{document}


using XeLaTeX I obtain the following warnings:

Font shape TU/NeoEuler(0)/m/it' undefined(Font) using TU/NeoEuler(0)/m/n' instead
Some font shapes were not available, defaults substituted.


I have a font called Neo Euler installed. I don't like warnings, so what can I do?

• that is saying you don't have an italic version of the font, which could be because you don't have and italic version of the font, or because xetex can not find it, do you know which of those is the case? – David Carlisle Mar 2 '18 at 20:39
• Perhaps I don't have it, but how is it needed here? The output looks just like the euler font I am used to from eulervm. – John Dorian Mar 2 '18 at 20:41
• well perhaps you don't need it, perhaps the font isn't available in italic, but remember the pdflatex package is hand written specifically for whatever fonts are available in that font family, but mathspec/fontspec are generic font packages that try to do "the right thing" whatever font you name, so it's not unexpected if they end up looking for italic or bold fonts that do not exist and using some sensible defaults in that case, if you name a "main font" the package will try to set up all the standard variants bold, italic etc – David Carlisle Mar 2 '18 at 20:43
• So if I want to use Euler math font with mathspec, I should just arrange with these warnings in the log? – John Dorian Mar 2 '18 at 20:46
• FYI “font shape” like TU/NeoEuler(0)/m/it corresponds to <encoding>/<family>/<series>/<shape> (per this answer, or see texdoc fntguide). In this case, it's saying that it (italics) was substituted with n (normal, i.e. upright/roman). Whether the italics are needed here I don't know. :-) – ShreevatsaR Mar 2 '18 at 20:47

You want to declare that the italic font is the upright (and only) one.

\documentclass{article}

\usepackage{mathspec}
\setmathsfont(Latin)[
ItalicFont=*
]{Neo Euler}

\begin{document}
$$A$$
\end{document}


Here's the console output:

This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./euler.tex
LaTeX2e <2017-04-15>
Babel <3.18> and hyphenation patterns for 84 language(s) loaded.
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2017/texmf-dist/tex/xelatex/mathspec/mathspec.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2017/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2017/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/local/texlive/2017/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2017/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def)))
(/usr/local/texlive/2017/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/tuenc.def))
(/usr/local/texlive/2017/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/local/texlive/2017/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2017/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2017/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/local/texlive/2017/texmf-dist/tex/generic/xkeyval/keyval.tex)))))
(./euler.aux) [1] (./euler.aux) )
Output written on euler.pdf (1 page).
Transcript written on euler.log.