A community-maintained Python framework for creating mathematical animations.
Remove a unnecessary function
Naveen93ae9590c2be
diff --git a/example_scenes/pangoText.py b/example_scenes/pangoText.pyindex d257af0cf..ed3989a7a 100644--- a/example_scenes/pangoText.py+++ b/example_scenes/pangoText.py@@ -5,21 +5,30 @@ class PangoRendering(Scene):CONFIG = {"font": "sans-serif"}def construct(self):- text = PangoText("見 角 言 谷 辛 辰 辵 邑 酉 釆 里!")- self.play(Write(text))+ morning = PangoText("வணக்கம்",font="sans-serif")+ self.play(Write(morning))+ self.wait(3)+ self.clear()+ chin = PangoText("見 角 言 谷 辛 辰 辵 邑 酉 釆 里!")+ self.play(Write(chin))self.wait(2)- mess = PangoText("Multi-Language", style=ITALIC)- self.play(Transform(text, mess))+ mess = PangoText("Multi-Language", style=BOLD)+ self.play(Transform(chin, mess))self.wait(2)self.clear()- russ = PangoText("Здравствуйте मस नम म ")+ russ = PangoText("Здравствуйте मस नम म ",font="sans-serif")self.play(Write(russ))self.wait(2)self.clear()- hin = PangoText("नमस्ते")+ hin = PangoText("नमस्ते",font="sans-serif")self.play(Write(hin))self.wait(2)self.clear()- arb = PangoText("السَّلام عليكُم",font="sans-serif")+ arb = PangoText("صباح الخير ",font="sans-serif")+ self.play(Write(arb))+ self.wait(3)+ self.clear()+ arb = PangoText("صباح الخير \n تشرفت بمقابلتك",font="sans-serif") # don't mix RTL and LTR languages nothing shows up then ;-)self.play(Write(arb))- self.wait(3)\ No newline at end of file+ self.wait(3)+ self.clear()diff --git a/manim/mobject/svg/text_mobject.py b/manim/mobject/svg/text_mobject.pyindex 19483475f..11099f851 100644--- a/manim/mobject/svg/text_mobject.py+++ b/manim/mobject/svg/text_mobject.py@@ -634,7 +634,6 @@ class PangoText(SVGMobject):self.remove_last_M(file_name)SVGMobject.__init__(self, file_name, **config)self.text = text- self.submobjects = [*self.gen_chars()]self.chars = VGroup(*self.submobjects)self.text = text_without_tabs.replace(" ", "").replace("\n", "")nppc = self.n_points_per_cubic_curve@@ -664,40 +663,6 @@ class PangoText(SVGMobject):if self.height is None and self.width is None:self.scale(TEXT_MOB_SCALE_FACTOR)- def gen_chars(self):- chars = VGroup()- submobjects_char_index = 0- for char_index in range(self.text.__len__()):- if self.text[char_index] in [" ", "\t", "\n"]:- space = Dot(redius=0, fill_opacity=0, stroke_opacity=0)- if char_index == 0:- try:- space.move_to(- self.submobjects[submobjects_char_index].get_center()- )- except IndexError as e:- logger.error(e)- # cause a IndexError error because pango generates a empty path which is not condidered as an mobject.- # Doesn't hurt to pass like this.- pass- else:- try:- space.move_to(- self.submobjects[submobjects_char_index - 1].get_center()- )- except IndexError as e: # same as above- logger.error(e)- pass- chars.add(space)- else:- try:- chars.add(self.submobjects[submobjects_char_index])- except IndexError as e: # same as above- logger.error(e)- pass- submobjects_char_index += 1- return chars-def remove_last_M(self, file_name):with open(file_name, "r") as fpr:content = fpr.read()