Repository navigation
PDF and Printing
github-actions[bot] edited this page Nov 7, 2026
·
6 revisions
Learn how GraceChords renders charts and songbooks for print.
- Sections never split across pages
- Supports single or multi-column layouts
- Embedded PDF fonts live in
apps/web/src/assets/fonts/ - Songbook TOC lists entries as "#. Title" (no page numbers); defaults to one column and switches to two columns before spilling to a second page
Charts keep whole sections on one page. If a song doesn't fit one column on a single page, the engine tries two columns, then falls back to multiple pages.
Place Noto Sans and Noto Sans Mono files in apps/web/src/assets/fonts/ to embed them in PDFs.
If a section still splits, shorten lines or reduce font size.
- Engine location:
src/utils/pdf_mvp/(export entry:src/utils/pdf_mvp/index.js). - Decision ladder:
- 1 column, single page at sizes 16 → 12 pt
- else 2 columns, single page at sizes 16 → 12 pt
- else fallback: 1 column, multipage at 15 pt (title/key header only on page 1)
- Typography:
- Title 26 pt bold (wraps as needed)
- Key 16 pt italic gray (
rgb(90,90,90)) directly under title - Lyrics/Chords 12–16 pt, line-height ≈ 1.2×
- Section headers same size as lyrics (bold),
[LABEL]style
- Spacing:
- Clear header-to-song gap ≈ 1.125 lyric line-heights before first section
- Compact, consistent spacing between sections
- Chords:
- Drawn on a separate line above the wrapped lyric row, aligned by measured lyric substring widths
- No overlaps; at least one space width between symbols
- Trailing chords flush at end-of-line with single-space separation
- Columns & paging:
- 0.5" margins; two columns with 24 pt gutter
- Sections are atomic and never split across columns/pages
- Run:
npm run test:mvp - Suites:
src/__tests__/pdf_mvp.*.test.js(plan,chords,sections,pure,songbook)
- Fonts: Noto Sans + Noto Mono preferred; falls back to helvetica/courier if not registered.
- Service worker: navigations use network-first so new deploys and edits are picked up promptly.
- Recommended: build with
VITE_COMMIT_SHA=$(git rev-parse HEAD)to invalidate old caches.
See also PDF-Engine-(MVP) for developer notes.
-
User Guide
-
Editing & Admin
-
Developer Guide
-
Infrastructure
-
Mobile