(
draw: ImageDraw.ImageDraw,
x: int,
y: int,
w: int,
h: int,
tag: str,
tag_color: tuple[int, int, int],
body: str,
body_font: ImageFont.FreeTypeFont,
fill: tuple[int, int, int],
chars: int,
tag_text_color: tuple[int, int, int] = TEXT,
)
| 191 | |
| 192 | |
| 193 | def draw_card( |
| 194 | draw: ImageDraw.ImageDraw, |
| 195 | x: int, |
| 196 | y: int, |
| 197 | w: int, |
| 198 | h: int, |
| 199 | tag: str, |
| 200 | tag_color: tuple[int, int, int], |
| 201 | body: str, |
| 202 | body_font: ImageFont.FreeTypeFont, |
| 203 | fill: tuple[int, int, int], |
| 204 | chars: int, |
| 205 | tag_text_color: tuple[int, int, int] = TEXT, |
| 206 | ) -> None: |
| 207 | draw.rounded_rectangle((x, y, x + w, y + h), radius=26, fill=fill) |
| 208 | tag_w = text_box(draw, tag, F_TAG)[0] + 42 |
| 209 | draw_badge(draw, x + (w - tag_w) // 2, y - 33, tag, tag_color, tag_text_color) |
| 210 | draw_wrapped_text(draw, (x + 22, y + 42), body, body_font, TEXT, chars) |
| 211 | |
| 212 | |
| 213 | def panel_position(idx: int) -> tuple[int, int]: |
no test coverage detected