commit 8fa03111c6f1d8974b4b27680ef8addbdfda5dae
parent 6073e681b35c177f1ffac50ec67b25411c49c268
Author: nibo <nibo@relim.de>
Date: Sat, 7 Sep 2024 23:34:16 +0200
Fix bug
Boah, I don't know how to explain it.
Diffstat:
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/lorid.c b/lorid.c
@@ -67,15 +67,6 @@ int main(int argc, char *argv[])
fprintf(stderr, "cho_parse failed.\n");
return 1;
}
- int m;
- for (m = 0; songs[0]->metadata[m]; m++) {
- printf("'%s' => ", songs[0]->metadata[m]->name);
- int i;
- for (i = 0; songs[0]->metadata[m]->value[i] != 0; i++) {
- printf("[%02X|%c] ", songs[0]->metadata[m]->value[i], songs[0]->metadata[m]->value[i]);
- }
- printf("\n");
- }
char *pdf_filename = out_pdf_new(argc == optind+1 ? argv[argc-1] : NULL, output ? output : NULL, songs, config);
if (!pdf_filename) {
fprintf(stderr, "out_pdf_new failed.\n");
diff --git a/out_pdf.c b/out_pdf.c
@@ -637,7 +637,6 @@ static struct Text **text_create(struct ChoSong **songs, struct Config *config)
text[t]->lines[tl]->items = malloc(2 * sizeof(struct TextLineItem *));
text[t]->lines[tl]->items[0] = malloc(sizeof(struct TextLineItem));
text[t]->lines[tl]->items[0]->text = strdup(songs[so]->metadata[m]->value);
- printf("strdup text: %s\n", text[t]->lines[tl]->items[0]->text);
text[t]->lines[tl]->items[0]->style = cho_style_duplicate(songs[so]->metadata[m]->style);
width = text_width(text[t]->lines[tl]->items[0]);
if (width == EMPTY) {
@@ -732,7 +731,12 @@ static struct Text **text_create(struct ChoSong **songs, struct Config *config)
} else {
text[t]->lines[tl]->items[tli]->x = MARGIN_HORIZONTAL + width_until + added_space;
}
- if (ch > 0 && text_above[ch-1]->position == text_above[ch]->position) {
+ if (
+ ch > 0 &&
+ !text_above[ch-1]->is_chord &&
+ !text_above[ch]->is_chord &&
+ text_above[ch-1]->position == text_above[ch]->position
+ ) {
int b;
struct TextLineItem tmp;
for (b=ch-1; b >= 0 && text_above[b]->position == text_above[ch]->position; b--) {