from manim import *
FONT = "STLiti"
L1 = "第一行：内容中等内容中等"
L2 = "第二行：内容短"
L3 = "第三行：内容较长内容较长内容较长"
class Demo(Scene):
    def construct(self):
        head = Text("居中对齐：", font=FONT, font_size=36, color=RED).to_corner(UL, buff=0.6)
        bar = Line(LEFT * 6.6, RIGHT * 6.6, color=BLUE).next_to(head, DOWN, buff=0.12)
        self.play(FadeIn(head), Create(bar), run_time=0.8)
        paras = [Paragraph(L1, L2, L3, alignment=a, font=FONT, font_size=34).move_to(DOWN * 0.8)
                 for a in ("left", "right", "center")]
        self.play(FadeIn(paras[0]), run_time=0.8)
        self.play(FadeOut(paras[0]), FadeIn(paras[1]), run_time=0.9)
        self.play(FadeOut(paras[1]), FadeIn(paras[2]), run_time=0.9)
        self.wait(2.2)
