Repository: ManimCommunity/manim
File: manim/mobject/svg/code_mobject.py (Python)

Code before:
        for i in line_numbers:
            i.set_color(self.default_color)
        return line_numbers

    def gen_colored_lines(self):
        """Function to generate code.

        Returns
        -------
        :class:`~.Paragraph`
            The generated code according to parameters.
        """
        lines_text = []
        for line_no in range(0, self.code_json.__len__()):
            line_str = ""
            for word_index in range(self.code_json[line_no].__len__()):
                line_str = line_str + self.code_json[line_no][word_index][0]
            lines_text.append(self.tab_spaces[line_no] * "\t" + line_str)
        code = Paragraph(
            *list(lines_text),
            line_spacing=self.line_spacing,
            stroke_width=self.stroke_width,
        ).scale(self.scale_factor)
        for line_no in range(code.__len__()):
            line = code.chars[line_no]
            line_char_index = self.tab_spaces[line_no]
            for word_index in range(self.code_json[line_no].__len__()):
                line[
                    line_char_index : line_char_index
                    + self.code_json[line_no][word_index][0].__len__()
                ].set_color(self.code_json[line_no][word_index][1])
                line_char_index += self.code_json[line_no][word_index][0].__len__()
        return code

    def gen_html_string(self):
        """Function to generate html string with code highlighted and stores in variable html_string."""
        self.html_string = hilite_me(
            self.code_string,
            self.language,
            self.style,
            self.insert_line_no,
            "border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;",
            self.file_path,
            self.line_no_from,
        )

        if self.generate_html_file:
            os.makedirs(
                os.path.join("assets", "codes", "generated_html_files"), exist_ok=True
            )
            file = open(

Review comment (suggestion):
`font` and `disable_ligatures` seem to be *intended* arguments that forward to the internal `Text` that's used for `Paragraph`, but the issue is those arguments are also forwarded to `VGroup`. I'd probably suggest adding a `text_config` argument to `Paragraph` to properly separate these things, or maybe they could just not be forwarded to `VGroup`? Not sure, but I'd err on the side of the former.

Similar thoughts for in `gen_line_numbers`

Code after:
            stroke_width=self.stroke_width,
        ).scale(self.scale_factor)
        for i in line_numbers:
            i.set_color(self.default_color)
        return line_numbers

    def gen_colored_lines(self):
        """Function to generate code.

        Returns
        -------
        :class:`~.Paragraph`
            The generated code according to parameters.
        """
        lines_text = []
        for line_no in range(0, self.code_json.__len__()):
            line_str = ""
            for word_index in range(self.code_json[line_no].__len__()):
                line_str = line_str + self.code_json[line_no][word_index][0]
            lines_text.append(self.tab_spaces[line_no] * "\t" + line_str)
        code = Paragraph(
            *list(lines_text),
            line_spacing=self.line_spacing,
            tab_width=self.tab_width,
            font=self.font,
            disable_ligatures=True,
            stroke_width=self.stroke_width,
        ).scale(self.scale_factor)
        for line_no in range(code.__len__()):
            line = code.chars[line_no]
            line_char_index = self.tab_spaces[line_no]
            for word_index in range(self.code_json[line_no].__len__()):
                line[
                    line_char_index : line_char_index
                    + self.code_json[line_no][word_index][0].__len__()
                ].set_color(self.code_json[line_no][word_index][1])
                line_char_index += self.code_json[line_no][word_index][0].__len__()
        return code

    def gen_html_string(self):
        """Function to generate html string with code highlighted and stores in variable html_string."""
        self.html_string = hilite_me(
            self.code_string,
            self.language,
            self.style,
            self.insert_line_no,
            "border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;",
            self.file_path,
            self.line_no_from,
        )