Expand description
PDF renderer for ChordPro documents.
Converts a parsed ChordPro AST into a PDF document. ASCII and Latin-1
characters are rendered using built-in Helvetica Type1 fonts. Characters
outside the Latin-1 range (e.g. CJK, Greek, Cyrillic) are rendered with a
bundled Noto Sans CJK JP subset font embedded as a CID composite font
(Type0 / CIDFontType0C). Uses flate2 for PNG image decompression.
Supports multi-page output: content automatically flows to new pages when
the current page overflows, and {new_page} / {new_physical_page}
directives trigger explicit page breaks.
Constants§
- MAX_
WARNINGS - Maximum number of warnings the renderer accumulates per render pass.
Re-exported from
chordsketch-chordpro::render_resultso callers can keep importingchordsketch_render_pdf::MAX_WARNINGSunchanged (issue #1874). Maximum number of warnings any renderer accumulates for a single render pass (issue #1833). Without a cap, a pathological input such as one million malformed{transpose}lines would push the warnings vector to tens of megabytes.push_warningrefuses to exceed this limit and appends a single truncation marker the first time the cap is hit.
Functions§
- render_
song - Render a
SongAST to PDF bytes. - render_
song_ with_ transpose - Render a
SongAST to PDF bytes with an additional CLI transposition offset. - render_
song_ with_ warnings - Render a
SongAST to PDF bytes, returning warnings programmatically. - render_
songs - Render multiple
Songs into a single multi-page PDF document. - render_
songs_ with_ transpose - Render multiple
Songs into a single PDF with transposition. - render_
songs_ with_ warnings - Render multiple
Songs into a single PDF, returning warnings programmatically. - try_
render - Parse and render a ChordPro source string to PDF bytes.