font

Functions

get_font([font_file_name, font_size])

Args:

get_readable_font_size(img_size)

Get size of font for image with given sizes :type img_size: Tuple[int, int] :param img_size: size of image :rtype: int :return: size of font

load_font(font_file_name[, font_size])

Set global font true-type for drawing.

Description

get_font(font_file_name=None, font_size=12)[source]
Args:

font_file_name: name of font file (example: ‘DejaVuSansMono.ttf’) font_size: selected font size

Returns:

font for drawing

Return type

FreeTypeFont

get_readable_font_size(img_size)[source]

Get size of font for image with given sizes :type img_size: Tuple[int, int] :param img_size: size of image :rtype: int :return: size of font

load_font(font_file_name, font_size=12)[source]

Set global font true-type for drawing.

Parameters
font_file_name : str

name of font file (example: ‘DejaVuSansMono.ttf’)

font_size : int

selected font size

Returns

Font object

Return type

PIL.ImageFont.FreeTypeFont