Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 19054

Choosing a PIL.ImageFont by font name rather than filename, and cross-platform font

$
0
0

ImageFont.truetype requires a filename to work, such as:

font = ImageFont.truetype("ariblk.ttf")  # Arial Black

Is there a way with PIL, to load a font by name, rather than filename?

Context: I would like to load a bold (with heavy weight) sans-serif font, that would work on any platform Windows, Linux, Mac.

I don't think ImageFont.truetype("ariblk.ttf") will work cross-platform, is it possible to load it with ImageFont.truetype("Arial Black") or, better, ImageFont.truetype("sans-serif;bold") that would work on all platforms?


Viewing all articles
Browse latest Browse all 19054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>