from manim import *
FONT = "STLiti"
CCODE = '#include <stdio.h>\nint main()\n{\n   printf("Hello, World!");\n   return 0;\n}'
def make_title(en, zh):
    a = Text(en, font="Consolas", font_size=34, color=RED)
    z = Text(zh, font=FONT, font_size=34, color=RED)
    return VGroup(a, z).arrange(RIGHT, buff=0.15).to_corner(UL, buff=0.6)
class Demo(Scene):
    def construct(self):
        head = make_title("C", "代码：")
        bar = Line(LEFT * 6.6, RIGHT * 6.6, color=BLUE).next_to(head, DOWN, buff=0.12)
        code = Code(code_string=CCODE, language="c", formatter_style="vim",
                    paragraph_config={"font": "Consolas", "font_size": 28})
        code.scale(1.15).move_to(DOWN * 0.3)
        self.play(FadeIn(head), Create(bar), run_time=0.8)
        self.play(FadeIn(code), run_time=1.2)
        self.wait(3.6)
