2

I use XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012/W32TeX) on Windows 8. I am experimenting with three Devanagari fonts which come bundled with Windows 8: Arial Unicode MS, Mangal, and Nirmala UI.

I find that XeTeX cannot correctly render Devanagari conjuncts which end with the consonant र for Mangal and Nirmala UI, although it can do so for Arial Unicode MS. Below MWE is for four conjuncts (प्र, क्र, त्र, and ह्र).

The code

\documentclass{article}
\usepackage{polyglossia}
\usepackage{fontenc}
\usepackage[top=1.25in,bottom=0.75in,left=0.75in,right=0.75in]{geometry}
\setmainfont{Arial}
\newfontfamily\devfontone[Script=Devanagari]{Arial Unicode MS}
\newfontfamily\devfonttwo[Script=Devanagari]{Mangal}
\newfontfamily\devfontthree[Script=Devanagari]{Nirmala UI}
\begin{document}
\fontsize{16}{24}\selectfont
\section{Arial Unicode MS}
\noindent {\devfontone प्र क्र त्र ह्र}
\section{Mangal}
\fontsize{14}{21}\selectfont
\noindent {\devfonttwo प्र क्र त्र ह्र}
\section{Nirmala UI}
\fontsize{14}{21}\selectfont
\noindent {\devfontthree प्र क्र त्र ह्र}
\end{document}

The output

XeTeX output

All three fonts work fine in MS Word, as shown in the snapshot below

Word output

Could this be a problem with the XeTeX version? Or with the font GSUB tables? I have not tried the latest TexLive distribution.

A complete list of attested conjuncts in Sanskrit is available here, out of which those ending in the consonant र are 112 in number: क्स्त्र ङ्क्त्र त्स्त्र त्स्प्र न्त्स्र न्स्त्र र्त्त्र क्क्र क्त्र क्प्र क्श्र क्ष्र क्स्र ग्ग्र ग्घ्र ग्द्र ग्ध्र ग्ब्र ग्भ्र ग्व्र ङ्क्र ङ्ग्र ङ्घ्र ङ्त्र ङ्न्र ङ्प्र ङ्व्र च्छ्र ञ्छ्र ञ्श्र ट्क्र ट्त्र ट्प्र ट्श्र ड्ग्र ड्घ्र ड्ब्र ड्भ्र ण्ड्र ण्ढ्र त्क्र त्त्र त्प्र त्स्र द्ग्र द्घ्र द्द्र द्ध्र द्ब्र द्भ्र द्व्र ध्व्र न्क्र न्ग्र न्घ्र न्त्र न्द्र न्ध्र न्प्र न्ब्र न्भ्र न्म्र न्व्र न्स्र न्ह्र प्त्र प्प्र ब्ग्र ब्ब्र म्प्र म्ब्र म्भ्र म्म्र र्ग्र र्घ्र र्त्र र्द्र र्ध्र र्ब्र र्भ्र र्म्र र्व्र र्स्र र्ह्र ष्क्र ष्ट्र ष्प्र स्क्र स्त्र स्प्र क्र ग्र घ्र ङ्र च्र ज्र ड्र ढ्र त्र थ्र द्र ध्र न्र प्र ब्र भ्र म्र व्र श्र ष्र स्र ह्र.

Edit 1 on 20151128 0600 IST

Confirmed that the code above produces the output shown in the first image when compiled in Texworks with XeLaTeX option on XeTeX engine Version 3.1415926-2.4-0.9998 (TeX Live 2012/W32TeX) for Windows 8. The below image shows this. Even on not including fontenc, the output is the same.

NirmalaUIsnapshot

Edit 2 on 20151128 1140 IST

Updated my TeX distribution this morning to TeX Live 2015 and now I am using XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015/W32TeX). The problem with Mangal font is fixed now, the problem remains with Nirmala UI though. I do not know why even though all three fonts are from Microsoft, there is some difference in either their GSUB tables or their encodings.

NirmalaUIsnapshot2

  • You are using a very old version of TeX Live. Packages such as polyglossia and fontspec have undergone much development as has LuaTeX, at least. If you are happy to stick to the older engines and packages, staying with 2012 is likely fine. But if not, it cannot be recommended. That aside, I don't believe that you tested the code you've posted or that, if you did, it produced the output you show. The code you've posted will certainly not compile on any version of TeX Live without changes. Please test before you post! – cfr Nov 27 '15 at 4:36
  • I am sure I tested and compiled the code and the output shown in the first image is from the code compiled in XeLaTeX. The second image is from MS Word. Did you mistake the second image to be the output of the code? – user22209 Nov 27 '15 at 9:20
  • No, I think I'm just forgetting that polyglossia loads fontspec. But loading fontenc is still not something to do unless you know exactly why you need to do it. In any case, you should try updating. Or maybe wait for somebody who can test, if you prefer. Actually, is the problem font specific? If you can reproduce with a generally available font, the issue will probably get more attention. Right now, lots of people (including me) simply can't even try to reproduce the problem. So we can't say whether an update might help - only that there is a good chance and recommended. – cfr Nov 27 '15 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.