Pythonは文字を画像に変換


あまり話さないで直接コードをつける
#       
import pygame
import os

pygame.init()  #     

B = '      " " " " " "'         #    B        

text = u"{0}".format(B)           #                 

#         
font = pygame.font.Font(os.path.join("/Users/akun/Library/Fonts", "msyh.ttf"), 26)
#       
rtext = font.render(text, True, (0, 0, 0), (255 ,255 ,255))

#       
pygame.image.save(rtext, "p.png")