lorid

convert chordpro to pdf
git clone git://git.relim.de/lorid.git
Log | Files | Refs | README | LICENSE

commit f5cf40d7f52df07ce54f7cb9c1b4bac77732a7d6
parent e6de8e6633a1fd7f49f57c7c748e839b7981c318
Author: nibo <nibo@relim.de>
Date:   Sun,  4 Aug 2024 13:26:47 +0200

Continue line if it ends with a backslash

Diffstat:
Mchordpro.c | 5+++++
Mout_pdf.c | 3---
Mtodo | 19+++++++++----------
3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/chordpro.c b/chordpro.c @@ -1864,6 +1864,11 @@ struct ChoSong **cho_songs_parse(FILE *fp, struct Config *config) break; } if (buf == '\n') { + if (prev_buf == '\\') { + // This will later overwrite the backslash + te--; + break; + } songs[so]->sections[se]->lines[li]->lyrics[ly]->text = realloc(songs[so]->sections[se]->lines[li]->lyrics[ly]->text, (te+1) * sizeof(char)); songs[so]->sections[se]->lines[li]->lyrics[ly]->text[te] = 0; if (strlen(songs[so]->sections[se]->lines[li]->lyrics[ly]->text) == 0) { diff --git a/out_pdf.c b/out_pdf.c @@ -991,9 +991,6 @@ bool out_pdf_new(const char *cho_filepath, const char *output_folder_or_file, st f++; } cho_fonts_free(needed_fonts); - for (f = 0; g_fonts[f]; f++) { - printf("%s\n", g_fonts[f]->name); - } struct Text **text = text_create(songs, config); if (!text) { fprintf(stderr, "text_create failed.\n"); diff --git a/todo b/todo @@ -1,20 +1,19 @@ -apply all config in cho_parse() instead of out_pdf_new() +apply all config in cho_songs_parse() instead of out_pdf_new() 'chorus' directive decide how to implement +'image' directive + https://chordpro.org/chordpro/directives-image/ metadata directives %{blabla} -'image' directive; decide if implement - https://chordpro.org/chordpro/directives-image/ -chordpro markup - implement inside chords -the whole chords advanced stuff + add style to every metadata + font, size, colour directives +chords + implement markup transpose define chords chord diagrams introduce parse errors still very unclear to me when the parser should warn - and continue execution and when it should fail -metadata items need a style - font, size, colour directives -new_song directive + and continue execution and when it should fail and + stop execution continue line if it ends with a backslash