From e82a15ab8460ea9b0be8750f4f9a88e7740e6f47 Mon Sep 17 00:00:00 2001 From: Yixing Lao Date: Fri, 10 Jan 2025 20:48:25 +0800 Subject: [PATCH] refactor(camtools/render.py): enforce type hints for `font_type` and `multiline_alignment` parameters using Literal to improve type safety and clarity --- camtools/render.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/camtools/render.py b/camtools/render.py index c487024..c88564d 100644 --- a/camtools/render.py +++ b/camtools/render.py @@ -604,9 +604,9 @@ def render_text( def render_texts( texts: List[str], font_size: int = 72, - font_type: str = "tex", + font_type: Literal["tex", "serif", "sans", "mono"] = "tex", font_color: Tuple[float, float, float] = (0.0, 0.0, 0.0), - multiline_alignment: str = "center", + multiline_alignment: Literal["left", "center", "right"] = "center", same_height: bool = False, same_width: bool = False, padding_tblr: Tuple[int, int, int, int] = (0, 0, 0, 0),