Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

Allow default ImageDraw font to be set

Open radarhere opened this issue 3 years ago • 1 comments

Resolves #6480

By raising ImageDraw.ImageDraw.font from an instance variable to a class variable, a default ImageDraw font can be set by the user.

from PIL import ImageDraw, ImageFont
ImageDraw.ImageDraw.font = ImageFont.truetype("Tests/fonts/FreeMono.ttf", 120)

From then on, ImageDraw operations would use that font as the default, instead of the ImageFont.load_default() font.

radarhere avatar Aug 06 '22 07:08 radarhere

Ok, done

radarhere avatar Aug 11 '22 02:08 radarhere