2

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}
  • 4
    Noto Sans Bengali does not contain the Latin alphabet. – Thérèse Jun 20 at 3:11
  • 1
    @Thérèse, you're right! Post it as an answer. – Emon Haque Jun 20 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 at 7:03
  • 2
    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 at 12:41
  • 1
    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 at 15:04
6

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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.