Skip to content Skip to sidebar Skip to footer

Bengali Words Printing Out All Wrong In Manim

I had been trying to animate bengali characters using Manim. I used this method to use pc fonts in Manim. Everything seemed to be working well until i saw the output. For instance,

Solution 1:

This is because of font type. You should use bangli font. Try any font from here

Solution 2:

Try to use ANSI Bangla fonts like "SutonnyMJ". If you are using Avro keyboard you can use Output as ANSI option like this, Avro Keyboard Output as ANSI

Then if you have chosen font for example "SutonnyMJ", your code should look like this,

class test_3(Scene):
    def construct(self):
        text1 = Text('evsjv †jKAv', font='SutonnyMJ')       
        text2 = Text('english text', font='Arial').move_to(DOWN)
        self.play(Write(text1), Write(text2))
        self.wait()

Here I've replaced বাংলা লেখা with evsjv †jKAv (just ANSI form of the same Unicode text) which will render বাংলা লেখা as the font is now ANSI. I hope that Manim will support unicode fonts soon.


EDIT


I've found Bengali Unicode fonts to be working on Manim now. (24 March, 2021). I did this with Kalpurush font.

The code is

class FirstScene(Scene):
    def construct(self):
        text = Text("বাংলা অক্ষরে লেখা", font="Kalpurush")
        text2 = Text("Another text")
        self.play(Write(text), run_time=1)
        self.wait(3)
        self.remove(text)
        self.play(Write(text2))

See the screenshot below, Screenshot

Post a Comment for "Bengali Words Printing Out All Wrong In Manim"