Using fonts in PIL without freetype

人盡茶涼 提交于 2019-12-01 21:11:27
Gareth Rees

If you read the manual for the ImageFont module you'll see that the Python Imaging Library supports the PILFont format for bitmap fonts.

So on your own computer, render your TrueType font, at the size you want, save the bitmap in the PILFont format, and then use the PILFont on the server. You can do this using otf2bdf to convert the TrueType font to BDF (Bitmap Distribution Format), and then PIL's pilfont utility to convert BDF to PILFont. See this question and its answers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!