4

If I use \setmainfont directive in my document, this is what I get instead of british glyphs!

enter image description here

What's the reason of this problem and how to fix it?

\documentclass{article}
\usepackage{harfload, fontspec}
\setmainfont{Noto Sans Bengali}[RawFeature={mode=harf}]

\parindent 0pt
\begin{document}
    বাংলা \textbf{বাংলা}\\
    English
\end{document}
  • 5
    Noto Sans Bengali does not contain the Latin alphabet. – Thérèse Jun 20 '19 at 3:11
  • 1
    @Thérèse, you're right! Post it as an answer. – user189833 Jun 20 '19 at 3:45
  • 1
    but your question is presumably wrong, as it implies that this works in Windows and not in some other operating system. – David Carlisle Jun 20 '19 at 7:03
  • 3
    I can’t answer today — no internet connection except on my phone. But the question title should be edited: KDE has nothing to do with the problem (and the glyphs are Latin). – Thérèse Jun 20 '19 at 12:41
  • 2
    I mean you stated that "On windows 10, we don't have this problem! " but you must have had that problem on windows as well. How is Kalpurush.ttf related? The question is about Noto Sans. – David Carlisle Jun 20 '19 at 15:04
10

Noto Sans Bengali does not contain glyphs for the Latin alphabet.

You may have thought it did if working in a word processor on Windows, because such programs may silently substitute other fonts when glyphs are missing. harftex gives you more control and, in consequence, requires you to say exactly what you want.

Here’s one way to do that:

\documentclass{article}
\usepackage{harfload,fontspec}
\setmainfont{Noto Sans Bengali}[RawFeature={mode=harf}]
\newfontfamily\british{Noto Sans}[Script=Latin]
\parindent 0pt
\begin{document}
বাংলা \textbf{বাংলা}\\
\british English
\end{document}

output

UPDATE

As of November 2019, you can install luahbtex and replace the lines

\usepackage{harfload,fontspec}
\setmainfont{Noto Sans Bengali}[RawFeature={mode=harf}]

with these:

\usepackage{fontspec}
\setmainfont{Noto Sans Bengali}[Renderer=Harfbuzz,Script=Bengali]

See Ulrike Fischer’s explanation for details.

| improve this answer | |

Your Answer

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