fontspec error (cannot resolve fontname of NewComputerModern)

Robert Alessi alessi at robertalessi.net
Sat May 22 12:25:29 CEST 2021


On Sat, May 22, 2021 at 12:19:58PM +0200, Robert Alessi wrote:
> On Sat, May 22, 2021 at 11:21:38AM +0200, Herbert Voss wrote:
> > > One gets no italic or oblique sans serif.  The only way is to specify
> > > everything as in fspdefault.sty...
> > 
> > use the file names:
> > 
> > \documentclass{article}
> > \usepackage{fontspec}
> > \setmainfont{NewCM10}[
> >   Extension      = .otf,
> >   UprightFont    = *-Regular,
> >   BoldFont       = *-Bold,
> >   ItalicFont     = *-Italic,
> >   BoldItalicFont = *-BoldItalic ]
> > \setsansfont{NewCMSans10}[
> >   Extension      = .otf,
> >   UprightFont    = *-Regular,
> >   BoldFont       = *-Bold,
> >   ItalicFont     = *-Oblique,
> >   BoldItalicFont = *-BoldOblique ]
> > 
> > \begin{document}
> > Hello. \textsf{Hello, \emph{hello}.}
> > \end{document}
> 
> I was using \babelfont, but how did I not think of this before?
> 
> Thank you!
> 
> Robert

Not to mention that

\babelfont{sf}[
  Extension      = .otf,
  UprightFont    = *-Regular,
  BoldFont       = *-Bold,
  ItalicFont     = *-Italic,
  BoldItalicFont = *-BoldItalic ]{NewCM10}
\babelfont{tt}[
  Extension      = .otf,
  UprightFont    = *-Regular,
  BoldFont       = *-Bold,
  ItalicFont     = *-Oblique,
  BoldItalicFont = *-BoldOblique ]{NewCMSans10}

works too, which I did not know.

Thanks again,

Robert

> > Herbert


More information about the tex-live mailing list.