]> git.donarmstrong.com Git - lilypond.git/blobdiff - ly/property-init.ly
Merge remote branch 'origin/master' into release/unstable
[lilypond.git] / ly / property-init.ly
index 42a1d5100c8c2732ed72ac729fa0fe90e8124fe0..ef1bea45deede7a3edcad72d6e10b9bd6c75658d 100644 (file)
@@ -196,17 +196,6 @@ easyHeadsOff = {
 }
 
 
-%% endincipit
-
-%% End the incipit and print a ``normal line start''.
-endincipit = \context Staff {
-  \partial 16 s16  % Hack to handle e.g. \bar ".|" \endincipit
-  \once \override Staff.Clef.full-size-change = ##t
-  \once \override Staff.Clef.non-default = ##t
-  \bar ""
-}
-
-
 %% fermata markup
 
 fermataMarkup =
@@ -273,16 +262,66 @@ unHideNotes = {
 improvisationOn = {
   \set squashedPosition = #0
   \override NoteHead.style = #'slash
+  \override TabNoteHead.style = #'slash
   \override Accidental.stencil = ##f
   \override AccidentalCautionary.stencil = ##f
 }
 improvisationOff = {
   \unset squashedPosition
   \revert NoteHead.style
+  \revert TabNoteHead.style
   \revert Accidental.stencil
   \revert AccidentalCautionary.stencil
 }
 
+%% incipit
+
+incipit =
+#(define-music-function (parser location incipit-music) (ly:music?)
+  #{
+    \once \override Staff.InstrumentName.stencil =
+      #(lambda (grob)
+        (let* ((instrument-name (ly:grob-property grob 'long-text))
+               (align-x (ly:grob-property grob 'self-alignment-X 0))
+               (align-y (ly:grob-property grob 'self-alignment-Y 0)))
+        (set! (ly:grob-property grob 'long-text)
+          #{ \markup {
+            \score
+            {
+              \new MensuralStaff \with {
+                \override InstrumentName.self-alignment-X = #align-x
+                \override InstrumentName.self-alignment-Y = #align-y
+                instrumentName = #instrument-name
+              }
+              {
+                $incipit-music
+              }
+              \layout {
+                $(ly:grob-layout grob)
+                indent-incipit-default = 15\mm
+                line-width = #(primitive-eval
+                  '(or (false-if-exception indent)
+                    indent-incipit-default))
+                indent = #(primitive-eval
+                           '(or (false-if-exception (- line-width incipit-width))
+                            (* 0.5 line-width)))
+                ragged-right = ##f
+                ragged-last = ##f
+                system-count = 1
+                \context {
+                  \Score
+                  \remove "Default_bar_line_engraver"
+                }
+              }
+            }
+            }
+          #})
+          (set! (ly:grob-property grob 'self-alignment-Y) #f)
+          (set! (ly:grob-property grob 'self-alignment-X) RIGHT)
+          (system-start-text::print grob)))
+  #}
+)
+
 %% kievan
 kievanOn = {
  \override NoteHead.style = #'kievan
@@ -313,6 +352,24 @@ kievanOff = {
  \revert NoteHead.duration-log
 }
 
+%% line and page breaking controls
+
+autoLineBreaksOff = {
+  \overrideProperty Score.NonMusicalPaperColumn.line-break-permission ##f
+  \override Score.NonMusicalPaperColumn.line-break-permission = ##f
+}
+autoLineBreaksOn = {
+  \overrideProperty Score.NonMusicalPaperColumn.line-break-permission #'allow
+  \override Score.NonMusicalPaperColumn.line-break-permission = #'allow
+}
+autoPageBreaksOff =
+  \override Score.NonMusicalPaperColumn.page-break-permission = ##f
+autoPageBreaksOn =
+  \override Score.NonMusicalPaperColumn.page-break-permission = #'allow
+autoBreaksOff = { \autoLineBreaksOff \autoPageBreaksOff }
+autoBreaksOn = { \autoLineBreaksOn \autoPageBreaksOn }
+
+
 %% merging
 
 mergeDifferentlyDottedOn =
@@ -425,10 +482,10 @@ walkerHeadsMinor =
 
 %% shifts
 
+shiftOff  = \override NoteColumn.horizontal-shift = #0
 shiftOn   = \override NoteColumn.horizontal-shift = #1
 shiftOnn  = \override NoteColumn.horizontal-shift = #2
 shiftOnnn = \override NoteColumn.horizontal-shift = #3
-shiftOff  = \revert NoteColumn.horizontal-shift
 
 
 %% slurs
@@ -470,6 +527,22 @@ stemDown    = \override Stem.direction = #DOWN
 stemNeutral = \revert Stem.direction
 
 
+%% string numbers
+
+romanStringNumbers  = {
+  \override StringNumber.number-type = #'roman-upper
+  \override StringNumber.stencil = #ly:text-interface::print
+  \override StringNumber.font-encoding = #'latin1
+  \override StringNumber.font-shape = #'italic
+}
+arabicStringNumbers = {
+  \revert StringNumber.number-type
+  \revert StringNumber.stencil
+  \revert StringNumber.font-encoding
+  \revert StringNumber.font-shape
+}
+
+
 %% tablature
 
 % switch to full notation