Am 01.09.2017 um 22:42 schrieb Erik Ronström:
Nice work, but your pdf includes many different subsets of the lilypond fonts
and is several MB to big because of this.
Use the --bigpdfs option of lilypond in step 3. The resulting pdfs are _much_
bigger because all glyphs from the fonts are included.
…
Wow, thanks, I hadn’t thought of that at all! There’s always something more to
learn! :)
If I apply the attached patch to a cloned git archive I get the following
results with ghostscript 9.06:
bok2: Original size 9.996.691 bytes, optimized size 2.043.380 bytes
bok3: Original size 13.706.324 bytes, optimized size 2.447.232 bytes
Unfortunately I found that a current git master of ghostscript does not work as
intended. I have to bisect and investigate that problem.
A lot of pages contain a lot of white space. It would be possible to include
every staff as a paragraph instead of including the whole pdfs ….
Yeah, but that is intentional. I didn’t want tunes split over page breaks
(except the tunes that are too long to fit in one page). Actually that was the
main reason for not using lilypond-book: I wanted more fine-grained control
over vertical spacing, and I found that much easier to achieve when lilypond
takes care of the whole typesetting process.
I did not write about using lilypond-book, I never use it and prefer
pdf(la)tex/xe(la)tex/lua(la)tex for similar reasons.
I agree that there are valid reasons not to split over page breaks if a page
turn would be the result. But why do you have objections against a score
starting on an even page and continuing on an uneven page?
A possible extension of your work: You might generate score videos (example)
<https://www.youtube.com/watch?v=EqWYmrwTcqQ> and add links to those videos in
your books ....
Knut
diff --git a/bin/generate-book-2.pl b/bin/generate-book-2.pl
index 28dd48e..5895d4b 100755
--- a/bin/generate-book-2.pl
+++ b/bin/generate-book-2.pl
@@ -141,7 +141,7 @@ for my $num ($From..$To) {
#my $md5 = `md5 -q $songfile.ly`;
#$md5 =~ s/\s//g;
unless (-e "$songfile-$md5-crop.pdf") {
- system("lilypond", "-l", "WARNING", "-o", "$songfile-$md5", "$songfile.ly") unless -e "$songfile-$md5.pdf";
+ system("lilypond", "-l", "WARNING", "--bigpdf", "-d", "gs-load-fonts=\#t", "-o", "$songfile-$md5", "$songfile.ly") unless -e "$songfile-$md5.pdf";
`pdfcrop $songfile-$md5.pdf`; # Use backticks instead of system() to suppress output
unlink("$songfile-$md5.pdf");
}
diff --git a/bin/make-books.sh b/bin/make-books.sh
index 94f3054..769ab76 100755
--- a/bin/make-books.sh
+++ b/bin/make-books.sh
@@ -6,7 +6,9 @@ then
fi
rm -f fredin.out
bin/generate-book-2.pl book 2 && lualatex $VERBOSE book/fredin.latex && mv fredin.pdf bok2.pdf
+gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=bok2-opt.pdf bok2.pdf
rm fredin.out
bin/generate-book-2.pl book 3 && lualatex $VERBOSE book/fredin.latex && mv fredin.pdf bok3.pdf
+gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=bok3-opt.pdf bok3.pdf
rm fredin.out
echo
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user