0👍
✅
For people interested in the solution, refer to this post.
Edit : It has been merged to master now, enjoy !
1👍
Example can be found into the test in Pillow repository:
from PIL import ImageFont
from io import BytesIO
def _font_as_bytes():
with open(FONT_PATH, 'rb') as f:
font_bytes = BytesIO(f.read())
return font_bytes
ImageFont.truetype(_font_as_bytes(), FONT_SIZE)
And see also: How do I open an image from the internet in PIL?
Source:stackexchange.com