Skip to main content

Crate chordsketch_render_pdf

Crate chordsketch_render_pdf 

Source
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_result so callers can keep importing chordsketch_render_pdf::MAX_WARNINGS unchanged (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_warning refuses to exceed this limit and appends a single truncation marker the first time the cap is hit.

Functions§

render_song
Render a Song AST to PDF bytes.
render_song_with_transpose
Render a Song AST to PDF bytes with an additional CLI transposition offset.
render_song_with_warnings
Render a Song AST 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.