Skip to content

Auto-fit setlist font size to target page count#53

Merged
laenzlinger merged 1 commit into
mainfrom
52-auto-fit-font-size
Apr 26, 2026
Merged

Auto-fit setlist font size to target page count#53
laenzlinger merged 1 commit into
mainfrom
52-auto-fit-font-size

Conversation

@laenzlinger
Copy link
Copy Markdown
Owner

Closes #52

Changes

  • New --pages flag (default 2) on generate list command
  • Auto-fits font size using binary search (10px–60px, 0.5px precision, ~7 iterations)
  • Maximizes font size to use as much of the page real estate as possible
  • --font-size flag overrides auto-fit when explicitly set
  • Refactored convert package: extracted HTMLToPDFBytes() and PageCount()

Usage

# Auto-fit to 2 pages (default)
setlist generate list

# Auto-fit to 3 pages
setlist generate list --pages 3

# Override with explicit font size (no auto-fit)
setlist generate list --font-size 40px

Verified

  • Build ✅
  • Tests ✅
  • Lint ✅ (0 issues)

- Add --pages flag (default 2) to generate list command
- Binary search on font size (10px-60px) to maximize text size
  while fitting within the target page count
- --font-size flag overrides auto-fit when explicitly set
- Refactor convert package: extract HTMLToPDFBytes and PageCount
@laenzlinger laenzlinger force-pushed the 52-auto-fit-font-size branch from f9b630a to e9ef910 Compare April 26, 2026 19:22
@laenzlinger laenzlinger merged commit 26de0c5 into main Apr 26, 2026
1 check passed
@laenzlinger laenzlinger deleted the 52-auto-fit-font-size branch April 26, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-fit setlist text size to target page count

1 participant