Bonjour, thisi is mentioned somewhere in the documentation. The problem is that the mapping is applied just before the text is output. However, category of ~ is set to 13, which means that the character is active. Thus first the active character is expanded to the nonbreakable space and only then the mapping is applied. It is therefore necessary to deactivate the character by setting \catcode`\~=12.
Zdeněk Wagner http://ttsm.icpf.cas.cz/team/wagner.shtml http://icebearsoft.euweb.cz čt 12. 11. 2020 v 11:29 odesílatel François Patte <francois.pa...@mi.parisdescartes.fr> napsal: > > Bonjour, > > Using the velthuis tranliteration scheme to type devanagari texts, I > recently came accross some problem with ~n to produce ञ glyph. > > In tabular like environment, the ~ returns to its non -break space > status and ~n is rendered as न > > Here is a MWE: > <---------------------------------------- > \documentclass[a4paper,twoside,11pt]{report} > > \usepackage{fontspec} > > \setmainfont{FreeSerif}[% > Script=Default,% > Mapping=tex-text,% > Fractions=On,% > Numbers=OldStyle,% > ] > > \newfontfamily{\sanskritdev}{% > FreeSerif} > > \newenvironment{deva}{% > \catcode`\~=12% > \sanskritdev% > \addfontfeature{% > Mapping=velthuis-sanskrit,% > Scale=MatchLowercase, > }% > }% > {\catcode`\~=13} > > \usepackage{stackengine} > > \begin{document} > > \newcommand{\vaq}[2]{% > \begin{tabular}{@{\,}c@{\,}} > #1\\ > {\deva #2} > \end{tabular}% > } > > \newcommand{\vak}[2]{% > \stackon{#1}{\deva #2}% > } > > {\deva ~na} > > \vaq{2}{~na} > > \vak{3}{~na} > > \end{document} > <------------------------------------------- > > -- > 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)6 7892 5822 > http://www.math-info.univ-paris5.fr/~patte > FSF > https://www.fsf.org/blogs/community/presenting-shoetool-happy-holidays-from-the-fsf