code: def get_vertical_text_picture(image_file, chars, fonts_list, cf):
      """
      desc:gen vertical text picture
      """
      img = Image.open(image_file)
      if img.mode != "RGB":
          img = img.convert("RGB")
      img_w, img_h = img.size
      # random choice font
      font_path = random.choice(fonts_list)
      # random choice font size
      font_size = random.randint(cf.font_min_size, cf.font_max_size)
      font = ImageFont.truetype(font_path, font_size)
  
      ch_w = []
      ch_h = []
      for ch in chars:
          left, top, right, bottom = font.getbbox(ch)
          wt, ht = right - left, bottom - top
          ch_w.append(wt)
          ch_h.append(ht)
      f_w = max(ch_w)
      f_h = sum(ch_h)
  
      x1 = random.randint(0, img_w - f_w)
      y1 = random.randint(0, img_h - f_h)
      x2 = x1 + f_w
      y2 = y1 + f_h
  
      crop_y1 = y1
      crop_x1 = x1
      crop_y2 = y2
      crop_x2 = x2
  
      best_color = (0, 0, 0)
      draw = ImageDraw.Draw(img)
      i = 0
      for ch in chars:
          draw.text((x1, y1), ch, best_color, font=font)
          y1 = y1 + ch_h[i]
          i = i + 1
      crop_img = img.crop((crop_x1, crop_y1, crop_x2, crop_y2))
      crop_img = crop_img.transpose(Image.ROTATE_90)
      return crop_img, chars
  
file_path: PaddleOCR/applications/PCB字符识别/gen_data/gen.py
imports: import os
  import random
  from PIL import Image, ImageDraw, ImageFont
  import json
  import argparse
label_desc: Use image node_id 3 for calling a global function with example usage: get_vertical_text_picture(image_file, chars, fonts_list, cf) and returns: crop_img,  chars