Pillow: Default font with provided font size?

Created on 23 Aug 2017  路  2Comments  路  Source: python-pillow/Pillow

There are at least two ways to get a font, either loading from default or reading from a file, such as:

from PIL import ImageFont
default_font = ImageFont.load_default()
provided_font = ImageFont.truetype("sans-serif.ttf", 16)

I am wondering if there is any way that I can use the default font with a given font size, such as:

from PIL import ImageFont
default_font = ImageFont.load_default(size=16)

to save myself the trouble of providing a font file while being able to change the font size.

All 2 comments

No, the default font is a bitmapped font with no alternate sizes.

There is still no workaround or anything for this?

It would be nice if Pillow provided a default font that "just works" and you were able to set a font size for it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hxzhao527 picture hxzhao527  路  4Comments

thinrhino picture thinrhino  路  3Comments

mmalenta picture mmalenta  路  3Comments

SysoevDV picture SysoevDV  路  3Comments

vytisb picture vytisb  路  4Comments