Font

supervisely_lib.imaging.font.load_font(font_file_name: str, font_size: int = 12) → PIL.ImageFont.FreeTypeFont[source]

Set global font true-type for drawing. Args:

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

Returns:

loaded from file font

supervisely_lib.imaging.font.get_font(font_file_name: Optional[str] = None, font_size: int = 12) → PIL.ImageFont.FreeTypeFont[source]
Args:

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

Returns:

font for drawing

supervisely_lib.imaging.font.get_readable_font_size(img_size) → int[source]

Get size of font for image with given sizes :param img_size: size of image :return: size of font