3

In some Open-type fonts there are some stylistic sets are available, which help to select the glyph-set which may be appropriate to particular language. For Marathi, the language I want to use, some glyph-shapes e. g. श, ल, ५, ८ are written, visually different from that of Hindi, which also uses Devanagari Script.

Along with that there are two styles of writing some conjuncts. Some are written vertically and some are written horizontally eg. क्क, ल्ल, प्ल. Many fonts include both the alternative glyph styles, which can be selected in LaTeX by the StyleSet feature, while selecting a font.

In my case I have selected two Devanagari fonts, both include the alternate glyph-shapes mentioned above. But I could use them with one font i. e. Mukta, But could not use them with another font i. e. Noto Serif Devanagari. I have confirmed that both fonts have the above said alternatives, by opening the fonts in FontForge.

Please guide me how to use these alternate glyph-shapes available in Noto Serif Devanagari. The LaTeX code, I have used, is given bellow. I have run it using xelatex engine.

 \documentclass[a4paper,10pt]{article}
 \usepackage{fontspec}
 \usepackage{xltxtra}
 \usepackage{polyglossia}
 \setdefaultlanguage{marathi}
 \setmainfont{Mukta}[Script=Devanagari, Mapping=devanagarinumerals]
 % ===== Font Selection =====
 % Mukta (https://github.com/EkType/Mukta/tree/master/Mukta-Devanagari) 
 \newfontfamily\Muktaone[Script=Devanagari,Mapping=devanagarinumerals, StylisticSet=1]{Mukta}
 \newfontfamily\Muktatwo[Script=Devanagari,Mapping=devanagarinumerals,StylisticSet=2]{Mukta}
% Noto Serif Devanagari (https://www.google.com/get/noto/#serif-deva)
 \newfontfamily\NSDone[Script=Devanagari,Mapping=devanagarinumerals,StylisticSet=1]{Noto Serif Devanagari}
 \newfontfamily\NSDtwo[Script=Devanagari,Mapping=devanagarinumerals,StylisticSet=2]{Noto Serif Devanagari}

\begin{document}

\section*{Mukta}
\begin{description}
\item [StylisticSet1]{\Muktaone ५, ८, श, ल, क्क, ल्ल, प्ल}
\item [StylisticSet2]{\Muktatwo ५, ८, श, ल, क्क, ल्ल, प्ल}
\end{description}

\section*{Noto Serif Devanagari}
\begin{description}
\item [StylisticSet1]{\NSDone ५, ८, श, ल, क्क, ल्ल, प्ल}
\item [StylisticSet2]{\NSDtwo ५, ८, श, ल, क्क, ल्ल, प्ल}
\end{description}

\end{document}

Output is shown bellow

enter image description here

5
  • In your example both Noto font families select stylistic set 1. Commented Sep 30, 2017 at 12:18
  • Sorry! I have edited and corrected the code.
    – Sushant
    Commented Sep 30, 2017 at 12:31
  • 1
    Noto Serif Devanagari does not seem to have the stylistic variants — I tried otfinfo -f and also some other things (see the section on Calibri in this answer). What did you see in Fontforge that makes you think it does? Commented Sep 30, 2017 at 16:54
  • Noto Serif Devanagari does have stylistic variants. e. g. It has 2 different glyphs for the character श i. e. for Unicode character U+0936. The glyph names are dvSHA and dvSHA.MAR.
    – Sushant
    Commented Sep 30, 2017 at 18:03
  • It has those particular glyphs, but they are not encoded as OpenType "stylistic variant" font features (like ss01, ss02). I don't see variant glyphs for the others (conjuncts etc.) either. Commented Sep 30, 2017 at 18:24

1 Answer 1

6

Right-click on U+0936 and look at the “Substitutions” tab of the “Glyph Info” in FontForge; it tells you that the forms you want are controlled by localization, not by stylistic sets:

\documentclass{article}
\usepackage{fontspec,polyglossia}
\setdefaultlanguage{Sanskrit}% https://tex.stackexchange.com/a/382981
\setmainfont{NotoSerifDevanagari-Regular.ttf}[Script=Devanagari,Mapping=devanagarinumerals]
\newfontfamily\NSDone[Script=Devanagari,Mapping=devanagarinumerals]{NotoSerifDevanagari-Regular.ttf}
\newfontfamily\NSDtwo[Script=Devanagari,Language=Marathi,Mapping=devanagarinumerals]{NotoSerifDevanagari-Regular.ttf}% note the addition of Language=Marathi
\begin{document}
{\NSDone ५, ८, श, ल, क्क, ल्ल, प्ल}

\bigskip

{\NSDtwo ५, ८, श, ल, क्क, ल्ल, प्ल}
\end{document}

output

2
  • I have encountered an other difficulty. I have used the same code with different font namely Kadwa (github.com/huertatipografica/Kadwa/tree/master/…). It contents the glyphs (uni0932094D0932.loclMAR and uni0932094D0932.loclMAR) which is localized variants for ल्ल and ल्प respectively. Now with the code I could got local variants for श and ल, but even though the localized variants for ल्ल and ल्प have same language code mentioned, the are not rendered properly.
    – Sushant
    Commented Oct 1, 2017 at 6:46
  • The new question is here BTW. Commented Oct 2, 2017 at 9:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .