[XeTeX] Beginner Devanagari question

Jonathan Kew jonathan_kew at sil.org
Mon May 12 22:01:03 CEST 2008


On 12 May 2008, at 8:20 pm, Tobi Kellner wrote:

> Hello,
>
> I hope you had peaceful and relaxing Pentecost holidays!!
>
> I'm
> jumping in at the deep end, starting with LaTex and XeLaTex all at the
> same time, for my M.Sc. thesis in Computational Linguistics (on  
> machine
> transliteration).
>
> The text will be mostly in English, with a few Hindi, Arabic and  
> Katakana (Japanese) examples sprinkled around.
>
> I enter/copy my Hindi/Arabic/Katakana directly, so I am not  
> interested in Romanized/transliterated input.
>
> I'm trying to create a simple "नमस्ते World" document,  
> i.e. an example for Devanagari and English in the same text.
>
> However, while "नमस्ते" (namaste) renders correctly in  
> every piece of (Unicode-ready) software on my Windows XP system,  
> including my TexMaker editor, the XeLaTex output PDF gets the
> s-t ligature wrong - I get a full s, with the halant(??)-line at the
> bottom, and a full t (excuse my lack of terminology!).
>
> My XeLaTex code is
>
> \documentclass{article}
> \usepackage{fontspec}
> \begin{document}
> \newfontinstance{\devfont}{Mangal}
> \newenvironment{hindi}{\devfont}{}
> \begin{hindi}नमस्ते   \end{hindi} World!
> \end{document}
>
> I would be extremely grateful if anyone could tell me what I'm  
> doing wrong!

You need to provide the [Script=Devanagari] option for your  
\newfontinstance command, to activate the proper OpenType script  
behavior:

	\newfontinstance{\devfont}[Script=Devanagari]{Mangal}

See the fontspec documentation for more information....

(Actually, \newfontfamily is now the preferred name for this command,  
or \newfontface for a single typeface rather than a family that may  
include Bold and Italic styles as well.)

HTH,

JK



More information about the XeTeX mailing list