From a767abf023c5449fcecce36ace9196901e7374a2 Mon Sep 17 00:00:00 2001 From: "Dr. Tobias Quathamer" Date: Fri, 9 Dec 2016 12:06:32 +0100 Subject: [PATCH] Imported Upstream version 2.19.52 --- .gitfilelist | 3 + Documentation/changes.tely | 11 +- Documentation/fr/learning/templates.itely | 2 +- Documentation/fr/notation/ancient.itely | 2 +- Documentation/notation/spacing.itely | 30 +- Documentation/web/news-front.itexi | 4 +- Documentation/web/news-headlines.itexi | 6 +- Documentation/web/news.itexi | 12 + NEWS.txt | 12 +- VERSION | 4 +- config.make.in | 4 + configure | 335 ++++++++++++++++++++++ configure.ac | 24 ++ input/regression/one-page-breaking.ly | 14 + lily/include/one-page-breaking.hh | 37 +++ lily/one-page-breaking.cc | 174 +++++++++++ lily/page-breaking-scheme.cc | 11 + ly/Welcome-to-LilyPond-MacOS.ly | 2 +- ly/Welcome_to_LilyPond.ly | 2 +- ly/performer-init.ly | 2 +- make/lilypond-book-rules.make | 12 + make/lilypond-vars.make | 6 + make/lysdoc-targets.make | 4 + out/ChangeLog | 2 +- out/RELEASE-COMMIT | 16 +- po/lilypond.pot | 16 +- stepmake/stepmake/texinfo-rules.make | 6 + 27 files changed, 712 insertions(+), 41 deletions(-) create mode 100644 input/regression/one-page-breaking.ly create mode 100644 lily/include/one-page-breaking.hh create mode 100644 lily/one-page-breaking.cc diff --git a/.gitfilelist b/.gitfilelist index 8fd803b17c..c3e71e9eae 100644 --- a/.gitfilelist +++ b/.gitfilelist @@ -3318,6 +3318,7 @@ input/regression/number-staff-lines.ly input/regression/offsets.ly input/regression/one-line-auto-height-breaking.ly input/regression/one-line-breaking.ly +input/regression/one-page-breaking.ly input/regression/one-staff.ly input/regression/optimal-page-breaking-hstretch.ly input/regression/option-help.ly @@ -4165,6 +4166,7 @@ lily/include/note-head.hh lily/include/note-spacing.hh lily/include/one-line-auto-height-breaking.hh lily/include/one-line-page-breaking.hh +lily/include/one-page-breaking.hh lily/include/open-type-font.hh lily/include/optimal-page-breaking.hh lily/include/output-def.hh @@ -4356,6 +4358,7 @@ lily/note-spacing-engraver.cc lily/note-spacing.cc lily/one-line-auto-height-breaking.cc lily/one-line-page-breaking.cc +lily/one-page-breaking.cc lily/open-type-font-scheme.cc lily/open-type-font.cc lily/optimal-page-breaking.cc diff --git a/Documentation/changes.tely b/Documentation/changes.tely index 64707801d2..2407b3d018 100644 --- a/Documentation/changes.tely +++ b/Documentation/changes.tely @@ -209,11 +209,12 @@ dimensions from a markup object, given as first argument. @end lilypond @item -A new page breaking function @code{ly:one-line-auto-height-breaking} -places a whole score on a single line and changes the page width -to match, just like @code{ly:one-line-breaking}. The difference is that -it also automatically modifies the height of the page to fit the height -of the music. +There are two new page breaking functions. @code{ly:one-page-breaking} +automatically adjusts the height of the page to fit the music, so that +everything fits on one page. @code{ly:one-line-auto-height-breaking} +is like @code{ly:one-line-breaking}, placing the music on a single +line and adjusting the page width accordingly, however it also +automatically adjusts the page height to fit the music. @item Markup-command @code{\draw-squiggle-line} is now available. diff --git a/Documentation/fr/learning/templates.itely b/Documentation/fr/learning/templates.itely index 6b5ece6bac..4f8748ca93 100644 --- a/Documentation/fr/learning/templates.itely +++ b/Documentation/fr/learning/templates.itely @@ -399,7 +399,7 @@ sont pas réalisables avec ce gabarit préprogrammé. @appendixsec Modèles pour piano @translationof Piano templates -+@menu +@menu * Piano seul:: * Chant et accompagnement:: * Piano et paroles entre les portées:: diff --git a/Documentation/fr/notation/ancient.itely b/Documentation/fr/notation/ancient.itely index 2e27808c6a..a21092a714 100644 --- a/Documentation/fr/notation/ancient.itely +++ b/Documentation/fr/notation/ancient.itely @@ -87,7 +87,7 @@ Manuel de notation : @node Formes de notation ancienne prises en charge -@unnumberedsubsubsec Formes de notation ancienne prises en charge +@subsection Formes de notation ancienne prises en charge @translationof Overview of the supported styles En matière de chant grégorien, LilyPond dispose de trois différents diff --git a/Documentation/notation/spacing.itely b/Documentation/notation/spacing.itely index 23ed5c0f30..9a4e91d49b 100644 --- a/Documentation/notation/spacing.itely +++ b/Documentation/notation/spacing.itely @@ -892,8 +892,9 @@ Default values not listed here are defined in The page-breaking algorithm to use. Choices are @code{ly:minimal-breaking}, @code{ly:page-turn-breaking}, -@code{ly:one-line-breaking}, @code{ly:one-line-auto-height-breaking}, -and @code{ly:optimal-breaking} (the default). +@code{ly:one-page-breaking}, @code{ly:one-line-breaking}, +@code{ly:one-line-auto-height-breaking}, and @code{ly:optimal-breaking} +(the default). @item page-breaking-system-system-spacing @funindex page-breaking-system-system-spacing @@ -968,7 +969,9 @@ Notation Reference: @ref{Optimal page breaking}, @ref{Optimal page turning}, @ref{Minimal page breaking}, -@ref{One-line page breaking}. +@ref{One-page page breaking}, +@ref{One-line page breaking}, +@ref{One-line-auto-height page breaking}. Installed Files: @file{ly/paper-defaults-init.ly}. @@ -1560,6 +1563,7 @@ how to modify them. * Manual page breaking:: * Optimal page breaking:: * Minimal page breaking:: +* One-page page breaking:: * One-line page breaking:: * One-line-auto-height page breaking:: * Optimal page turning:: @@ -1706,6 +1710,26 @@ Snippets: @rlsr{Spacing}. +@node One-page page breaking +@unnumberedsubsubsec One-page page breaking + +@funindex ly:one-page-breaking + +The @code{ly:one-page-breaking} function is a special-purpose +page breaking algorithm that automatically adjusts the page height to +fit the music, so that everything fits on a single page. The +@code{paper-height} variable in the paper block is ignored, but other +settings work as usual. In particular, the spacing between the last +system (or top level markup) and the footer can be customized with +@code{last-bottom-spacing} in the paper block. The width of the page +is left unmodified by default but can be set with @code{paper-width} +in the paper block. + +@knownissues +@code{ly:one-page-breaking} is not currently compatible with +@code{\bookpart}. + + @node One-line page breaking @unnumberedsubsubsec One-line page breaking diff --git a/Documentation/web/news-front.itexi b/Documentation/web/news-front.itexi index ffd1266cc4..daa179dc33 100644 --- a/Documentation/web/news-front.itexi +++ b/Documentation/web/news-front.itexi @@ -9,10 +9,10 @@ @c used for news about the upcoming release; see CG on Release Work @newsItem -@subheading LilyPond 2.19.51 released @emph{November 20, 2016} +@subheading LilyPond 2.19.52 released @emph{December 4, 2016} We are happy to announce the release of LilyPond -2.19.51. This release includes a number of enhancements, and contains some +2.19.52. This release includes a number of enhancements, and contains some work in progress. You will have access to the very latest features, but some may be incomplete, and you may encounter bugs and crashes. If you require a stable version of LilyPond, we recommend using the 2.18 diff --git a/Documentation/web/news-headlines.itexi b/Documentation/web/news-headlines.itexi index 79e76c2b59..22149e7207 100644 --- a/Documentation/web/news-headlines.itexi +++ b/Documentation/web/news-headlines.itexi @@ -11,7 +11,7 @@ @ifclear web_version @c no anchor links, just link to News page -@ref{News, LilyPond 2.19.51 released - @emph{November 20, 2016}} +@ref{News, LilyPond 2.19.52 released - @emph{December 4, 2016}} @ref{News, Two LilyPond projects in Google Summer of Code 2016 - @emph{April 23, 2016}} @@ -23,8 +23,8 @@ @ifset web_version @c anchor links, link to individual news items by their tag -@uref{news.html#LilyPond-2_002e19_002e51-released-November-20_002c-2016, - LilyPond 2.19.51 released - @emph{November 20, 2016}} +@uref{news.html#LilyPond-2_002e19_002e51-released-December-4_002c-2016, + LilyPond 2.19.52 released - @emph{December 40, 2016}} @uref{news.html#Two-LilyPond-projects-in-Google-Summer-of-Code-2016-April-23_002c-2016, Two LilyPond projects in Google Summer of Code 2016 - @emph{April 23, 2016}} diff --git a/Documentation/web/news.itexi b/Documentation/web/news.itexi index 478814c512..81b61be2b5 100644 --- a/Documentation/web/news.itexi +++ b/Documentation/web/news.itexi @@ -26,6 +26,18 @@ NOTE: * don't duplicate entries from news-front.itexi @end ignore +@newsItem +@subheading LilyPond 2.19.51 released @emph{November 20, 2016} + +We are happy to announce the release of LilyPond +2.19.51. This release includes a number of enhancements, and contains some +work in progress. You will have access to the very latest features, but +some may be incomplete, and you may encounter bugs and crashes. If you +require a stable version of LilyPond, we recommend using the 2.18 +version. + +@newsEnd + @newsItem @subheading LilyPond 2.19.50 released @emph{November 6, 2016} diff --git a/NEWS.txt b/NEWS.txt index ac7ad1d469..8cfbabb20e 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -124,11 +124,13 @@ New features in 2.20 since 2.18 } image of music - • A new page breaking function ‘ly:one-line-auto-height-breaking’ - places a whole score on a single line and changes the page width to - match, just like ‘ly:one-line-breaking’. The difference is that it - also automatically modifies the height of the page to fit the - height of the music. + • There are two new page breaking functions. ‘ly:one-page-breaking’ + automatically adjusts the height of the page to fit the music, so + that everything fits on one page. + ‘ly:one-line-auto-height-breaking’ is like ‘ly:one-line-breaking’, + placing the music on a single line and adjusting the page width + accordingly, however it also automatically adjusts the page height + to fit the music. • Markup-command ‘\draw-squiggle-line’ is now available. Customizing is possible with overrides of ‘thickness’, ‘angularity’, ‘height’ diff --git a/VERSION b/VERSION index 7e5143a73e..f30c36be30 100644 --- a/VERSION +++ b/VERSION @@ -1,7 +1,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=19 -PATCH_LEVEL=51 +PATCH_LEVEL=52 MY_PATCH_LEVEL= VERSION_STABLE=2.18.2 -VERSION_DEVEL=2.19.51 +VERSION_DEVEL=2.19.52 diff --git a/config.make.in b/config.make.in index d376a59f48..3bf17671a0 100644 --- a/config.make.in +++ b/config.make.in @@ -38,6 +38,8 @@ PACKAGE_NAME = @PACKAGE_NAME@ HOST_ARCH=@HOST_ARCH@ +USE_EXTRACTPDFMARK=@USE_EXTRACTPDFMARK@ + ################################################################ ## FILESYSTEM ################################################################ @@ -110,12 +112,14 @@ DBLATEX = @DBLATEX@ DEFINES = @DEFS@ @DEFINES@ DEFS = @DEFS@ DOCUMENTATION = @DOCUMENTATION@ +EXTRACTPDFMARK = @EXTRACTPDFMARK@ FIND = @FIND@ FCLIST = @FCLIST@ FLEX = @FLEX@ FLEXLEXER_FILE = @FLEXLEXER_FILE@ FONTFORGE = @FONTFORGE@ GROFF = @GROFF@ +GS920 = @GS920@ GUILE = @GUILE@ GUILE_CFLAGS = @GUILE_CFLAGS@ GUILE_CONFIG = @GUILE_CONFIG@ diff --git a/configure b/configure index f45f4faade..a779d12994 100755 --- a/configure +++ b/configure @@ -651,6 +651,9 @@ BIBTEX DBLATEX TEXI2HTML MAKEINFO +USE_EXTRACTPDFMARK +EXTRACTPDFMARK +GS920 GHOSTSCRIPT PERL GUILE @@ -13193,6 +13196,338 @@ $as_echo "$ver" >&6; } + + + + for ac_prog in gs +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_GS920+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$GS920"; then + ac_cv_prog_GS920="$GS920" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_GS920="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +GS920=$ac_cv_prog_GS920 +if test -n "$GS920"; then + { $as_echo "$as_me:$LINENO: result: $GS920" >&5 +$as_echo "$GS920" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$GS920" && break +done +test -n "$GS920" || GS920="no" + + + + r="`eval echo '$'"GS920"`" + if test -n "$r" -a "$r" != "error" -a "$r" != "no" && expr '`eval echo '$'"GS920"`' : '.*\(echo\)' > /dev/null; then + true + else + ##STEPMAKE_WARN(cannot find . ) + false + fi + + if test $? -ne 0; then + + eval "OPTIONAL"=\"`eval echo \"'$'OPTIONAL\" \"gs\"`\" + + if test "OPTIONAL" = "REQUIRED"; then + command="echo ERROR: gs not found" + # abort configure process here? + else + command="- echo gs not found" + fi + eval "GS920"='$command' + false + else + true + fi + + if test $? -eq 0 -a -n "9.20"; then + + r="`eval echo '$'"GS920"`" + { $as_echo "$as_me:$LINENO: checking $r version" >&5 +$as_echo_n "checking $r version... " >&6; } + exe=` + ## which doesn't work in ash, if /usr/bin/which isn't installed + ## type -p doesn't work in ash + ## command -v doesn't work in zsh + ## command -v "$r" 2>&1 + ## this test should work in ash, bash, pdksh (ksh), zsh + type -p $r 2>/dev/null | tail -n 1 | awk '{print $NF}' +` + if test -n ""; then + ver="" + else + ver=` + ## "$exe" --version 2>&1 | grep -v '^$' | head -n 1 | awk '{print $NF}' + ## + ## ARG. + ## Workaround for broken Debian gcc version string: + ## gcc (GCC) 3.1.1 20020606 (Debian prerelease) + ## + ## -V: Workaround for python + + #dnl + + ## Assume and hunt for dotted version multiplet. + ## use eval trickery, because we cannot use multi-level $() instead of `` + ## for compatibility reasons. + + ## grab the first version number in --version output. + eval _ver=\"\`("$exe" --version || "$exe" -V) 2>&1 | + grep -E '(^| )[0-9][0-9]*\.[0-9]' | + head -n 1 | + tr ' ' '\n' | + sed 's/\([0-9][0-9]*\.[0-9][0-9.]*\).*/\1/g' | + grep -E '(^| )[0-9][0-9]*\.[0-9]' | + head -n 1\`\" + + if test -z "$_ver"; then + ## If empty, try date [fontforge] + eval _ver=\"\`("$exe" --version || "$exe" -V) 2>&1 \ + | grep '\(^\|[^0-9a-f]\)[0-9]\{6,8\}\([^0-9a-f]\|$\)' \ + | head -n 1 \ + | sed -e 's/^[^.0-9]*//' -e 's/[^.0-9]*$//'\`\" + fi + echo "$_ver" + #dnl +` + fi + num=` + echo "$ver" | awk -F. ' + { + if ($3) {three = $3} + else {three = 0} + } + {printf "%.0f\n", $1*1000000 + $2*1000 + three}' +` + req=` + echo "9.20" | awk -F. ' + { + if ($3) {three = $3} + else {three = 0} + } + {printf "%.0f\n", $1*1000000 + $2*1000 + three}' +` + { $as_echo "$as_me:$LINENO: result: $ver" >&5 +$as_echo "$ver" >&6; } + if test "$num" -lt "$req"; then + + eval "OPTIONAL"=\"`eval echo \"'$'OPTIONAL\" \""$r >= 9.20 (installed: $ver)"\"`\" + + fi + vervar="`echo GS920 | tr 'a-z' 'A-Z'`_VERSION" + eval `echo $vervar=$num` +## AC_SUBST(`eval echo $vervar`) + + fi + + + for ac_prog in extractpdfmark +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_EXTRACTPDFMARK+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$EXTRACTPDFMARK"; then + ac_cv_prog_EXTRACTPDFMARK="$EXTRACTPDFMARK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_EXTRACTPDFMARK="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +EXTRACTPDFMARK=$ac_cv_prog_EXTRACTPDFMARK +if test -n "$EXTRACTPDFMARK"; then + { $as_echo "$as_me:$LINENO: result: $EXTRACTPDFMARK" >&5 +$as_echo "$EXTRACTPDFMARK" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$EXTRACTPDFMARK" && break +done +test -n "$EXTRACTPDFMARK" || EXTRACTPDFMARK="no" + + + + r="`eval echo '$'"EXTRACTPDFMARK"`" + if test -n "$r" -a "$r" != "error" -a "$r" != "no" && expr '`eval echo '$'"EXTRACTPDFMARK"`' : '.*\(echo\)' > /dev/null; then + true + else + ##STEPMAKE_WARN(cannot find . ) + false + fi + + if test $? -ne 0; then + + eval "OPTIONAL"=\"`eval echo \"'$'OPTIONAL\" \"extractpdfmark\"`\" + + if test "OPTIONAL" = "REQUIRED"; then + command="echo ERROR: extractpdfmark not found" + # abort configure process here? + else + command="- echo extractpdfmark not found" + fi + eval "EXTRACTPDFMARK"='$command' + false + else + true + fi + + if test $? -eq 0 -a -n ""; then + + r="`eval echo '$'"EXTRACTPDFMARK"`" + { $as_echo "$as_me:$LINENO: checking $r version" >&5 +$as_echo_n "checking $r version... " >&6; } + exe=` + ## which doesn't work in ash, if /usr/bin/which isn't installed + ## type -p doesn't work in ash + ## command -v doesn't work in zsh + ## command -v "$r" 2>&1 + ## this test should work in ash, bash, pdksh (ksh), zsh + type -p $r 2>/dev/null | tail -n 1 | awk '{print $NF}' +` + if test -n ""; then + ver="" + else + ver=` + ## "$exe" --version 2>&1 | grep -v '^$' | head -n 1 | awk '{print $NF}' + ## + ## ARG. + ## Workaround for broken Debian gcc version string: + ## gcc (GCC) 3.1.1 20020606 (Debian prerelease) + ## + ## -V: Workaround for python + + #dnl + + ## Assume and hunt for dotted version multiplet. + ## use eval trickery, because we cannot use multi-level $() instead of `` + ## for compatibility reasons. + + ## grab the first version number in --version output. + eval _ver=\"\`("$exe" --version || "$exe" -V) 2>&1 | + grep -E '(^| )[0-9][0-9]*\.[0-9]' | + head -n 1 | + tr ' ' '\n' | + sed 's/\([0-9][0-9]*\.[0-9][0-9.]*\).*/\1/g' | + grep -E '(^| )[0-9][0-9]*\.[0-9]' | + head -n 1\`\" + + if test -z "$_ver"; then + ## If empty, try date [fontforge] + eval _ver=\"\`("$exe" --version || "$exe" -V) 2>&1 \ + | grep '\(^\|[^0-9a-f]\)[0-9]\{6,8\}\([^0-9a-f]\|$\)' \ + | head -n 1 \ + | sed -e 's/^[^.0-9]*//' -e 's/[^.0-9]*$//'\`\" + fi + echo "$_ver" + #dnl +` + fi + num=` + echo "$ver" | awk -F. ' + { + if ($3) {three = $3} + else {three = 0} + } + {printf "%.0f\n", $1*1000000 + $2*1000 + three}' +` + req=` + echo "" | awk -F. ' + { + if ($3) {three = $3} + else {three = 0} + } + {printf "%.0f\n", $1*1000000 + $2*1000 + three}' +` + { $as_echo "$as_me:$LINENO: result: $ver" >&5 +$as_echo "$ver" >&6; } + if test "$num" -lt "$req"; then + + eval "OPTIONAL"=\"`eval echo \"'$'OPTIONAL\" \""$r >= (installed: $ver)"\"`\" + + fi + vervar="`echo EXTRACTPDFMARK | tr 'a-z' 'A-Z'`_VERSION" + eval `echo $vervar=$num` +## AC_SUBST(`eval echo $vervar`) + + fi + +req=` + echo "9.20" | awk -F. ' + { + if ($3) {three = $3} + else {three = 0} + } + {printf "%.0f\n", $1*1000000 + $2*1000 + three}' +` +USE_EXTRACTPDFMARK=yes +if test "$GS920_VERSION" -lt "$req"; then + GS920= + USE_EXTRACTPDFMARK=no +fi +if test "$EXTRACTPDFMARK" != "extractpdfmark"; then + EXTRACTPDFMARK= + USE_EXTRACTPDFMARK=no +fi +if test "$USE_EXTRACTPDFMARK" != "yes"; then + + eval "OPTIONAL"=\"`eval echo \"'$'OPTIONAL\" \""(Optionally using Ghostscript >= 9.20 together with"\"`\" + + + eval "OPTIONAL"=\"`eval echo \"'$'OPTIONAL\" \"" Extract PDFmark can significantly reduce the disk space required"\"`\" + + + eval "OPTIONAL"=\"`eval echo \"'$'OPTIONAL\" \"" for building the documentation and the final PDF files.)"\"`\" + +fi + + for ac_prog in makeinfo do # Extract the first word of "$ac_prog", so it can be a program name with args. diff --git a/configure.ac b/configure.ac index 19ffd18bf3..d77ea15881 100644 --- a/configure.ac +++ b/configure.ac @@ -281,6 +281,30 @@ fi STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, $DOCUMENTATION_REQUIRED, 8.60) +AC_SUBST(GS920) +AC_SUBST(EXTRACTPDFMARK) +AC_SUBST(USE_EXTRACTPDFMARK) +STEPMAKE_PROGS(GS920, gs, OPTIONAL, 9.20) +STEPMAKE_PROGS(EXTRACTPDFMARK, extractpdfmark, OPTIONAL) +req=`STEPMAKE_NUMERIC_VERSION(9.20)` +USE_EXTRACTPDFMARK=yes +if test "$GS920_VERSION" -lt "$req"; then + GS920= + USE_EXTRACTPDFMARK=no +fi +if test "$EXTRACTPDFMARK" != "extractpdfmark"; then + EXTRACTPDFMARK= + USE_EXTRACTPDFMARK=no +fi +if test "$USE_EXTRACTPDFMARK" != "yes"; then + STEPMAKE_ADD_ENTRY(OPTIONAL, + ["(Optionally using Ghostscript >= 9.20 together with"]) + STEPMAKE_ADD_ENTRY(OPTIONAL, + [" Extract PDFmark can significantly reduce the disk space required"]) + STEPMAKE_ADD_ENTRY(OPTIONAL, + [" for building the documentation and the final PDF files.)"]) +fi + STEPMAKE_PROGS(MAKEINFO, makeinfo, REQUIRED, 4.11) STEPMAKE_PROGS(TEXI2HTML, texi2html, $DOCUMENTATION_REQUIRED, 1.82) STEPMAKE_PROGS(DBLATEX, dblatex, $DOCUMENTATION_REQUIRED, 0.1.4) diff --git a/input/regression/one-page-breaking.ly b/input/regression/one-page-breaking.ly new file mode 100644 index 0000000000..5f663a6ad6 --- /dev/null +++ b/input/regression/one-page-breaking.ly @@ -0,0 +1,14 @@ +\version "2.19.36" + +\header { + texidoc = "The @var{ly:one-page-breaking} algorithm puts everything +on one page by adjusting the page-height to fit the content. +" +} + +\paper { + paper-width = 120 + page-breaking = #ly:one-page-breaking +} + +\include "typography-demo.ly" diff --git a/lily/include/one-page-breaking.hh b/lily/include/one-page-breaking.hh new file mode 100644 index 0000000000..def8715217 --- /dev/null +++ b/lily/include/one-page-breaking.hh @@ -0,0 +1,37 @@ +/* + This file is part of LilyPond, the GNU music typesetter. + + Copyright (C) 2016 Paul Morris + + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . +*/ + +#ifndef ONE_PAGE_BREAKING_HH +#define ONE_PAGE_BREAKING_HH + +#include "page-breaking.hh" +#include "page-spacing.hh" + +class One_page_breaking: public Page_breaking +{ +public: + virtual SCM solve (); + + One_page_breaking (Paper_book *pb); + virtual ~One_page_breaking (); +private: + SCM read_spacing_alist (SCM spec, SCM sym); +}; + +#endif /* ONE_PAGE_BREAKING_HH */ diff --git a/lily/one-page-breaking.cc b/lily/one-page-breaking.cc new file mode 100644 index 0000000000..6962aaf205 --- /dev/null +++ b/lily/one-page-breaking.cc @@ -0,0 +1,174 @@ +/* + This file is part of LilyPond, the GNU music typesetter. + + Copyright (C) 2016 Paul Morris + + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . +*/ + +#include "international.hh" +#include "one-page-breaking.hh" +#include "output-def.hh" +#include "page-spacing.hh" +#include "paper-book.hh" +#include "paper-score.hh" +#include "system.hh" + +One_page_breaking::One_page_breaking (Paper_book *pb) + : Page_breaking (pb, 0, 0) +{ +} + +One_page_breaking::~One_page_breaking () +{ +} + +SCM +One_page_breaking::read_spacing_alist (SCM spec, SCM sym) +{ + SCM pair = scm_sloppy_assq (sym, spec); + if (scm_is_pair (pair) && scm_is_number (scm_cdr (pair))) + return scm_cdr (pair); + else + return scm_from_int (0); +} + +/* + This is a somewhat unconventional page-breaking algorithm. The + @code{paper-height} setting (in the paper block) is automatically + modified to fit the height of the content so that everything exactly + fits on a single page with no compression. As usual (in the paper + block) the width of the page can be customized with + @code{paper-width} or @code{set-paper-size}, and the spacing between + the footer and the last system (or top level markup) can be customized + with @code{last-bottom-spacing}. + + It works by (1) temporarily setting the page height to a very large + value, (2) doing line breaking and page breaking, much like in + @code{ly:minimal-line-breaking}, (3) calculate and set the final + height of the page based on the results, taking last-bottom-spacing, + footer, top and bottom margins, etc. into account. +*/ +SCM +One_page_breaking::solve () +{ + // TEMPORARILY SET VERY LARGE PAPER HEIGHT + // Stencil::translate throws a programming error (for the tagline + // position) if this is set any larger than 1e6 + book_->paper_->set_variable (ly_symbol2scm ("paper-height"), scm_from_double (1e6)); + + // LINE BREAKING + message (_ ("Calculating line breaks...")); + vsize end = last_break_position (); + set_to_ideal_line_configuration (0, end); + break_into_pieces (0, end, current_configuration (0)); + + // PAGE BREAKING + message (_ ("Fitting music on 1 page...")); + vsize first_page_num = robust_scm2int (book_->paper_->c_variable ("first-page-number"), 1); + Page_spacing_result res = space_systems_on_n_pages (0, 1, first_page_num); + SCM lines = systems (); + SCM pages = make_pages (res.systems_per_page_, lines); + + // GET VERTICAL POSITIONS + // Larger values are lower on the page. We can't just use the last + // one, because the last does not necessarily have the lowest bound. + vector line_posns; + SCM lowest_line_pos = scm_from_int (0); + + Prob *page_pb = unsmob (scm_car (pages)); + SCM config = page_pb->internal_get_property (ly_symbol2scm ("configuration")); + + for (SCM c = config; scm_is_pair (c); c = scm_cdr (c)) + { + SCM this_pos = scm_car (c); + line_posns.push_back (scm_to_double (this_pos)); + if (scm_gr_p (this_pos, lowest_line_pos)) + lowest_line_pos = this_pos; + } + + // CALCULATE THE LOWEST LOWER BOUND OF ALL LINES ON THE PAGE + vector line_heights; + for (vsize i = 0; i < system_specs_.size (); i++) + { + if (Paper_score *ps = system_specs_[i].pscore_) + { + // musical systems + vsize broken_intos_size = ps->root_system ()->broken_intos_.size (); + for (vsize s = 0; s < broken_intos_size; s++) + { + Grob *system = ps->root_system ()->broken_intos_[s]; + line_heights.push_back (system->extent (system, Y_AXIS).length ()); + } + } + else if (Prob *pb = system_specs_[i].prob_) + { + // top-level markups + Stencil *stil = unsmob (pb->internal_get_property (ly_symbol2scm ("stencil"))); + line_heights.push_back (stil->extent (Y_AXIS).length ()); + } + } + + Real lowest_bound = 0; + for (vsize i = 0; i < line_heights.size (); i++) + { + Real low_bound = line_heights[i] + line_posns[i]; + if (low_bound > lowest_bound) + lowest_bound = low_bound; + } + + // HANDLE LAST-BOTTOM-SPACING + SCM last_bottom = book_->paper_->c_variable ("last-bottom-spacing"); + + SCM padding = read_spacing_alist (last_bottom, ly_symbol2scm("padding")); + lowest_bound += scm_to_double (padding); + + SCM basic_dist = read_spacing_alist (last_bottom, ly_symbol2scm("basic-distance")); + SCM minimum_dist = read_spacing_alist (last_bottom, ly_symbol2scm("minimum-distance")); + SCM max_dist = scm_max (basic_dist, minimum_dist); + + // If the last line is a musical system get the distance between its + // refpoint and its upper bound. If it is a top level markup its + // refpoint is 0. + SCM refpoint_dist = scm_from_int (0); + + SCM lines_probs = page_pb->internal_get_property (ly_symbol2scm ("lines")); + Prob *last_line_pb = unsmob (scm_list_ref (lines_probs, scm_oneminus (scm_length (lines_probs)))); + + SCM refpoint_extent = last_line_pb->internal_get_property (ly_symbol2scm ("staff-refpoint-extent")); + + if (scm_is_pair (refpoint_extent) && scm_is_number (scm_car (refpoint_extent))) + refpoint_dist = scm_product (scm_car (refpoint_extent), scm_from_int (-1)); + + Real last_bottom_bound = scm_to_double (scm_sum (lowest_line_pos, scm_sum (refpoint_dist, max_dist))); + if (last_bottom_bound > lowest_bound) + lowest_bound = last_bottom_bound; + + // SET FINAL PAPER HEIGHT + Stencil *foot_stil = unsmob (page_pb->internal_get_property (ly_symbol2scm ("foot-stencil"))); + Real foot_height = foot_stil->extent (Y_AXIS).length (); + + SCM top_margin = book_->paper_->c_variable ("top-margin"); + SCM bottom_margin = book_->paper_->c_variable ("bottom-margin"); + SCM margins = scm_sum (top_margin, bottom_margin); + + SCM ppr_height = scm_sum (margins, scm_from_double (lowest_bound + foot_height)); + + book_->paper_->set_variable (ly_symbol2scm ("paper-height"), ppr_height); + + // bottom-edge determines placement of footer (tagline, footnotes, etc.) + page_pb->set_property ("bottom-edge", scm_difference (ppr_height, bottom_margin)); + + return pages; +} diff --git a/lily/page-breaking-scheme.cc b/lily/page-breaking-scheme.cc index 0c806493b4..d9e62fa4fe 100644 --- a/lily/page-breaking-scheme.cc +++ b/lily/page-breaking-scheme.cc @@ -21,6 +21,7 @@ #include "page-turn-page-breaking.hh" #include "one-line-page-breaking.hh" #include "one-line-auto-height-breaking.hh" +#include "one-page-breaking.hh" #include "optimal-page-breaking.hh" #include "minimal-page-breaking.hh" @@ -54,6 +55,16 @@ LY_DEFINE (ly_minimal_breaking, "ly:minimal-breaking", return b.solve (); } +LY_DEFINE (ly_one_page_breaking, "ly:one-page-breaking", + 1, 0, 0, (SCM pb), + "Put each score on a single page. The paper-height settings" + " are modified so each score fits on one page, and the" + " height of the page matches the height of the full score.") +{ + One_page_breaking b (unsmob (pb)); + return b.solve (); +} + LY_DEFINE (ly_one_line_breaking, "ly:one-line-breaking", 1, 0, 0, (SCM pb), "Put each score on a single line, and put each line on its own" diff --git a/ly/Welcome-to-LilyPond-MacOS.ly b/ly/Welcome-to-LilyPond-MacOS.ly index ea56eb9504..f18b73e77f 100644 --- a/ly/Welcome-to-LilyPond-MacOS.ly +++ b/ly/Welcome-to-LilyPond-MacOS.ly @@ -23,7 +23,7 @@ That's it. For more information, visit http://lilypond.org . %} -\version "2.19.51" % necessary for upgrading to future LilyPond versions. +\version "2.19.52" % necessary for upgrading to future LilyPond versions. \header{ title = "A scale in LilyPond" diff --git a/ly/Welcome_to_LilyPond.ly b/ly/Welcome_to_LilyPond.ly index 8bdd018636..cfca7fe331 100644 --- a/ly/Welcome_to_LilyPond.ly +++ b/ly/Welcome_to_LilyPond.ly @@ -32,7 +32,7 @@ Good luck with LilyPond! Happy engraving. %} -\version "2.19.51" % necessary for upgrading to future LilyPond versions. +\version "2.19.52" % necessary for upgrading to future LilyPond versions. \header{ title = "A scale in LilyPond" diff --git a/ly/performer-init.ly b/ly/performer-init.ly index 644a0bd2d6..419d52baa5 100644 --- a/ly/performer-init.ly +++ b/ly/performer-init.ly @@ -246,7 +246,6 @@ \accepts Lyrics \accepts MensuralStaff \accepts NoteNames - \accepts NullVoice \accepts OneStaff \accepts PetrucciStaff \accepts PianoStaff @@ -311,6 +310,7 @@ \accepts ChordNames \accepts FiguredBass \accepts DrumStaff + \accepts Dynamics \accepts GrandStaff \accepts Lyrics \accepts OneStaff diff --git a/make/lilypond-book-rules.make b/make/lilypond-book-rules.make index 3dda429003..e0c0756bc4 100644 --- a/make/lilypond-book-rules.make +++ b/make/lilypond-book-rules.make @@ -27,6 +27,12 @@ $(outdir)/%.tex: %.latex ifeq (,$(findstring pdflatex,$(MISSING_OPTIONAL))) $(outdir)/%.pdf: $(outdir)/%.tex cd $(outdir) && $(buildscript-dir)/run-and-check "$(PDFLATEX) -halt-on-error $(notdir $<)" "$*.pdflatex.log" +ifeq ($(USE_EXTRACTPDFMARK),yes) + $(EXTRACTPDFMARK) -o $(outdir)/$*.pdfmark $@ + $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@ + rm $@ + mv $(outdir)/$*.final.pdf $@ +endif endif ############## Texinfo ###################### @@ -53,4 +59,10 @@ $(outdir)/%.xml: %.lyxml ifeq (,$(findstring dblatex,$(MISSING_OPTIONAL))) $(outdir)/%.pdf: $(outdir)/%.xml cd $(outdir) && $(buildscript-dir)/run-and-check "$(DBLATEX) $(DBLATEX_BACKEND) $(notdir $<)" "$*.dblatex.log" +ifeq ($(USE_EXTRACTPDFMARK),yes) + $(EXTRACTPDFMARK) -o $(outdir)/$*.pdfmark $@ + $(GS920) -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$(outdir)/$*.final.pdf -c "30000000 setvmthreshold" -f $(top-build-dir)/out-fonts/*.font.ps $(outdir)/$*.pdfmark $@ + rm $@ + mv $(outdir)/$*.final.pdf $@ +endif endif diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index e67a570c92..1fd163caa1 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -48,6 +48,12 @@ $(LANG_TEXIDOC_FLAGS) \ -ddump-signatures \ -danti-alias-factor=$(ANTI_ALIAS_FACTOR) +ifeq ($(USE_EXTRACTPDFMARK),yes) +LILYPOND_BOOK_LILYPOND_FLAGS+= \ +-dfont-export-dir=$(top-build-dir)/out-fonts \ +-dgs-never-embed-fonts +endif + ifdef QUIET_BUILD LILYPOND_BOOK_WARN = --loglevel=NONE else diff --git a/make/lysdoc-targets.make b/make/lysdoc-targets.make index 5290e3962f..547614cbd5 100644 --- a/make/lysdoc-targets.make +++ b/make/lysdoc-targets.make @@ -16,6 +16,10 @@ local-test: echo -e '\n\n\n' ; \ (cd $(top-src-dir) && git diff ) ; \ fi > $(outdir)/tree.gittxt +ifeq ($(USE_EXTRACTPDFMARK),yes) + $(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-fonts --header=texidoc -I $(top-src-dir)/Documentation/included/ -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1 -dfont-export-dir=$(top-build-dir)/out-fonts -dgs-never-embed-fonts" LILYPOND_BOOK_WARN= $(outdir)/collated-files.html LYS_OUTPUT_DIR=$(top-build-dir)/out/lybook-testdb +else $(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-lily-fonts --header=texidoc -I $(top-src-dir)/Documentation/included/ -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_WARN= $(outdir)/collated-files.html LYS_OUTPUT_DIR=$(top-build-dir)/out/lybook-testdb +endif rsync -L -a --exclude 'out-*' --exclude 'out' --exclude mf --exclude source --exclude mf $(top-build-dir)/out/share $(outdir) diff --git a/out/ChangeLog b/out/ChangeLog index db4dc38f8e..c836d2687d 100644 --- a/out/ChangeLog +++ b/out/ChangeLog @@ -1 +1 @@ -See http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=log;h=refs/tags/release/2.19.51-1 +See http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=log;h=refs/tags/release/2.19.52-1 diff --git a/out/RELEASE-COMMIT b/out/RELEASE-COMMIT index b668769f20..120b3abc58 100644 --- a/out/RELEASE-COMMIT +++ b/out/RELEASE-COMMIT @@ -1,32 +1,32 @@ -commit 083b99742f8089f5ad1018e7e69db1b947e7d736 +commit 1f42b413de732a86da5ecda7f809e24c74dbdb4a Author: Phil Holmes -Date: Sat Nov 19 13:48:32 2016 +0000 +Date: Sat Dec 3 12:30:56 2016 +0000 Release: bump Welcome versions. diff --git a/ly/Welcome-to-LilyPond-MacOS.ly b/ly/Welcome-to-LilyPond-MacOS.ly -index 6bdccfb..ea56eb9 100644 +index ea56eb9..f18b73e 100644 --- a/ly/Welcome-to-LilyPond-MacOS.ly +++ b/ly/Welcome-to-LilyPond-MacOS.ly @@ -23,7 +23,7 @@ That's it. For more information, visit http://lilypond.org . %} --\version "2.19.50" % necessary for upgrading to future LilyPond versions. -+\version "2.19.51" % necessary for upgrading to future LilyPond versions. +-\version "2.19.51" % necessary for upgrading to future LilyPond versions. ++\version "2.19.52" % necessary for upgrading to future LilyPond versions. \header{ title = "A scale in LilyPond" diff --git a/ly/Welcome_to_LilyPond.ly b/ly/Welcome_to_LilyPond.ly -index 922e638..8bdd018 100644 +index 8bdd018..cfca7fe 100644 --- a/ly/Welcome_to_LilyPond.ly +++ b/ly/Welcome_to_LilyPond.ly @@ -32,7 +32,7 @@ Good luck with LilyPond! Happy engraving. %} --\version "2.19.50" % necessary for upgrading to future LilyPond versions. -+\version "2.19.51" % necessary for upgrading to future LilyPond versions. +-\version "2.19.51" % necessary for upgrading to future LilyPond versions. ++\version "2.19.52" % necessary for upgrading to future LilyPond versions. \header{ title = "A scale in LilyPond" diff --git a/po/lilypond.pot b/po/lilypond.pot index 51868313a7..70330c6b40 100644 --- a/po/lilypond.pot +++ b/po/lilypond.pot @@ -6,10 +6,10 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: lilypond 2.19.51\n" +"Project-Id-Version: lilypond 2.19.52\n" "Report-Msgid-Bugs-To: http://post.gmane.org/post.php?group=gmane.comp.gnu." "lilypond.bugs\n" -"POT-Creation-Date: 2016-11-19 13:46+0000\n" +"POT-Creation-Date: 2016-12-03 12:27+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2581,7 +2581,8 @@ msgstr "" msgid "cannot write to file: `%s'" msgstr "" -#: minimal-page-breaking.cc:40 paper-score.cc:116 +#. LINE BREAKING +#: minimal-page-breaking.cc:40 one-page-breaking.cc:72 paper-score.cc:116 msgid "Calculating line breaks..." msgstr "" @@ -2628,6 +2629,11 @@ msgstr "" msgid "NoteEvent without pitch" msgstr "" +#. PAGE BREAKING +#: one-page-breaking.cc:78 optimal-page-breaking.cc:114 +msgid "Fitting music on 1 page..." +msgstr "" + #: open-type-font-scheme.cc:149 open-type-font-scheme.cc:195 #: open-type-font-scheme.cc:241 pfb-scheme.cc:60 ttf.cc:512 ttf.cc:561 msgid "font index must be non-negative, using index 0" @@ -2735,10 +2741,6 @@ msgid "" "systems-per-page" msgstr "" -#: optimal-page-breaking.cc:114 -msgid "Fitting music on 1 page..." -msgstr "" - #: optimal-page-breaking.cc:116 #, c-format msgid "Fitting music on %d pages..." diff --git a/stepmake/stepmake/texinfo-rules.make b/stepmake/stepmake/texinfo-rules.make index 4747347a90..007f88fdad 100644 --- a/stepmake/stepmake/texinfo-rules.make +++ b/stepmake/stepmake/texinfo-rules.make @@ -72,6 +72,12 @@ ifeq ($(WEB_VERSION),yes) else PDFTEX=$(PDFTEX) PDFLATEX=$(PDFLATEX) $(buildscript-dir)/run-and-check "cd $(outdir); texi2pdf $(TEXI2PDF_FLAGS) -I $(abs-src-dir) $(TEXINFO_PAPERSIZE_OPTION) $(