autostart
This commit is contained in:
parent
65235d8c9a
commit
ca110918b4
6 changed files with 243 additions and 22 deletions
12
app/main.py
12
app/main.py
|
|
@ -147,11 +147,11 @@ def print_task(request: Request, task_id: str):
|
|||
draw = ImageDraw.Draw(img)
|
||||
draw.rectangle([(0,0),(CARD_WIDTH_PX-1,CARD_HEIGHT_PX-1)], outline=0, width=4)
|
||||
|
||||
# Robust font loading
|
||||
font_title = load_font(FONT_BOLD, 36, font_label="title")
|
||||
font_label_f = load_font(FONT_BOLD, 18, font_label="label")
|
||||
font_text = load_font(FONT_REGULAR, 22, font_label="text")
|
||||
font_icon = load_font(FA_FONT, 48, font_label="icon")
|
||||
# Robust font loading - increased sizes for physical printer readability
|
||||
font_title = load_font(FONT_BOLD, 42, font_label="title")
|
||||
font_label_f = load_font(FONT_BOLD, 24, font_label="label")
|
||||
font_text = load_font(FONT_REGULAR, 28, font_label="text")
|
||||
font_icon = load_font(FA_FONT, 60, font_label="icon")
|
||||
|
||||
# Prepare content for line wrapping
|
||||
import textwrap
|
||||
|
|
@ -159,7 +159,7 @@ def print_task(request: Request, task_id: str):
|
|||
max_text_width = CARD_WIDTH_PX - 40
|
||||
content_lines = []
|
||||
if font_title:
|
||||
wrapper = textwrap.TextWrapper(width=24)
|
||||
wrapper = textwrap.TextWrapper(width=20) # Reduced from 24 due to larger font
|
||||
lines = wrapper.wrap(task.content)
|
||||
for line in lines:
|
||||
# Check pixel width, wrap further if needed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue