# examples for broken rendering of scripts in lualatex

The code of luaotfload mentions a number of scripts for which the support is incomplete. I would like to check if this is true and what perhaps could be done.

The list of scripts in the code is

 "beng", "guru", "gujr","orya", "taml",
"telu", "knda", "mlym", "sinh".


But as mentioned above answers for other scripts are welcome too.

Devanagari (deva) has been already handled in the development branch, see https://github.com/u-fischer/luaotfload/issues/9

The answer should show an example document like this:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{.....}[Script=....]

\begin{document}
sample text
\end{document}

• Please use if possible a free font of good quality.
• Add a screenshot of the xelatex output. If it is not correct, show a correct output from some other rendering or describe what is wrong.
• Add a screenshot of the lualatex output.
• If you know how to do it you can also add a context example and its rendering.
• If I don't get back to this soon: the examples in section 2.3 under “Rule 1”, “Rule 2”, “Rule 3” here (top web search result for [Indic text layout]) should cover most of the things that are typically broken. Oct 22, 2018 at 11:57
• @ShreevatsaR no need to hurry. I have no time this week anyway. Oct 22, 2018 at 12:05

Here is an example with script Kannada (knda in the above list). The (typical) problematic cases for the other scripts will be similar, just have to pick the corresponding codepoints from the other scripts.

\documentclass{article}
\usepackage{fontspec}

\begin{document}
ಕಿ

ಕ್ರ

ರ್ಕ
\end{document}


The fonts are available from Google Noto Fonts.

Output when compiled with xelatex:

Output when compiled with lualatex:

The three lines of text just say "ki", "kra", and "rka". And I fully expect that when these 3 things work, it is a sign that most other things will work as well.

• It looks as if one can get the correct shapes, but I will have to pass it to context first. See github.com/u-fischer/luaotfload/issues/20 Oct 30, 2018 at 9:06
• @UlrikeFischer Thanks. Actually, after looking at the context output, I have some doubts about the correct output for the last of the three syllables above (will have to look it up, as that syllable occurring entirely by itself is something of an edge case): just to avoid ambiguity, could you add "ಅ" (U+0C85 KANNADA LETTER A) before it, i.e. use "ಅರ್ಕ" ("arka") instead of just "ರ್ಕ" ("rka")? Then there is no doubt at all about what the correct output should be. (Will update this answer eventually...) Sorry for the extra work... Oct 30, 2018 at 17:16

Extending the other answer here are examples for all of the scripts in the question (and deva, which as the question says is already fixed in the development branch, but not yet on my computer). For most of the Indic scripts I combined the failure modes in the other answer into the single word “krarki”, except that for Tamil and Sinhala (where this word actually gets rendered properly) I used something simpler.

Too lazy to create a separate example file for each script and compile and take screenshots, so this is a single combined file.

\documentclass{article}
\usepackage{fontspec}
\newfontfamily\deva[Script=Devanagari]{NotoSansDevanagari-Regular.ttf}
\newfontfamily\beng[Script=Bengali]{NotoSansBengali-Regular.ttf}
\newfontfamily\guru[Script=Gurmukhi]{NotoSansGurmukhi-Regular.ttf}
\newfontfamily\gujr[Script=Gujarati]{NotoSansGujarati-Regular.ttf}
\newfontfamily\orya[Script=Oriya]{NotoSansOriya-Regular.ttf}
\newfontfamily\taml[Script=Tamil]{NotoSansTamil-Regular.ttf}
\newfontfamily\telu[Script=Telugu]{NotoSansTelugu-Regular.ttf}
\newfontfamily\mlym[Script=Malayalam]{NotoSansMalayalam-Regular.ttf}
\newfontfamily\sinh[Script=Sinhala]{NotoSansSinhala-Regular.ttf}

\begin{document}
{\deva क्रर्कि} % krarki
{\beng ক্রর্কি} % krarki
{\guru ਕ੍ਰਰ੍ਕਿ} % krarki
{\gujr ક્રર્કિ} % krarki
{\orya କ୍ରର୍କି} % krarki
{\taml கோ} % ko
{\telu క్రర్కి} % krarki
{\knda ಕ್ರರ್ಕಿ} % krarki
{\mlym ക്രര്കി} % krarki
{\sinh කෙ} % ke
\end{document}


Compiled with xelatex (correct as far as I can tell):

Compiled with lualatex (each one is definitely incorrect):

• I will look at these examples later. But can you at first get the newest luaotfload (2.93 should be in texlive today) and show the output you get with it? Oct 30, 2018 at 9:22
• @UlrikeFischer Will do in a few days; right now using a system with a Debian-installed TeX Live that has only TeX Live 2017. (And tlmgr also doesn't seem to be working properly.) Will install the most current TL sometime. Oct 30, 2018 at 17:22

Here is an example of broken Arabic rendering with Aref Ruqaa font:

\nopagenumbers

\font\ruqaa="Aref Ruqaa:mode=node;script=arab" at 12pt

\pardir TRT
\textdir TRT
\ruqaa
\baselineskip=2.2em

هذا كتاب صغير في بحث جديد، تنبّهنا له ونحن ننشر الطبعة الثانية من كتابنا الفلسفة
اللغوية لأنّ موضوعه تابع لموضوعنا. أو هي خطوة ثانية في تاريخ اللغة باعتبار
منشأها وتكونها ونموها. فالفلسفة اللغوية تبحث في كيف نطق الانسان الأول، وكيف
نشأت اللغة وتولّدت الألفاظ من حكاية الأصوات الخارجية، كقصف الرعد، وهبوب الرياح،
والقطع والكسر، وحكاية التف والنفخ والصفير ونحوها. ومن المقاطع الطبيعية التي
ينطق بها الانسان غريزيا كالتأوه، والزفير. وكيف تنوّعت تلك الأصوات لفظا ومعنى
بالنحت، والابدال، والقلب، حتى صارت ألفاظا مستقلة وتكوّنت الأفعال، والأسماء،
والحروف وصارت اللغة على نحو ما هي عليه.  وأما تاريخ اللغة فيتناول النظر في
ألفاظها وتراكيبها، بعد تمام تكونها، فيبحث فيما طرأ عليهما من التغيير والتجدد أو
الدثور، فيبين الألفاظ والتراكيب التي دثرت من اللغة بالاستعمال، وما قام مقامها
من الألفاظ الجديدة، والتراكيب الجديدة، بما تولّد فيها، أو اقتبسته من سواها، مع
بيان الأحوال التي قضت بدثور القديم وتولد الجديد، وأمثلة مما دثر، أو أهمل، أو
تولّد، أو دخل.

\bye


HarfBuzz:

• Looks wrong in context too (assuming that I used the correct code), so it is probably a problem with the fontloader. Can you sent me the text (only the text) in a file? I don't trust copy&paste when RTL is involved. Nov 15, 2018 at 23:34
• @UlrikeFischer: How do you want me to send you the file? Nov 16, 2018 at 22:26