[XeTeX] what is \setmainfont used for?

François Patte francois.patte at mi.parisdescartes.fr
Thu Feb 9 23:20:51 CET 2017


I don't understant how to use \setmainfont. It seems that something has
changed between texlive-2014 and texlive-2016.

If I compile this :

<----------------------------
\documentclass[a4paper,twoside,11pt]{book}

\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{sanskrit}

\setmainfont{%
  FreeSerif%
}%
[%
Mapping=velthuis-sanskrit,%
Script=Devanagari,
]

\begin{document}
  ekaadaya.h eka uttaro v.rddhirye.saa.m te ekottaraa.h
  ekaadaya"scaikottaraa"sca te tathaa eva.mvidhaa vyastaa.h
  apasavyakramasthaapitaa.h a"nkaa.h kramasthitai.h

\end{document}
<--------------------------------

Output is not in devanagari

But if I compile this:

<----------------------------------
\documentclass[a4paper,twoside,11pt]{book}

\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage{sanskrit}

\newfontfamily{\devanagarifont}{FreeSerif}%
[Mapping=velthuis-sanskrit,Script=Devanagari]

\begin{document}
ekaadaya.h eka uttaro v.rddhirye.saa.m te ekottaraa.h
ekaadaya"scaikottaraa"sca te tathaa eva.mvidhaa vyastaa.h
apasavyakramasthaapitaa.h a"nkaa.h kramasthitai.h

\end{document}
<--------------------------------

I get a correct output in devanagari script...

So what is \setmainfont used for?

-- 
François Patte
UFR de mathématiques et informatique
Laboratoire CNRS MAP5, UMR 8145
Université Paris Descartes
45, rue des Saints Pères
F-75270 Paris Cedex 06
Tél. +33 (0)1 8394 5849
http://www.math-info.univ-paris5.fr/~patte

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://tug.org/pipermail/xetex/attachments/20170209/dba5232e/attachment.sig>


More information about the XeTeX mailing list