Saturday, June 17, 2017

Expanded Devanāgarī font comparison

In 2012 I posted a comparison of some Devanāgarī fonts that were around at the time.


Here's an update, with some more fonts and more concise TeX code:

\documentclass{article}
\usepackage{polyglossia}
\defaultfontfeatures{Script=Devanagari,Language=Sanskrit}
\newfontfamily\eng{TeX Gyre Pagella}

% set up a font, print its name, and typeset the test text:
\newcommand{\FontTrial}[1]{ %
    \setmainfont[Mapping=RomDev]{#1}
    \renewfontfamily\eng{#1}
    % print the font name:
    {\eng #1} \TestText }

\newcommand{\TestText}{ = शक्ति, kārtsnyam ṣaṭtriṃśad;
{\addfontfeatures{Language=Hindi} Hindī =
        शक्ति कार्त्स्न्यम्}\par}

\begin{document}

\FontTrial{FreeSerif}
\FontTrial{FreeSans}
\FontTrial{Sanskrit 2003}

\setmainfont[FakeStretch=1.08,Mapping=RomDev]{Sanskrit 2003}
\renewfontfamily\eng[FakeStretch=1.08,Language=English]{Sanskrit 2003}
{\eng Sanskrit 2003+} \TestText

\FontTrial{Nakula}
\FontTrial{Sahadeva}
\FontTrial{Murty Hindi}
\FontTrial{Murty Sanskrit}
\FontTrial{Shobhika}
% ... etcetera

\end{document}

Output:


Lessons learned:
  • Only Sanskrit 2003, Murty Sanskrit, Chandas, Uttara, Siddhanta, and Shobhika do a full conjunct consonant in ṣaṭtriṃśad.  The others fake it with a virāma.
  • Akshar Unicode's "prasanna" has a lazy horizontal conjunct.
  • Free Sans and Free Serif are the only fonts that distinguish Sanskrit and Hindi (see kārtsnyam).
  • Nakula, Sahadeva, Murty Hindi, Shobhika, Annapurna, Akshar Unicode, Kalimati, and Santipur do a lazy, horizontal conjunct consonant in kārtsnyam.
  • There's a special issue affecting FreeSans and FreeSerif.  I described this in a post in 2012.  The publicly distributed version of the fonts fails to make some important conjunct consonants, like त्रि and प्र correctly.  Unfortunately this issue has not changed in the intervening five years. The examples shown here use a fresh compilation of the fonts, based on downloading and compiling the development version at the Savannah repository (June 2017).  (Here's a link to my compiled fonts.)  This Savannah development version works better for  Devanagari, but has problems elsewhere, according to their author Stevan White.