Not so much
--Check the location of the font file
$ fc-match -f "%{file}\n" FreeMono
/System/Library/Fonts/Hiragino Maru Go ProN W4.ttc
--Make an image
from PIL import Image, ImageDraw, ImageFont
font = ImageFont.truetype("/System/Library/Fonts/Hiragino Maru Go ProN W4.ttc", size=60)
def make_image(n):
im = Image.new("RGB",(300,100),"blue")
draw = ImageDraw.Draw(im)#Create an ImageDraw instance on im
draw.text((10,20), f"Free description field{n}", font=font)
im.save(f"./freetext{n}.jpg ")
for i in range(0,50):
make_image(i)
--If you want to display it on jupyter notebook
from IPython.display import Image, display_png
display_png(Image('./name1.jpg'))
Recommended Posts