def gen_complex_text_img(self, char_obj_list: List[CharImg], font_path, orientation=TYPE_ORIENTATION_HORIZONTAL, align_mode=TYPE_ALIGN_MODEL_C): """ 生成复杂的文本图片 :param char_obj_list: :param font_path: :param orientation: :param align_mode: :return: """ text_img = create(char_obj_list=char_obj_list, orientation=orientation, align_mode=align_mode, font_path=font_path, text_img_output_dir=self.text_img_output_dir, text_img_info_output_dir=self.text_img_info_output_dir) return text_img
def gen_text_img(self, text: str, font_path, color=const.COLOR_BLACK, font_size=14, border_width=0, border_color=const.COLOR_TRANSPARENT, orientation=TYPE_ORIENTATION_HORIZONTAL, padding=(0, 0, 0, 0), align_mode=TYPE_ALIGN_MODEL_C, auto_padding_to_ratio=0.0): char_obj_list = gen_batch_char_obj(text=text, color=color, font_size=font_size, border_width=border_width, border_color=border_color) text_img = create(char_obj_list=char_obj_list, orientation=orientation, align_mode=align_mode, padding=padding, auto_padding_to_ratio=auto_padding_to_ratio, font_path=font_path, text_img_output_dir=self.text_img_output_dir, text_img_info_output_dir=self.text_img_info_output_dir) return text_img