[XeTeX] what is \setmainfont used for?

Zdenek Wagner zdenek.wagner at gmail.com
Fri Feb 10 00:40:00 CET 2017


Which version of fontspec dou you have? On my computer it works fine with
2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTeX


Zdeněk Wagner
http://ttsm.icpf.cas.cz/team/wagner.shtml
http://icebearsoft.euweb.cz

2017-02-10 0:07 GMT+01:00 Ulrike Fischer <news3 at nililand.de>:

> Am Thu, 9 Feb 2017 23:20:51 +0100 schrieb François Patte:
>
> > 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
> >
>
> The problem is that fontspec adds by default "Ligature=TeX". In
> xelatex this is implemented through a mapping and so disables the
> Mapping=velthuis-sanskrit.
>
> This has been already discussed and hopefully Will will correct in
> the near future. In the mean time you can disable the ligature
> mapping:
>
> \documentclass[a4paper,twoside,11pt]{book}
>
> \usepackage{fontspec}
> \usepackage{polyglossia}
> \setdefaultlanguage{sanskrit}
>
> \defaultfontfeatures[\rmfamily,\sffamily]{} %<---
>
> \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}
>
> --
> Ulrike Fischer
> http://www.troubleshooting-tex.de/
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>   http://tug.org/mailman/listinfo/xetex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20170210/39a3bf3c/attachment.html>


More information about the XeTeX mailing list