Font¶
- class easy_pil.font.Font(path: str, size: int = 10, **kwargs: Any)¶
Font class.
- Parameters:
path (str) – Path of font
size (int, optional) – Size of font, by default 10
- static caveat(variant: Literal['regular', 'bold', 'italic', 'light'] = 'regular', size: int = 10) FreeTypeFont¶
Caveat font.
- Parameters:
variant (Literal["regular", "bold", "italic", "light"], optional) – Font variant, by default “regular”
size (int, optional) – Font size, by default 10
- getsize(text: str) tuple[float, float]¶
Get the width and height of the text.
- Returns:
Width and height of the text bounding box.
- Return type:
tuple[float, float]
- static montserrat(variant: Literal['regular', 'bold', 'italic', 'light'] = 'regular', size: int = 10) FreeTypeFont¶
Montserrat font.
- Parameters:
variant (Literal["regular", "bold", "italic", "light"], optional) – Font variant, by default “regular”
size (int, optional) – Font size, by default 10
- static poppins(variant: Literal['regular', 'bold', 'italic', 'light'] = 'regular', size: int = 10) FreeTypeFont¶
Poppins font.
- Parameters:
variant (Literal["regular", "bold", "italic", "light"], optional) – Font variant, by default “regular”
size (int, optional) – Font size, by default 10