From 4278ac6773c0296ac8978d81bbaa1e272fa398aa Mon Sep 17 00:00:00 2001 From: Bauke Date: Fri, 30 Sep 2022 13:39:56 +0200 Subject: [PATCH] Add font size parameter. --- .local/bin/project-avatar | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.local/bin/project-avatar b/.local/bin/project-avatar index 4d5e8b0..d249d6a 100755 --- a/.local/bin/project-avatar +++ b/.local/bin/project-avatar @@ -25,7 +25,7 @@ def main() -> None: "-o", args.filename, "--", - *gegl_graph(args.height, args.width, args.text), + *gegl_graph(args.height, args.width, args.text, args.font_size), ], check=True, ) @@ -92,10 +92,16 @@ def create_parser() -> argparse.ArgumentParser: help="Use MAT2 to clean the image.", action="store_true", ) + parser.add_argument( + "--font-size", + help="The font size to use for the text.", + type=int, + default=150, + ) return parser -def gegl_graph(height: int, width: int, text: str) -> typing.List[str]: +def gegl_graph(height: int, width: int, text: str, font_size: int) -> typing.List[str]: graph = f""" gegl:text string={text} @@ -103,7 +109,7 @@ def gegl_graph(height: int, width: int, text: str) -> typing.List[str]: height={height} color=white font=Heavitas - size=150 + size={font_size} alignment=1 vertical-alignment=1 gegl:dropshadow