latex3 / luaotfload

OpenType font loader for LuaTeX
Other
60 stars 7 forks source link

Devanagari output is not satisfactory #9

Closed u-fischer closed 6 years ago

u-fischer commented 6 years ago

The output of devanagari is not good and should be improved. As can be seen in the examples below the problem is not with the generic fontloader -- its output is like the one in context (which is not completly identical to xetex but looks quite good). I suspect that the problem is in luaotfload-features, which duplicates parts of font-ott but hasn't been updated/synched for quite some time. Another possibility is missing character data due to the stripped down luaotfload-characters.lua.

LaTeX example

\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage[english]{babel}
\newfontfamily\deva[Script=Devanagari]{NotoSansDevanagari-Regular.ttf}
\begin{document}

\begin{quotation}\deva
कर्मण्येवाधिकारस्ते मा फलेषु कदाचन।\\
मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि॥ २-४७
\end{quotation}
\end{document}

xelatex output

xetex-noto-sanskrit

lualatex output

lualatex-noto-sanskrit

plain with all the features context uses:

\input luaotfload.sty
\font\deva={file:NotoSansDevanagari-Regular.ttf:mode=node;%
   language=dflt;script=deva;%
   +mark;+mkmk;+curs;+liga;+locl;+kern;+dist;%
   +abvm;+blwm;+nukt;+akhn;%
   +rphf;%
   +pres;%
   +abvs;%
   +blws;+psts;+haln;+calt;+rkrf;+blwf;+half;+vatu;+cjct;%
   }

    \deva कर्मण्येवाधिकारस्ते मा फलेषु कदाचन।

मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि॥ २-४७

\bye

plain-bad-noto

context example

\definefont [Deva][file:NotoSansDevanagari-Regular.ttf*devanagari-one]
\starttext
    \Deva कर्मण्येवाधिकारस्ते मा फलेषु कदाचन।\crlf
मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि॥ २-४७
\stoptext

context-noto-sanskript

example with the generic / plain fontloader (format plainfontloader in the dev branch)

\font\deva={file:NotoSansDevanagari-Regular.ttf:mode=node;%
   language=dflt;script=deva;%
   +mark;+mkmk;+curs;+liga;+locl;+kern;+dist;%
   +abvm;+blwm;+nukt;+akhn;%
   +rphf;%
   +pres;%
   +abvs;%
   +blws;+psts;+haln;+calt;+rkrf;+blwf;+half;+vatu;+cjct;%
   }
    \deva कर्मण्येवाधिकारस्ते मा फलेषु कदाचन।

मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि॥ २-४७

\bye

plain-noto

krishnakumarg1984 commented 6 years ago

This was fast. Thank you very much Ulrike.

u-fischer commented 6 years ago

With the new development version this latex examples looks like the context output:

\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage[english]{babel}
\newfontscript{Devanagari}{deva,dev2} %need to force deva! 
\newfontfamily\deva[Script=Devanagari,
    ]{NotoSansDevanagari-Regular.ttf}
\begin{document}

\begin{quotation}\deva
कर्मण्येवाधिकारस्ते मा फलेषु कदाचन।\\
मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि॥ २-४७
\end{quotation}
\end{document}

image

u-fischer commented 6 years ago

Lualatex-output with siddhanta (above example with \newfontfamily\deva[Script=Devanagari]{siddhanta.ttf}) looks identical than the xelatex-output:

image

So the slight glitch above is font dependant. Perhaps Noto is missing a ligature or a variant has the wrong name ...

krishnakumarg1984 commented 6 years ago

Well...I used Siddhanta for my PhD thesis submission on Oct 3, 2018. LuaLaTeX output looked very different then.

krishnakumarg1984 commented 6 years ago

Ok....Commented too early.....sorry. You have updated the font-loader. Yes, looks like the issues with the engine are fixed. It is only the issue with the noto fonts. That Siddhanta is superior is not surprising, since it is an open-type Unicode font with advanced features.

u-fischer commented 6 years ago

@krishnakumarg1984 Yes. The change is currently only in the development branch. You should have asked a week earlier ;-). We can't know that a script is broken if nobody mentions it.

krishnakumarg1984 commented 6 years ago

Hehe...understood. It is only a manuscript for viva examination. The final upload will certainly benefit from this. Thank you for the amazing support.

u-fischer commented 6 years ago

With the newest context version there is a small glitch in the siddhanta output:

\definefont [Deva][file:siddhanta.ttf*devanagari-one]
\starttext
    \Deva कर्मण्येवाधिकारस्ते मा फलेषु कदाचन।\crlf
मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि॥ २-४७
\stoptext

context-glitch

xelatex output:

xelatex-sidd

Edit

By removing the psts feature the output is correct again:

\setmainfont{siddhanta.ttf}[Script=Devanagari,RawFeature=-psts;]

image

u-fischer commented 6 years ago

v 2.92 just uploaded to ctan improves deva and gives the state described here. Closing the issue. New problems should be put in new issues.

krishnakumarg1984 commented 6 years ago

@u-fischer Thank you for the keen interest in this issue. Much appreciate your efforts.