From: Jan Nieuwenhuizen Date: Wed, 21 Feb 2001 20:03:54 +0000 (+0100) Subject: patch::: 1.3.130.jcn1 X-Git-Tag: release/1.3.131~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6f96331d77b66f223cd9f4f68b857b53a2dd6c03;p=lilypond.git patch::: 1.3.130.jcn1 1.3.130.jcn1 ============ * Bugfix: don't display repeat colons for zero height bar lines; fixes repeat barlines in lyrics. * Fixed markup definition and implementation, added baseline-skip property; this makes multi-line markup text a lot easier. * Bugfix: chordChanges works with other rhythm of accompaniment, and silly chord name typo fixes. 1.3.130 ======= --- diff --git a/CHANGES b/CHANGES index 3f03f10d14..45130da126 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,17 @@ +1.3.130.jcn1 +============ + +* Bugfix: don't display repeat colons for zero height bar lines; fixes +repeat barlines in lyrics. + +* Fixed markup definition and implementation, added baseline-skip +property; this makes multi-line markup text a lot easier. + +* Bugfix: chordChanges works with other rhythm of accompaniment, and +silly chord name typo fixes. + +1.3.130 +======= 1.3.129.jcn2 ============ diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 6161f908d4..a5276db8cf 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -14,8 +14,6 @@ Rhythm staff (clef, x-notehead) - markup text - postscript, scheme output? (links to?) using/existance of ly2dvi, lilypond-book @@ -1175,14 +1173,15 @@ name of the corresponding symbol appearing underneath. @subsubsection Text scripts @cindex Text scripts -FIXME: markup - -In addition, it is possible to place arbitrary strings of text or -@TeX{} above or below notes by using a string instead of an -identifier: @code{c^"text"}. Fingerings -can be placed by simply using digits. All of these note ornaments -appear in the printed output but have no effect on the MIDI rendering of -the music. +In addition, it is possible to place arbitrary strings of text or markup +text (see @ref{Text markup}) above or below notes by using a string +instead of an identifier: @code{c^"text"}. It is possible to use @TeX{} +commands, but this should be avoided because this makes it impossible +for LilyPond to compute the exact length of the string, which may lead +to collisions. Also, @TeX{} commands won't work with direct postscript +output. Fingerings can be placed by simply using digits. All of these +note ornaments appear in the printed output but have no effect on the +MIDI rendering of the music. @c . {Fingerings} @unnumberedsubsubsec Fingerings @@ -3783,11 +3782,13 @@ Don't move the finger 2, only text "m.d." ... @menu -* Text markup:: +* Text markup:: @end menu @node Text markup @subsection Text markup +@cindex text markup +@cindex markup text LilyPond has an internal mechanism to typeset texts: you can form text markup expressions by composing scheme expressions @@ -3806,16 +3807,112 @@ in the following way: Formally, Scheme markup text is defined as follows: @example -text: string | (markup sentence) -sentence: text | sentence text -markup: property | abbrev | style +text: string | (head? text+) +head: markup | (markup+) +markup-item: property | abbrev | @var{fontstyle} property: (@var{key} . @var{value}) abbrev: @code{rows lines roman music bold italic named super sub text} -style: @var{fontstyle} @end example -The @var{key}-@var{value} pair is a grob property. [Why is this -useful?] The following abbreviations are currently defined: +The markup is broken down and converted into a list of grob properties, +which are prepended to the grop's property list. The +@var{key}-@var{value} pair is a grob property. +@ignore +[Why is this useful?] + +?Snapnie: markup text is eerste item dat voldoet aan mijn gewelfdige, +ideale idee van direct-en-eenmalig-per-item te zetten properties, ipv +gehaspel via \property en hopen dat je property (enkel) in juiste item +terecht gaat komen. Heb je deze wel bewust meegemaakt: + +Sender: jan@appel.lilypond.org +To: Han-Wen +Subject: (elt) properties +Organization: Jan at Appel +From: janneke@gnu.org +Date: 01 Nov 2000 10:39:10 +0100 +Message-ID: +User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Lines: 77 +Xref: appel.lilypond.org vers:1991 + +Hi, + +Wat ik vooral mis, is een koele manier om een propertie eenmalig aan +een element te hangen. Hoop dat je zinvol over wilt meedenken; zie +het monster van les-nereides. Misschien dat we 't niet moeten doen +voor 1.4 maar wachten tot properties nog wat verder +uitgekristalliseerd zijn? + +Nu moet je + + \property Voice.Stem \push #'length = #'6 + a + \property Voice.Stem \pop #'length + b + +waarmee je in feite zeg tegen de stem-engraver: vanaf nu aan moet je +alle stems 6 lang maken (maakt stem); onee, doe maar weer default +lengte. + +Maar dat is eigenlijk niet wat je bedoelt, wat je zou willen is net +zo'n directe interface als wat we nu hebben voor markup text, bv. iets +van: + + a+#'(Stem::length . 6) b + +Bij markup text kun je direct en eenmalig een reeks properties aan een +enkel item toevoegen; iets wat je volgens mij vaak nodig hebt. + +Ik zat eerst te denken aan ``request properties'': properties +toevoegen aan request, die dan worden doorgegeven aan alle items die +door dat request worden gemaakt. + +Maar misschien zuigt dat wel te vreselijk en moeten we iets van +``volatile'' properties maken. + +Btw, + + \property Voice.Slur \push #'dash = #1 + \property Voice.Slur \pop #'dash + a()b + \property Voice.Slur \push #'direction = #-1 + \property Voice.Slur \pop #'direction + ()c + +of de kluts waar ik brr van word, eigenlijk ook alleen doenbaar is +voor wat veelgebruikte properties: + + slurDotted = \property Voice.Slur \push #'dash = #1 + slurNoDots = \property Voice.Slur \pop #'dash + slurUp = \property Voice.Slur \push #'direction = #1 + slurDown = \property Voice.Slur \push #'direction = #-1 + slurBoth = \property Voice.Slur \pop #'direction + + [..] + + \slurDotted\slurDown + a()b + ()c + \slurNoDots\slurBoth + +zou toch graag meer iets in trant van, als je begrijpt wat ik bedoel + + Slur+#'((dash . 1) (direction . 1)) + b () c + Slur-#'(dash direction) + +ofwel + + a(+#'((dash . 1) (direction . 1)) + )b(+#'((dash . 1) (direction . 1)) + )c +@end ignore + +The following abbreviations are currently +defined: @table @code @item rows @@ -3844,10 +3941,10 @@ horizontal mode: set all text on one line (default) @var{fontstyle} may be any of @code{finger volta timesig mmrest mark script large Large dynamic} - +@ignore [kern, raise ??] - -[I still think that the semantics are weird, but well] +Wat is daarmee, zijn toch gewoon grob properties van text-interface? +@end ignore @c .{Local emacs vars} @c Local variables: diff --git a/VERSION b/VERSION index 2946fc3906..dd6bf67440 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=130 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=jcn1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/regression/lyrics-bar.ly b/input/regression/lyrics-bar.ly index ec0309b322..58b6abea2d 100644 --- a/input/regression/lyrics-bar.ly +++ b/input/regression/lyrics-bar.ly @@ -8,15 +8,15 @@ lyrics don't collide with barlines. \score { \context StaffGroup < \notes \context Staff { - b1 b1 \bar "|."; + b1 \bar "|:"; b1 \bar ":|"; } \lyrics\context Lyrics < \context LyricsVoiceWithBars { -% thisContextHasSpanBarEngraver1 added - ThisContextCertainlyHasSpanBarEngraverAddedButTheresSomethingFunny1. Here. +% thisContextHasBarEngraver1 added + ThisContextCertainlyHasBarEngraverAddedButThereHasBeenSomethingFunnyBefore1. Here. } \context LyricsVoice { - this4 one has no SpanBarEngraverAddedToContext1 + this4 one has no BarEngraverAddedToContext1 } > \notes \context Staff = SB { b1 b1 } @@ -25,11 +25,11 @@ lyrics don't collide with barlines. linewidth = -1.0\cm; \translator { \LyricsContext - \consists "Span_bar_engraver"; \accepts "LyricsVoiceWithBars"; } \translator { \LyricsVoiceContext + \consists "Bar_engraver"; \name "LyricsVoiceWithBars"; } \translator { diff --git a/input/star-spangled-banner.ly b/input/star-spangled-banner.ly index 339826fb6b..0428ab192f 100644 --- a/input/star-spangled-banner.ly +++ b/input/star-spangled-banner.ly @@ -6,23 +6,6 @@ http://www.Arkkra.com/doc/star.ps \version "1.3.120"; -% TODO: -% -% * centre non-melismata lyrics (where there's only one verse!) under -% notehead: -% -% l c c c l -% ___ -% | | | | | | | -% x|()x| x| x| x| x|( )x| -% Oh_____say can you see -% -% NOT! -% -% -% * slur/lyric clash -% - \header{ title="The Star Spangled Banner"; subtitle="The United States National Anthem"; @@ -139,12 +122,12 @@ text = \lyrics { \clef treble; \property Staff.automaticMelismata = ##t \context Voice = one \transpose c'' { - \stemUp + \voicOne \staffBVoiceB \bar "|."; } \context Voice = two \transpose c'' { - \stemDown + \voiceTwo \staffBVoiceC } > @@ -154,11 +137,11 @@ text = \lyrics { \clef bass; \property Staff.VoltaBracket = \turnOff \context Voice = three { - \stemUp + \voiceOne \staffCVoiceB } \context Voice = four { - \stemDown + \voiceTwo \staffCVoiceC } > @@ -171,11 +154,6 @@ text = \lyrics { \GrandStaffContext \accepts "Lyrics"; } -% We have a Span_bar_engraver in GrandStaff; we only get grief if we add it here too. -% \translator { -% \LyricsContext -% \consists "Span_bar_engraver"; -% } \translator { \LyricsVoiceContext \consists "Bar_engraver"; diff --git a/input/test/lyrics-bar.ly b/input/test/lyrics-bar.ly index 7be6f4c0ac..e69de29bb2 100644 --- a/input/test/lyrics-bar.ly +++ b/input/test/lyrics-bar.ly @@ -1,37 +0,0 @@ -\header{ -texidoc=" -Adding a @code{Bar_engraver} to the LyricsVoice context makes sure that -lyrics don't collide with barlines. -"; -} - -\score { - \context StaffGroup < - \notes \context Staff { - b1 b1 \bar "|."; - } - \lyrics\context Lyrics < - \context LyricsVoiceWithBars { -% thisContextHasSpanBarEngraver1 added - ThisContextCertainlyHasSpanBarEngraverAddedButTheresSomethingFunny1. Here. - } - \context LyricsVoice { - this4 one has no SpanBarEngraverAddedToContext1 - } - > - \notes \context Staff = SB { b1 b1 } - > - \paper { - linewidth = -1.0\cm; - \translator { - \LyricsContext - \accepts "LyricsVoiceWithBars"; - } - \translator { - \LyricsVoiceContext - \consists "Bar_engraver"; - \name "LyricsVoiceWithBars"; - } - - } -} diff --git a/input/test/markup.ly b/input/test/markup.ly index 07f3ecb1bf..8ef49ed00d 100644 --- a/input/test/markup.ly +++ b/input/test/markup.ly @@ -8,6 +8,7 @@ \score{ \notes\relative c''{ \stemUp +% { a-"text" b-#"texta" c-#'(bold "textb") @@ -18,10 +19,12 @@ (italic "three")) f-#'(finger "3") g-#'(music (named "noteheads-2" "flags-u3")) - - b-#'(rows "a" ((kern . 3) ((raise . 2) "b")) "c") - c-#'(rows "1" ((kern . -3) ((raise . -2) "2")) "3") - + b-#'(rows "a" (((kern . 3) (raise . 2)) "b") "c") + c-#'(rows "1" (((raise . -2) (kern . -1)) "2") "3") +% } + d-#'(lines "Violoncello" " e" "Contrabasso") + e-#'((lines (baselineskip . 0) (kern . 1.5)) "Violoncello" " e" "Contrabasso") + e-#'(((baselineskip . 0) (kern . 1.5) lines) "Violoncello" " e" "Contrabasso") } \paper{ linewidth = -1.\mm; diff --git a/input/tutorial/orchestral-score.ly b/input/tutorial/orchestral-score.ly index 64f7ba7f15..d46b66856a 100644 --- a/input/tutorial/orchestral-score.ly +++ b/input/tutorial/orchestral-score.ly @@ -1,4 +1,4 @@ -\version "1.3.120"; +\version "1.3.130"; \include "paper16.ly"; @@ -122,10 +122,10 @@ contrabasso = \notes\relative c { > \context Staff = clarinets < \property Staff.midiInstrument = #"clarinet" - \property Staff.instrument = #`((kern . 0.5) - (lines "2 Clarinetti" (rows "(B" ,text-flat ")"))) - \property Staff.instr = #`((kern . 0.5) - (lines "Cl." (rows "(B" ,text-flat ")"))) + \property Staff.instrument = #`(lines + "2 Clarinetti" (rows "(B" ,text-flat ")")) + \property Staff.instr = #`(lines + "Cl." (rows "(B" ,text-flat ")")) \property Staff.transposing = #-2 \notes \key f \major; \context Voice=one \partcombine Voice @@ -145,10 +145,10 @@ contrabasso = \notes\relative c { \context StaffGroup = brass < \context Staff = frenshHorns < \property Staff.midiInstrument = #"french horn" - \property Staff.instrument = #`((kern . 0.5) - (lines "2 Corni" (rows "(E" ,text-flat ")"))) - \property Staff.instr = #`((kern . 0.5) - (lines "Cor." (rows "(E" ,text-flat ")"))) + \property Staff.instrument = #`(lines + "2 Corni" (rows "(E" ,text-flat ")")) + \property Staff.instr = #`(lines + "Cor." (rows "(E" ,text-flat ")")) \property Staff.transposing = #3 \notes \key c \major; \context Voice=one \partcombine Voice @@ -157,10 +157,10 @@ contrabasso = \notes\relative c { > \context Staff = trumpets < \property Staff.midiInstrument = #"clarinet" - \property Staff.instrument = #`((kern . 0.5) - (lines "2 Trombe" (rows "(C)"))) - \property Staff.instr = #`((kern . 0.5) - (lines "Tbe." (rows "(C)"))) + \property Staff.instrument = #`(lines + "2 Trombe" (rows "(C)")) + \property Staff.instr = #`(lines + "Tbe." (rows "(C)")) \context Voice=one \partcombine Voice \context Thread=one \tromboI \context Thread=two \tromboII @@ -169,8 +169,8 @@ contrabasso = \notes\relative c { \context StaffGroup = timpani < \context Staff = timpani < \property Staff.midiInstrument = #"timpani" - \property Staff.instrument = #'((kern . 0.5) - (lines "2 Timpani" "(C-G)")) + \property Staff.instrument = #'(lines + "2 Timpani" "(C-G)") \property Staff.instr = #"Timp." \clef bass; \timpani @@ -204,8 +204,8 @@ contrabasso = \notes\relative c { \staffCombinePianoStaffProperties \context Staff=one < \property Staff.midiInstrument = #"cello" - \property Staff.instrument = #'((kern . 0.5) - (lines "Violoncello" (rows " e") (rows "Contrabasso"))) + \property Staff.instrument = #'(lines + "Violoncello" " e" "Contrabasso") \property Staff.instr = "Vc." \clef bass; > diff --git a/lily/a2-engraver.cc b/lily/a2-engraver.cc index 5df8930a30..d155be0d15 100644 --- a/lily/a2-engraver.cc +++ b/lily/a2-engraver.cc @@ -132,6 +132,8 @@ A2_engraver::acknowledge_grob (Grob_info i) if (Stem::has_interface (i.elem_l_) || Slur::has_interface (i.elem_l_) + // || Tie::has_interface (i.elem_l_) + || i.elem_l_->has_interface (ly_symbol2scm ("tie-interface")) /* Usually, dynamics are removed by *_devnull_engravers for the second voice. On the one hand, we don't want all dynamics for diff --git a/lily/bar.cc b/lily/bar.cc index 0ee7890743..f46e55c3c0 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -73,12 +73,12 @@ Bar::compound_barline (Grob*me, String str, Real h) { return thin; } - else if (str == "|.") + else if (str == "|." || (h == 0 && str == ":|")) { m.add_at_edge (X_AXIS, LEFT, thick, 0); m.add_at_edge (X_AXIS, LEFT, thin, kern); } - else if (str == ".|") + else if (str == ".|" || (h == 0 && str == "|:")) { m.add_at_edge (X_AXIS, RIGHT, thick, 0); m.add_at_edge (X_AXIS, RIGHT, thin, kern); diff --git a/lily/chord-name-engraver.cc b/lily/chord-name-engraver.cc index ebe406f1f8..9e2087b41b 100644 --- a/lily/chord-name-engraver.cc +++ b/lily/chord-name-engraver.cc @@ -46,7 +46,7 @@ Chord_name_engraver::Chord_name_engraver () { chord_name_p_ = 0; chord_ = gh_cons (SCM_EOL, gh_cons (SCM_EOL, SCM_EOL)); - last_chord_ = SCM_EOL; + last_chord_ = chord_; } void @@ -94,7 +94,7 @@ Chord_name_engraver::create_grobs () chord_name_p_->set_grob_property ("chord", chord_); announce_grob (chord_name_p_, 0); SCM s = get_property ("chordChanges"); - if (to_boolean (s) && last_chord_ != SCM_EOL + if (to_boolean (s) && gh_car (last_chord_) != SCM_EOL && gh_equal_p (chord_, last_chord_)) chord_name_p_->set_grob_property ("begin-of-line-visible", SCM_BOOL_T); } @@ -109,7 +109,8 @@ Chord_name_engraver::stop_translation_timestep () } chord_name_p_ = 0; - last_chord_ = chord_; + if (gh_car (chord_) != SCM_EOL) + last_chord_ = chord_; chord_ = gh_cons (SCM_EOL, gh_cons (SCM_EOL, SCM_EOL)); } diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh index 15373296c6..246f3fc47a 100644 --- a/lily/include/text-item.hh +++ b/lily/include/text-item.hh @@ -21,7 +21,7 @@ public: DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM)); static Molecule text2molecule (Grob *me, SCM text, SCM properties); static Molecule string2molecule (Grob *me, SCM text, SCM properties); - static Molecule markup_sentence2molecule (Grob *me, SCM markup_sentence, SCM properties); + static Molecule markup_text2molecule (Grob *me, SCM markup_text, SCM properties); private: static Molecule lookup_character (Grob *me, Font_metric*, SCM char_name); diff --git a/lily/text-item.cc b/lily/text-item.cc index 29538a1f8b..d3b1bb2ade 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -20,39 +20,17 @@ /* - TEXT : STRING | (MARKUP SENTENCE) - MARKUP: PROPERTY | ABBREV - SENTENCE: TEXT | SENTENCE TEXT - PROPERTY: (key . value) - ABBREV: rows lines roman music bold italic named super sub text, or any font-style - */ - -/* - FIXME: - - rewrite routines and syntax to be like TEXT: STRING - | (head-expression* TEXT*) - ; - - head-expression is a list, containing a tag and a variable number of - arguments. If necessary, the number of arguments can be stored in a alist, + | (MARKUP? TEXT+) + ; - '( - (tag1 . argcount1) - (tag2 . argcount2) + HEAD: MARKUP-ITEM | (MARKUP-ITEM+) - ... etc + MARKUP-ITEM: PROPERTY | ABBREV | FONT-STYLE + PROPERTY: (key . value) + ABBREV: rows lines roman music bold italic named super sub text - ) - - or even entries like - - (tag . (argcount function-to-handle-the-tag )) - - use baselineskip for setting (lines ...) - */ Molecule @@ -65,7 +43,7 @@ Text_item::text2molecule (Grob *me, SCM text, SCM alist_chain) if (!gh_pair_p (gh_car (text)) && gh_string_p (gh_car (text))) return string2molecule (me, gh_car (text), alist_chain); else - return markup_sentence2molecule (me, text, alist_chain); + return markup_text2molecule (me, text, alist_chain); } return Molecule (); } @@ -134,61 +112,71 @@ Text_item::lookup_text (Grob *me, Font_metric*fm, SCM text) } Molecule -Text_item::markup_sentence2molecule (Grob *me, SCM markup_sentence, - SCM alist_chain) +Text_item::markup_text2molecule (Grob *me, SCM markup_text, + SCM alist_chain) { SCM sheet = me->paper_l ()->style_sheet_; SCM f = gh_cdr (scm_assoc (ly_symbol2scm ("markup-to-properties"), sheet)); - SCM markup = gh_car (markup_sentence); - SCM sentence = gh_cdr (markup_sentence); - + SCM markup = gh_car (markup_text); + SCM text = gh_cdr (markup_text); + +#if 1 SCM p = gh_cons (gh_call2 (f, sheet, markup), alist_chain); +#else + SCM pp = gh_call2 (f, sheet, markup); + gh_newline (); + scm_write (pp, scm_current_error_port ()); + gh_newline (); + SCM p = gh_cons (pp, alist_chain); +#endif + + Real staff_space = Staff_symbol_referencer::staff_space (me); Axis align = X_AXIS; SCM a = ly_assoc_chain (ly_symbol2scm ("align"), p); if (gh_pair_p (a) && gh_number_p (gh_cdr (a))) align = (Axis)gh_scm2int (gh_cdr (a)); - Real staff_space = Staff_symbol_referencer::staff_space (me); - Real kern = 0; + Real baseline_skip = 0; + SCM b = ly_assoc_chain (ly_symbol2scm ("baseline-skip"), p); + if (gh_pair_p (b) && gh_number_p (gh_cdr (b))) + baseline_skip = gh_scm2double (gh_cdr (b)) * staff_space; + + Array kern (2); + kern[0] = 0; // zucht + kern[1] = 0; SCM k = ly_assoc_chain (ly_symbol2scm ("kern"), p); if (gh_pair_p (k) && gh_number_p (gh_cdr (k))) - kern = gh_scm2double (gh_cdr (k)) * staff_space; + kern[align] = gh_scm2double (gh_cdr (k)) * staff_space; Real raise = 0; SCM r = ly_assoc_chain (ly_symbol2scm ("raise"), p); if (gh_pair_p (r) && gh_number_p (gh_cdr (r))) raise = gh_scm2double (gh_cdr (r)) * staff_space; -#if 0 - Offset o (align == X_AXIS ? kern : 0, - (align == Y_AXIS ? - kern : 0) + raise); -#else - Offset o (0, (align == Y_AXIS ? - kern : 0) + raise); -#endif - + Offset o (0, (align == Y_AXIS ? - kern[align] : 0) + raise); + Molecule mol; - while (gh_pair_p (sentence)) + while (gh_pair_p (text)) { - /* Ugh: this (kerning) only works if 'kern' is the first modifier of a - markup. I guess the only solution is to rewrite markup definition, - see above. */ - Molecule m = text2molecule (me, gh_car (sentence), p); - Real m_kern = 0; + Molecule m = text2molecule (me, gh_car (text), p); SCM m_p = SCM_EOL; - if (gh_pair_p (gh_car (sentence))) - m_p = gh_cons (gh_call2 (f, sheet, gh_caar (sentence)), alist_chain); + if (gh_pair_p (gh_car (text))) + m_p = gh_cons (gh_call2 (f, sheet, gh_caar (text)), alist_chain); SCM m_k = ly_assoc_chain (ly_symbol2scm ("kern"), m_p); + Real m_kern = kern[align]; if (gh_pair_p (m_k) && gh_number_p (gh_cdr (m_k))) m_kern = gh_scm2double (gh_cdr (m_k)) * staff_space; if (!m.empty_b ()) { m.translate (o); + if (align == Y_AXIS && baseline_skip) + m_kern += baseline_skip - m.extent (Y_AXIS)[UP]; mol.add_at_edge (align, align == X_AXIS ? RIGHT : DOWN, m, m_kern); } - sentence = gh_cdr (sentence); + text = gh_cdr (text); } return mol; } diff --git a/ly/engraver.ly b/ly/engraver.ly index ccfb55813e..39623a2056 100644 --- a/ly/engraver.ly +++ b/ly/engraver.ly @@ -291,7 +291,9 @@ ChordNamesVoiceContext = \translator { \consistsend "Axis_group_engraver"; \consists "Separating_line_group_engraver"; \consists "Chord_name_engraver"; + \consists "Skip_req_swallow_translator"; } + ChordNamesContext = \translator { \type "Engraver_group_engraver"; \name ChordNames; diff --git a/ly/property.ly b/ly/property.ly index d73cf04da2..4ae2d3b4e2 100644 --- a/ly/property.ly +++ b/ly/property.ly @@ -20,32 +20,43 @@ tieDown = \property Voice.Tie \override #'direction = #-1 tieBoth = \property Voice.Tie \revert #'direction cadenzaOn = \property Score.timing = ##f -cadenzaOff = { \property Score.timing = ##t - \property Score.measurePosition = #(make-moment 0 1) - } +cadenzaOff = { + \property Score.timing = ##t + \property Score.measurePosition = #(make-moment 0 1) +} oneVoice = { - \stemBoth - \tieBoth - \shiftOff + \stemBoth + \slurBoth + \tieBoth + \shiftOff +} + +voiceOne = { + \stemUp + \slurUp + \tieUp } -voiceOne = { \stemUp - \tieUp +voiceTwo = { + \stemDown + \slurDown + \tieDown } -voiceTwo = { \stemDown - \tieDown - } voiceThree = { - \stemUp - \shiftOn + \stemUp + \slurUp + \tieUp + \shiftOn } voiceFour = { - \stemDown - \shiftOn + \stemDown + \slurDown + \tieDown + \shiftOn } slurDotted = \property Voice.Slur \override #'dashed = #1 diff --git a/mutopia/Coriolan/bassi.ly b/mutopia/Coriolan/bassi.ly index 07f834a6cf..18dedd5e05 100644 --- a/mutopia/Coriolan/bassi.ly +++ b/mutopia/Coriolan/bassi.ly @@ -7,8 +7,8 @@ bassiGroup = \context PianoStaff = bassi_group \notes < \staffCombinePianoStaffProperties \context Staff=oneBassi { \property Staff.midiInstrument = #"cello" - \property Staff.instrument = #'((kern . 0.5) - (lines "Violoncello" (rows " e") (rows "Contrabasso"))) + \property Staff.instrument = #'(lines + "Violoncello" " e" "Contrabasso") \property Staff.instr = #"Vc." \clef "bass"; diff --git a/mutopia/Coriolan/clarinetti.ly b/mutopia/Coriolan/clarinetti.ly index b3e1ad1967..34eb038cba 100644 --- a/mutopia/Coriolan/clarinetti.ly +++ b/mutopia/Coriolan/clarinetti.ly @@ -7,11 +7,10 @@ clarinettiStaff = \context Staff = clarinetti < \property Staff.midiInstrument = #"clarinet" - \property Staff.instrument = #`((kern . 0.5) - (lines "2 Clarinetti" (rows "(B" ,text-flat ")"))) + \property Staff.instrument = #`(lines + "2 Clarinetti" (rows "(B" ,text-flat ")")) - \property Staff.instr = #`((kern . 0.5) - (lines "Cl." (rows "(B" ,text-flat ")"))) + \property Staff.instr = #`(lines "Cl." (rows "(B" ,text-flat ")")) % urg: can't; only My_midi_lexer: () parses pitch? %\property Staff.transposing = "bes" diff --git a/mutopia/Coriolan/corni.ly b/mutopia/Coriolan/corni.ly index 644a66753e..0bdc166596 100644 --- a/mutopia/Coriolan/corni.ly +++ b/mutopia/Coriolan/corni.ly @@ -7,11 +7,10 @@ corniStaff = \context Staff = corni < \property Staff.midiInstrument = #"french horn" - \property Staff.instrument = #`((kern . 0.5) - (lines "2 Corni" (rows "(E" ,text-flat ")"))) + \property Staff.instrument = #`(lines + "2 Corni" (rows "(E" ,text-flat ")")) - \property Staff.instr = #`((kern . 0.5) - (lines "Cor." (rows "(E" ,text-flat ")"))) + \property Staff.instr = #`(lines "Cor." (rows "(E" ,text-flat ")")) % urg: can't; only My_midi_lexer: () parses pitch? %\property Staff.transposing = "es" diff --git a/mutopia/Coriolan/timpani.ly b/mutopia/Coriolan/timpani.ly index c01276cf7e..1e91be78b4 100644 --- a/mutopia/Coriolan/timpani.ly +++ b/mutopia/Coriolan/timpani.ly @@ -137,8 +137,8 @@ timpani = \notes \relative c { timpaniStaff = \context Staff = timpani < \property Staff.midiInstrument = #"timpani" - \property Staff.instrument = #'((kern . 0.5) - (lines "2 Timpani" "(C-G)")) + \property Staff.instrument = #'(lines + "2 Timpani" "(C-G)") \property Staff.instr = #"Timp." \clef "bass"; \Time diff --git a/mutopia/Coriolan/trombe.ly b/mutopia/Coriolan/trombe.ly index 39e21e435b..775dd7fe3f 100644 --- a/mutopia/Coriolan/trombe.ly +++ b/mutopia/Coriolan/trombe.ly @@ -8,10 +8,8 @@ trombeStaff = \context Staff = trombe < \context Staff=trombe { \property Staff.midiInstrument = #"trumpet" - \property Staff.instrument = #`((kern . 0.5) - (lines "2 Trombe" (rows "(C)"))) - \property Staff.instr = #`((kern . 0.5) - (lines "Tbe." (rows "(C)"))) + \property Staff.instrument = #`(lines "2 Trombe" (rows "(C)")) + \property Staff.instr = #`(lines "Tbe." (rows "(C)")) \notes { \key c \major; } \End diff --git a/scm/chord-name.scm b/scm/chord-name.scm index 933048f83b..f20f70d71e 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -278,10 +278,10 @@ (pitch->text pitch)) (define (pitch->chord-name-text-banter pitch) - (pitch->text-banter)) + (pitch->text-banter pitch)) (define (pitch->note-name-text-banter pitch) - (pitch->text-banter)) + (pitch->text-banter pitch)) (define (step->text pitch) (string-append diff --git a/scm/font.scm b/scm/font.scm index 869df85fdf..538726baef 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -322,11 +322,22 @@ and warn if the selected font is not unique. )) (define (markup-to-properties sheet markup) - ;;(display "markup: `") - ;;(write markup) - ;;(display "'\n") + ;; (display "markup: `") + ;; (write markup) + ;; (display "'\n") + (if (pair? markup) - (list markup) + (if (and (symbol? (car markup)) (not (pair? (cdr markup)))) + (if (equal? '() (cdr markup)) + (markup-to-properties sheet (car markup)) + (list markup)) + + (if (equal? '() (cdr markup)) + (markup-to-properties sheet (car markup)) + (append (markup-to-properties sheet (car markup)) + (markup-to-properties sheet (cdr markup))))) + + ;; markup is single abbreviation (let ((entry (assoc markup ;; assoc-chain? (append (cdr (assoc 'abbreviation-alist sheet)) @@ -335,6 +346,7 @@ and warn if the selected font is not unique. (cdr entry) (list (cons markup #t)))))) + ; fixme, how's this supposed to work? ; and why don't we import font-setting from elt? (define (style-to-font-name sheet style) diff --git a/scm/grob-description.scm b/scm/grob-description.scm index b1ecfc0a2a..956ca621c3 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -236,6 +236,7 @@ (molecule-callback . ,Text_item::brew_molecule) (break-align-symbol . Instrument_name) (visibility-lambda . ,begin-of-line-visible) + (baseline-skip . 2) (font-family . roman) (meta . ,(grob-description "InstrumentName" font-interface text-interface break-aligned-interface)) )) @@ -588,6 +589,7 @@ (molecule-callback . ,Text_item::brew_molecule) (no-spacing-rods . #t) (padding . 0.5) + (baseline-skip . 2) (font-family . roman) (font-shape . italic) (meta . ,(grob-description "TextScript" text-script-interface text-interface side-position-interface font-interface )) diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index e610eb5a03..c83b2d2f4f 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -47,6 +47,7 @@ In the case of alignment grobs, this should contain only one number.") (grob-property-description 'bar-size number? "size of a bar line.") (grob-property-description 'bars list? "list of barline pointers.") (grob-property-description 'barsize-procedure procedure? "Procedure that computes the size of a bar line.") +(grob-property-description 'baseline-skip number? "Baseline skip to use for multiple lines of text.") (grob-property-description 'bass list? " musical-pitch, optional.") (grob-property-description 'beam ly-grob? "pointer to the beam, if applicable.") (grob-property-description 'beam-space-function procedure? "function returning space given multiplicity.") @@ -252,19 +253,14 @@ one end of the stem.") Scheme markup text. It is defined as follows: @example - -TEXT : STRING | (MARKUP SENTENCE) -SENTENCE: TEXT | SENTENCE TEXT -MARKUP: PROPERTY | ABBREV -PROPERTY: (key . value) -ABBREV: rows lines roman music bold italic named super sub text, or any font-style +text: string | (head? text+) +head: markup | (markup+) +markup-item: property | abbrev | @var{fontstyle} +property: (@var{key} . @var{value}) +abbrev: @code{rows lines roman music bold italic named super sub text} @end example -So, TEXT is either a string, or a list of which the CAR is a MARKUP. -MARKUP is either a CONS: an grob property '(key . value) or a symbol: -a predefined abbreviation for a list of grob properties. - The following abbreviations are currently defined: @table @samp diff --git a/scm/interface-description.scm b/scm/interface-description.scm index 7d5ee12eaa..4742c4b325 100644 --- a/scm/interface-description.scm +++ b/scm/interface-description.scm @@ -445,7 +445,7 @@ font-point-size font-relative-size) (lily-interface 'text-interface "A scheme markup text" - '(text align lookup raise kern magnify))) + '(text align baseline-skip lookup raise kern magnify))) (define dot-column-interface (lily-interface