Function
centered_text
(
draw: ImageDraw.ImageDraw,
x: float,
y: float,
text: str,
font: ImageFont.FreeTypeFont,
fill: tuple[int, int, int],
)
Source from the content-addressed store, hash-verified
| 74 | |
| 75 | |
| 76 | def centered_text( |
| 77 | draw: ImageDraw.ImageDraw, |
| 78 | x: float, |
| 79 | y: float, |
| 80 | text: str, |
| 81 | font: ImageFont.FreeTypeFont, |
| 82 | fill: tuple[int, int, int], |
| 83 | ) -> None: |
| 84 | tw, th = text_size(draw, text, font) |
| 85 | draw.text((x - tw / 2, y - th / 2), text, font=font, fill=fill) |
| 86 | |
| 87 | |
| 88 | def draw_rotated_text( |
Tested by
no test coverage detected