From db329c3acaee4d7d0e4b7efa6f8bef98f96aaf45 Mon Sep 17 00:00:00 2001 From: Andrew Hawryluk Date: Sat, 15 Jan 2011 13:42:03 -0700 Subject: [PATCH] Change keep-inside-line defaults to true. As discussed in Issue #1470, the default should be changed so that good layout with a slight performance hit is the default. --- Documentation/learning/tweaks.itely | 35 ------- Documentation/notation/text.itely | 7 +- Documentation/notation/vocal.itely | 8 +- Documentation/snippets/new/ancient-headword.ly | 8 -- Documentation/snippets/new/chords-headword.ly | 8 -- Documentation/snippets/new/editorial-headword.ly | 8 -- .../snippets/new/figured-bass-headword.ly | 8 -- Documentation/snippets/new/fretted-headword.ly | 2 - Documentation/snippets/new/pitches-headword.ly | 8 -- .../snippets/new/simultaneous-headword.ly | 9 -- Documentation/snippets/new/text-headword.ly | 8 -- Documentation/web/ly-examples/example-header.ily | 8 -- input/regression/balloon.ly | 19 +++- input/regression/font-bogus-ligature.ly | 13 ++- input/regression/font-family-override.ly | 32 ++++-- input/regression/font-name.ly | 1 + input/regression/hairpin-ending.ly | 1 + input/regression/harp-pedals-sanity-checks.ly | 1 + input/regression/harp-pedals-tweaking.ly | 1 + input/regression/lyric-extender-right-margin.ly | 3 +- input/regression/lyrics-no-notes.ly | 1 + input/regression/markup-commands.ly | 55 ++++++----- input/regression/markup-note.ly | 100 +++++++++++--------- input/regression/markup-syntax.ly | 88 ++++++++++-------- input/regression/markup-user.ly | 15 ++- input/regression/skyline-vertical-placement.ly | 1 + input/regression/spacing-stick-out.ly | 7 +- scm/define-grobs.scm | 2 + 28 files changed, 212 insertions(+), 245 deletions(-) diff --git a/Documentation/learning/tweaks.itely b/Documentation/learning/tweaks.itely index 844399d..99cfcf6 100644 --- a/Documentation/learning/tweaks.itely +++ b/Documentation/learning/tweaks.itely @@ -3422,7 +3422,6 @@ lhMusic = \relative c' { * Using variables for tweaks:: * Style sheets:: * Other sources of information:: -* Avoiding tweaks with slower processing:: * Advanced tweaks with Scheme:: @end menu @@ -4106,40 +4105,6 @@ interest are: @end multitable - address@hidden Avoiding tweaks with slower processing address@hidden Avoiding tweaks with slower processing - -LilyPond can perform extra checks while it processes input files. -These checks will take extra time to perform, but fewer manual tweaks -may be required to obtain an acceptable result. If a text script -or part of the lyrics extends over the margins these checks will -compress that line of the score just enough to fit within the -margins. - -To be effective under all circumstances these checks must be enabled -by placing the overrides using @code{\context} within a @code{\layout} -block, rather than in-line in music, as follows: - address@hidden -\score @{ - @{ @address@hidden @} - \layout @{ - \context @{ - \Score - % Makes sure text scripts and lyrics are within the paper margins - \override PaperColumn #'keep-inside-line = ##t - \override NonMusicalPaperColumn #'keep-inside-line = ##t - @} - @} address@hidden address@hidden example - -However, @code{keep-inside-line} is expensive and the recommendation -is to not enable it, to allow for faster processing, until creating -a final version. This way you do not need to manually add @code{\break} -commands to avoid text running off the right-hand side of the page. - @node Advanced tweaks with Scheme @subsection Advanced tweaks with Scheme diff --git a/Documentation/notation/text.itely b/Documentation/notation/text.itely index 6841e44..406f6be 100644 --- a/Documentation/notation/text.itely +++ b/Documentation/notation/text.itely @@ -123,12 +123,11 @@ Internals Reference: @knownissues Checking to make sure that text scripts and lyrics are within the -margins is a relatively large computational task. To speed up -processing, LilyPond does not perform such calculations by -default; to enable it, use +margins requires additonal calculations. In cases where slightly faster +performance is desired, use @example -\override Score.PaperColumn #'keep-inside-line = ##t +\override Score.PaperColumn #'keep-inside-line = ##f @end example diff --git a/Documentation/notation/vocal.itely b/Documentation/notation/vocal.itely index 02fbb7b..50e6c4a 100644 --- a/Documentation/notation/vocal.itely +++ b/Documentation/notation/vocal.itely @@ -1143,12 +1143,12 @@ To make this change for all lyrics in the score, set the property in the @c TODO: move to LSR -vv -Checking to make sure that text scripts and lyrics are within the -margins is a relatively large computational task. To speed up processing, -LilyPond does not perform such calculations by default; to enable it, use +Checking to make sure that text scripts and lyrics are within the margins +required additional calculations. To speed up processing slighty, this +feature can be disabled: @example -\override Score.PaperColumn #'keep-inside-line = ##t +\override Score.PaperColumn #'keep-inside-line = ##f @end example To make lyrics avoid bar lines as well, use diff --git a/Documentation/snippets/new/ancient-headword.ly b/Documentation/snippets/new/ancient-headword.ly index f7568d7..50a8ba8 100644 --- a/Documentation/snippets/new/ancient-headword.ly +++ b/Documentation/snippets/new/ancient-headword.ly @@ -14,14 +14,6 @@ doctitle = "headword" } -\layout { - \context { - \Score - \override PaperColumn #'keep-inside-line = ##t - \override NonMusicalPaperColumn #'keep-inside-line = ##t - } -} - \include "gregorian.ly" \score { diff --git a/Documentation/snippets/new/chords-headword.ly b/Documentation/snippets/new/chords-headword.ly index 5963f0f..d267d56 100644 --- a/Documentation/snippets/new/chords-headword.ly +++ b/Documentation/snippets/new/chords-headword.ly @@ -13,14 +13,6 @@ } -\layout { - \context { - \Score - \override PaperColumn #'keep-inside-line = ##t - \override NonMusicalPaperColumn #'keep-inside-line = ##t - } -} - theChords = \chordmode { \time 2/2 f1 | c2 f2 | f1 | c2 f2| %\break diff --git a/Documentation/snippets/new/editorial-headword.ly b/Documentation/snippets/new/editorial-headword.ly index 626605f..6ae939e 100644 --- a/Documentation/snippets/new/editorial-headword.ly +++ b/Documentation/snippets/new/editorial-headword.ly @@ -14,14 +14,6 @@ doctitle = "headword" } -\layout { - \context { - \Score - \override PaperColumn #'keep-inside-line = ##t - \override NonMusicalPaperColumn #'keep-inside-line = ##t - } -} - % NR 1.7 Editorial annotations % Beethoven, Op. 31, No. 3 diff --git a/Documentation/snippets/new/figured-bass-headword.ly b/Documentation/snippets/new/figured-bass-headword.ly index ad04108..469e72f 100644 --- a/Documentation/snippets/new/figured-bass-headword.ly +++ b/Documentation/snippets/new/figured-bass-headword.ly @@ -6,14 +6,6 @@ indent = 1.5\cm } -\layout { - \context { - \Score - \override PaperColumn #'keep-inside-line = ##t - \override NonMusicalPaperColumn #'keep-inside-line = ##t - } -} - % NR 2.7.3 Figured bass diff --git a/Documentation/snippets/new/fretted-headword.ly b/Documentation/snippets/new/fretted-headword.ly index 32fafd0..3b221cb 100644 --- a/Documentation/snippets/new/fretted-headword.ly +++ b/Documentation/snippets/new/fretted-headword.ly @@ -22,8 +22,6 @@ \context { \Score \remove "Bar_number_engraver" - \override PaperColumn #'keep-inside-line = ##t - \override NonMusicalPaperColumn #'keep-inside-line = ##t } } diff --git a/Documentation/snippets/new/pitches-headword.ly b/Documentation/snippets/new/pitches-headword.ly index 8cc3eca..9c78f06 100644 --- a/Documentation/snippets/new/pitches-headword.ly +++ b/Documentation/snippets/new/pitches-headword.ly @@ -7,14 +7,6 @@ indent = 0\cm } -\layout { - \context { - \Score - \override PaperColumn #'keep-inside-line = ##t - \override NonMusicalPaperColumn #'keep-inside-line = ##t - } -} - % NR 1.1 Pitches \header { diff --git a/Documentation/snippets/new/simultaneous-headword.ly b/Documentation/snippets/new/simultaneous-headword.ly index 09ffbe0..caff63a 100644 --- a/Documentation/snippets/new/simultaneous-headword.ly +++ b/Documentation/snippets/new/simultaneous-headword.ly @@ -7,15 +7,6 @@ indent = 0\cm } -\layout { - \context { - \Score - \override PaperColumn #'keep-inside-line = ##t - \override NonMusicalPaperColumn #'keep-inside-line = ##t - } -} - - \header { lsrtags = "headwords" texidoc = "" diff --git a/Documentation/snippets/new/text-headword.ly b/Documentation/snippets/new/text-headword.ly index 58a410f..10931fc 100644 --- a/Documentation/snippets/new/text-headword.ly +++ b/Documentation/snippets/new/text-headword.ly @@ -13,14 +13,6 @@ doctitle = "headword" } -\layout { - \context { - \Score - \override PaperColumn #'keep-inside-line = ##t - \override NonMusicalPaperColumn #'keep-inside-line = ##t - } -} - % NR 1.8 Text % L. v. Beethoven, Op. 110 diff --git a/Documentation/web/ly-examples/example-header.ily b/Documentation/web/ly-examples/example-header.ily index 0817b74..ab35243 100644 --- a/Documentation/web/ly-examples/example-header.ily +++ b/Documentation/web/ly-examples/example-header.ily @@ -10,11 +10,3 @@ scoreTitleMarkup = ##f } -\layout { - \context { \Score - \override PaperColumn #'keep-inside-line = ##t - \override NonMusicalPaperColumn #'keep-inside-line = ##t - } -} - - diff --git a/input/regression/balloon.ly b/input/regression/balloon.ly index a60f89e..3a85fed 100644 --- a/input/regression/balloon.ly +++ b/input/regression/balloon.ly @@ -9,10 +9,19 @@ with lines and explanatory text added." \layout{ ragged-right = ##t } -\new Voice \with {\consists "Balloon_engraver" } -{ - \relative c' { - \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" } - 8 +\score{ + \new Voice \with {\consists "Balloon_engraver" } + { + \relative c' { + \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" } + 8 + } + } + + \layout { + \context { + \Score + \override PaperColumn #'keep-inside-line = ##f + } } } diff --git a/input/regression/font-bogus-ligature.ly b/input/regression/font-bogus-ligature.ly index b5abe6c..1e46da7 100644 --- a/input/regression/font-bogus-ligature.ly +++ b/input/regression/font-bogus-ligature.ly @@ -11,6 +11,15 @@ This may happen with incorrect font versions. ragged-right = ##T } -{ - c4^"November WHITMAN" +\score{ + { + c4^"November WHITMAN" + } + + \layout { + \context { + \Score + \override PaperColumn #'keep-inside-line = ##f + } + } } diff --git a/input/regression/font-family-override.ly b/input/regression/font-family-override.ly index 553747d..45629a2 100644 --- a/input/regression/font-family-override.ly +++ b/input/regression/font-family-override.ly @@ -34,19 +34,29 @@ (/ myStaffSize 20))) } -\relative c'' { - - c^\markup { roman: foo \bold bla \italic bar \italic \bold baz } - c'_\markup { - \override #'(font-family . sans) - { - sans: foo \bold bla \italic bar \italic \bold baz +\score { + \relative c'' { + + c^\markup { roman: foo \bold bla \italic bar \italic \bold baz } + c'_\markup { + \override #'(font-family . sans) + { + sans: foo \bold bla \italic bar \italic \bold baz + } + } + c'^\markup { + \override #'(font-family . typewriter) + { + mono: foo \bold bla \italic bar \italic \bold baz + } } } - c'^\markup { - \override #'(font-family . typewriter) - { - mono: foo \bold bla \italic bar \italic \bold baz + + \layout { + \context { + \Score + \override PaperColumn #'keep-inside-line = ##f } } + } diff --git a/input/regression/font-name.ly b/input/regression/font-name.ly index 062f2f7..2e5eabf 100644 --- a/input/regression/font-name.ly +++ b/input/regression/font-name.ly @@ -13,6 +13,7 @@ without size specification." { + \override Score.PaperColumn #'keep-inside-line = ##f \override Staff.TimeSignature #'font-name = #"Times New Roman" \time 3/4 \set Score.skipBars = ##t diff --git a/input/regression/hairpin-ending.ly b/input/regression/hairpin-ending.ly index a5e33c4..92648d2 100644 --- a/input/regression/hairpin-ending.ly +++ b/input/regression/hairpin-ending.ly @@ -12,6 +12,7 @@ into them." \layout { ragged-right = ##t } \relative c'' { + \override Score.PaperColumn #'keep-inside-line = ##f c4 \> c4 c4\! c4_\ff \> c4 c4\!\p << diff --git a/input/regression/harp-pedals-sanity-checks.ly b/input/regression/harp-pedals-sanity-checks.ly index c918ddb..60ba821 100644 --- a/input/regression/harp-pedals-sanity-checks.ly +++ b/input/regression/harp-pedals-sanity-checks.ly @@ -9,6 +9,7 @@ a warning is printed out, but they should still look okay." } \relative c'' { + \override Score.PaperColumn #'keep-inside-line = ##f % Sanity checks: #pedals != 7: c1^\markup \harp-pedal #"^-v|--" % Sanity checks: no divider, multiple dividers, divider on wrong position: diff --git a/input/regression/harp-pedals-tweaking.ly b/input/regression/harp-pedals-tweaking.ly index ad3f955..8b64e78 100644 --- a/input/regression/harp-pedals-tweaking.ly +++ b/input/regression/harp-pedals-tweaking.ly @@ -6,6 +6,7 @@ harp-pedal-details properties of TextScript." } \relative c'' { + \override Score.PaperColumn #'keep-inside-line = ##f \override Voice.TextScript #'(harp-pedal-details box-width) = #1 \once \override Voice.TextScript #'size = #1.5 \once \override Voice.TextScript #'thickness = #7 diff --git a/input/regression/lyric-extender-right-margin.ly b/input/regression/lyric-extender-right-margin.ly index 0317b53..9d76be3 100644 --- a/input/regression/lyric-extender-right-margin.ly +++ b/input/regression/lyric-extender-right-margin.ly @@ -6,7 +6,6 @@ \score{ { \relative c' { - \override Score.PaperColumn #'keep-inside-line = ##t c4 d e f ~ | \break f4 e d c | } @@ -16,4 +15,4 @@ e d c } } -} \ No newline at end of file +} diff --git a/input/regression/lyrics-no-notes.ly b/input/regression/lyrics-no-notes.ly index 3c6ef07..69e8d9c 100644 --- a/input/regression/lyrics-no-notes.ly +++ b/input/regression/lyrics-no-notes.ly @@ -8,6 +8,7 @@ paper column is very wide." \version "2.12.0" << + \override Score.PaperColumn #'keep-inside-line = ##f \new Staff \relative c' { \key aes \major \context Voice = "1" { diff --git a/input/regression/markup-commands.ly b/input/regression/markup-commands.ly index 688cd2e..b8f947d 100644 --- a/input/regression/markup-commands.ly +++ b/input/regression/markup-commands.ly @@ -7,31 +7,40 @@ \paper { ragged-right = ##T } \version "2.12.0" -{ - g'_\markup { - \column { - \line { - foo \magnify #2 foo - LOWER \lower #3 LOWER - \large \bold { normal \normal-text normal } - Small-Caps \smallCaps Small-Caps - } - - \override #'(line-width . 50) - \override #'(bla . "This is a field containing text. Blah blah -blah. This is a field containing text. Blah blah blah. This is a -field containing text. Blah blah blah. This is a field containing -text. Blah blah blah. This is a field containing text. Blah blah -blah.") - \column { - justify: - \justify-field #'bla - wordwrap: - \wordwrap-field #'bla +\score{ + { + g'_\markup { + \column { + \line { + foo \magnify #2 foo + LOWER \lower #3 LOWER + \large \bold { normal \normal-text normal } + Small-Caps \smallCaps Small-Caps + } + + \override #'(line-width . 50) + \override #'(bla . "This is a field containing text. Blah blah + blah. This is a field containing text. Blah blah blah. This is a + field containing text. Blah blah blah. This is a field containing + text. Blah blah blah. This is a field containing text. Blah blah + blah.") + \column { + justify: + \justify-field #'bla + wordwrap: + \wordwrap-field #'bla + } + + draw-line: \draw-line #'(5 . 3) + \underline "underlined" } + } + } - draw-line: \draw-line #'(5 . 3) - \underline "underlined" + \layout { + \context { + \Score + \override PaperColumn #'keep-inside-line = ##f } } } diff --git a/input/regression/markup-note.ly b/input/regression/markup-note.ly index 0cdc526..1cda8b3 100644 --- a/input/regression/markup-note.ly +++ b/input/regression/markup-note.ly @@ -5,52 +5,62 @@ } \version "2.12.0" -\relative c'' -{ - c4^\markup { - \note #"1" #1 - \note #"2" #1 - \note #"4" #1 - \note #"8" #1 - \note #"16" #1 - \note #"32" #1 - \note #"64" #1 - - \note #"1" #-1 - \note #"2" #-1 - \note #"4" #-1 - \note #"8" #-1 - \note #"16" #-1 - \note #"32" #-1 - \note #"64" #-1 - - \note #"1." #-1 - \note #"2." #-1 - \note #"4." #-1 - \note #"8." #-1 - \note #"16." #-1 - \note #"32." #-1 - \note #"64." #-1 - - \note #"1." #1 - \note #"2." #1 - \note #"4." #1 - \note #"8." #1 - \note #"16." #1 - \note #"32." #1 - \note #"64." #1 - - \override #'(style . cross) - { \note-by-number #2 #1 #1 - \note-by-number #2 #1 #-1 - } - \override #'(style . triangle) - { \note-by-number #2 #1 #1 - \note-by-number #2 #1 #-1 +\score { + \relative c'' + { + c4^\markup { + \note #"1" #1 + \note #"2" #1 + \note #"4" #1 + \note #"8" #1 + \note #"16" #1 + \note #"32" #1 + \note #"64" #1 + + \note #"1" #-1 + \note #"2" #-1 + \note #"4" #-1 + \note #"8" #-1 + \note #"16" #-1 + \note #"32" #-1 + \note #"64" #-1 + + \note #"1." #-1 + \note #"2." #-1 + \note #"4." #-1 + \note #"8." #-1 + \note #"16." #-1 + \note #"32." #-1 + \note #"64." #-1 + + \note #"1." #1 + \note #"2." #1 + \note #"4." #1 + \note #"8." #1 + \note #"16." #1 + \note #"32." #1 + \note #"64." #1 + + \override #'(style . cross) + { \note-by-number #2 #1 #1 + \note-by-number #2 #1 #-1 + } + \override #'(style . triangle) + { \note-by-number #2 #1 #1 + \note-by-number #2 #1 #-1 + } + } + \override NoteHead #'style = #'triangle + c4 a } - \override NoteHead #'style = #'triangle - c4 a -} + \layout { + \context { + \Score + \override PaperColumn #'keep-inside-line = ##f + } + } + +} diff --git a/input/regression/markup-syntax.ly b/input/regression/markup-syntax.ly index 8a59a45..73b9cff 100644 --- a/input/regression/markup-syntax.ly +++ b/input/regression/markup-syntax.ly @@ -4,48 +4,58 @@ texidoc = "Demo of markup texts, using LilyPond syntax." } -{ - f'1-\markup { - foo - \raise #0.2 \hbracket \bold bar +\score { + { + f'1-\markup { + foo + \raise #0.2 \hbracket \bold bar - \override #'(baseline-skip . 4) - \bracket \column { - baz - bazr - bla + \override #'(baseline-skip . 4) + \bracket \column { + baz + bazr + bla + } + \hspace #2.0 + \override #'(font-encoding . fetaMusic) { + \lookup #"noteheads-0" + } + \semiflat + { } + \combine "X" "+" + \combine "o" "/" } - \hspace #2.0 - \override #'(font-encoding . fetaMusic) { - \lookup #"noteheads-0" + g'1-\markup { + % \char-number #"abc1234abc" + \box \column { + \line { "string 1" } + \line { "string 2" } + \concat { "f" "i" } + } + " " + \draw-circle #1 #0.3 ##f + " " + \draw-circle #1 #0.3 ##t + " " + \italic Norsk + \super "2" + " " + \raise #3.0 \whiteout white-out + \circle \dynamic p + \with-color #green Green + \dynamic sfzp + \huge { "A" \smaller "A" \smaller \smaller "A" + \smaller \smaller \smaller "A" } + \sub "alike" } - \semiflat - { } - \combine "X" "+" - \combine "o" "/" + c''4 } - g'1-\markup { - % \char-number #"abc1234abc" - \box \column { - \line { "string 1" } - \line { "string 2" } - \concat { "f" "i" } + + \layout { + \context { + \Score + \override PaperColumn #'keep-inside-line = ##f } - " " - \draw-circle #1 #0.3 ##f - " " - \draw-circle #1 #0.3 ##t - " " - \italic Norsk - \super "2" - " " - \raise #3.0 \whiteout white-out - \circle \dynamic p - \with-color #green Green - \dynamic sfzp - \huge { "A" \smaller "A" \smaller \smaller "A" - \smaller \smaller \smaller "A" } - \sub "alike" - } - c''4 + } + } diff --git a/input/regression/markup-user.ly b/input/regression/markup-user.ly index 6377347..63b1450 100644 --- a/input/regression/markup-user.ly +++ b/input/regression/markup-user.ly @@ -15,10 +15,17 @@ the @code{define-markup-command} scheme macro." "Upcase the string characters. Syntax: \\upcase #\"string\"" (interpret-markup paper props (make-simple-markup (string-upcase str)))) - -{ - c''-\markup \upcase #"hello world" +\score{ + { + c''-\markup \upcase #"hello world" % produces a "HELLO WORLD" markup -} + } + \layout { + \context { + \Score + \override PaperColumn #'keep-inside-line = ##f + } + } +} diff --git a/input/regression/skyline-vertical-placement.ly b/input/regression/skyline-vertical-placement.ly index 731db4f..b01a8a3 100644 --- a/input/regression/skyline-vertical-placement.ly +++ b/input/regression/skyline-vertical-placement.ly @@ -7,6 +7,7 @@ using a skyline algorithm so that they don't collide with other objects." \version "2.12.0" \relative c''' { + \override Score.PaperColumn #'keep-inside-line = ##f \override TextScript #'outside-staff-priority = #2 \override DynamicLineSpanner #'outside-staff-priority = #1 c diff --git a/input/regression/spacing-stick-out.ly b/input/regression/spacing-stick-out.ly index b042ae1..099ae34 100644 --- a/input/regression/spacing-stick-out.ly +++ b/input/regression/spacing-stick-out.ly @@ -1,9 +1,9 @@ \header { - texidoc = "If @code{keep-inside-line} is set for the relevant - PaperColumn, LilyPond will space a line to prevent text sticking out - of the right margin." + texidoc = "LilyPond will space a line to prevent text sticking out of the + right margin unless @code{keep-inside-line} is false for the relevant + PaperColumn." } @@ -12,7 +12,6 @@ \layout { ragged-right = ##t } \relative c' { - \override Score.PaperColumn #'keep-inside-line = ##t c1 c1^"This is a really long text" c } diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 15a2695..165eed5 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1324,6 +1324,7 @@ (skyline-vertical-padding . 0.6) ;; (stencil . ,ly:paper-column::print) + (keep-inside-line . #t) (line-break-permission . allow) (non-musical . #t) (page-break-permission . allow) @@ -1461,6 +1462,7 @@ (axes . (,X)) (before-line-breaking . ,ly:paper-column::before-line-breaking) (horizontal-skylines . ,ly:separation-item::calc-skylines) + (keep-inside-line . #t) ;; (stencil . ,ly:paper-column::print) (X-extent . ,ly:axis-group-interface::width) -- 1.7.1