From 880cac3cdff435918978687978ad088d640b5aec Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:03:28 +0000 Subject: [PATCH] lilypond-1.5.16 --- input/test/ancient-font.ly | 11 +++---- lily/include/porrectus.hh | 1 + lily/porrectus-engraver.cc | 50 ++++++++++++++++++++----------- scm/grob-description.scm | 5 ++-- scm/grob-property-description.scm | 1 + 5 files changed, 40 insertions(+), 28 deletions(-) diff --git a/input/test/ancient-font.ly b/input/test/ancient-font.ly index cfc7e498a3..33e234db23 100644 --- a/input/test/ancient-font.ly +++ b/input/test/ancient-font.ly @@ -31,6 +31,7 @@ upperVoice = \context Staff = upperVoice < \property Voice.Porrectus \override #'solid = ##t \property Voice.Porrectus \override #'add-stem = ##t \property Voice.Porrectus \override #'stem-direction = #-1 + \property Voice.Porrectus \override #'line-thickness = #0.5 \key es \major \clef "vaticana_fa2" c!1 des! e! f! ges! @@ -44,7 +45,7 @@ upperVoice = \context Staff = upperVoice < a! b! \property Staff.BarLine \override #'bar-size = #3.0 \bar "|" \property Voice.NoteHead \override #'style = #'vaticana_virga - ces' b! ces'! \~ ges! \~ fes! + ces' b! des'! \~ ges! \~ fes! \breathe \clef "vaticana_fa1" \property Voice.NoteHead \override #'style = #'vaticana_quilisma @@ -129,7 +130,8 @@ lowerVoice = \context Staff = lowerNotes < \property Voice.Porrectus \override #'add-stem = ##t \property Voice.Porrectus \override #'stem-direction = #1 \property Voice.Porrectus \override #'line-thickness = #0.7 - % \property Voice.Porrectus \override #'porrectus-width = #3.0 +% \property Voice.Porrectus \override #'auto-properties = ##t +% \property Voice.Porrectus \override #'porrectus-width = #3.0 \key a \major % IMPORTANT NOTE: @@ -186,11 +188,6 @@ lowerVoice = \context Staff = lowerNotes < e2 f g \clef "mensural_g" - % FIXME: In the second and all subsequent lines of score, the - % stems and accidentals of the junked notes keep visible on - % porrectus grobs. Is this an initialization bug in the line - % breaking algorithm? - bes'! \~ as'! \~ cis''! bes'! \~ fis'! as'! \~ ges'! \property Staff.forceClef = ##t diff --git a/lily/include/porrectus.hh b/lily/include/porrectus.hh index 3b4a97a046..9fa037ab9c 100644 --- a/lily/include/porrectus.hh +++ b/lily/include/porrectus.hh @@ -30,6 +30,7 @@ private: static Molecule brew_mensural_molecule (Item *, Real, bool, Real, Real, bool, Direction); + static Molecule brew_bezier_sandwich (Bezier, Bezier); static Molecule brew_horizontal_slope (Real, Real, Real); static Molecule create_ledger_line (Interval, Grob *); static Molecule create_streepjes (Grob *, int, int, Interval); diff --git a/lily/porrectus-engraver.cc b/lily/porrectus-engraver.cc index 4cc35e910c..28166e63ea 100644 --- a/lily/porrectus-engraver.cc +++ b/lily/porrectus-engraver.cc @@ -15,30 +15,19 @@ * * TODO: Hufnagel support. * - * TODO: Fine-tuning of vaticana-style porrectus shape; in particular, - * ensure solidity if solid is set to #t and thickness is very small. - * - * TODO: For white mensural (i.e. #'style=#'mensural, #'solid=##f) - * porrectus grobs, it is possible to automatically determine all - * porrectus specific properties (add-stem, stem-direction) solely - * from the duration of the contributing notes and time-signature. - * Introduce a boolean grob property called auto-config, so that, if - * turned on, lily automatically sets the properties add-stem and - * stem-direction properly. - * * TODO: The following issues are currently not handled by this - * engraver: (1) accidentals placement, (2) avoiding line breaking - * inbetween porrectus, (3) spacing. (Han-Wen says: for (2), look at - * beam engraver.) For example, currently only the accidental for the - * second note (cp. the above FIXME) is printed. These issues should - * be resolved by some sort of ligature context that encloses use of - * this engraver, using syntax like: \ligature { e \~ c }. + * engraver: (1) accidentals placement, (2) spacing. For example, + * currently only the accidental for the second note (cp. the above + * FIXME) is printed. These issues should be resolved by some sort of + * ligature context that encloses use of this engraver, using syntax + * like: \ligature { e \~ c }. * * TODO: Do not allow a series of adjacent porrectus requests, as in: * e \~ d \~ c. * * TODO: Junk duplicate (or rather triple) implementation of - * create_ledger_line in porrectus.cc, custos.cc and note-head.cc. */ + * create_ledger_line in porrectus.cc, custos.cc and note-head.cc. + */ #include "staff-symbol-referencer.hh" #include "porrectus.hh" @@ -47,7 +36,9 @@ #include "rhythmic-head.hh" #include "item.hh" #include "engraver.hh" +#include "score-engraver.hh" #include "pqueue.hh" +#include "warn.hh" // TODO: PHead_melodic_tuple is duplicated code from tie-engraver.cc. // Maybe put this into public class? @@ -74,6 +65,7 @@ public: protected: virtual bool try_music (Music *req_l); + virtual void process_music (); virtual void create_grobs (); virtual void stop_translation_timestep (); virtual void start_translation_timestep (); @@ -104,6 +96,28 @@ Porrectus_engraver::try_music (Music *m) return false; } +void +Porrectus_engraver::process_music () +{ + if (porrectus_req_l_) + { + // TODO: Move code that forbids breaking into ligature music + // wrapper? + Score_engraver *engraver = 0; + for (Translator *translator = daddy_grav_l (); + translator && !engraver; + translator = translator->daddy_trans_l_) + { + engraver = dynamic_cast (translator); + } + + if (!engraver) + programming_error ("No score engraver!"); + else + engraver->forbid_breaks (); + } +} + void Porrectus_engraver::acknowledge_grob (Grob_info info_l_) { diff --git a/scm/grob-description.scm b/scm/grob-description.scm index 3683ebda1e..55cece0c44 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -323,15 +323,14 @@ (Porrectus . ( (style . mensural) - (auto-properties . #t) + (auto-properties . #f) (solid . #f) (porrectus-width . 2.4) (line-thickness . 1.0) (add-stem . #t) (stem-direction . 1) (molecule-callback . ,Porrectus::brew_molecule) - (meta . ,(grob-description - porrectus-interface)) + (meta . ,(grob-description porrectus-interface)) )) (RehearsalMark . ( diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 3f808ba8bf..85a6b931f4 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -55,6 +55,7 @@ terms of note head bounding box.") '(LEFT-offset . RIGHT-offset). This offset is added to the attachments to prevent ugly slurs. [fixme: we need more documentation here]. .") +(grob-property-description 'auto-properties boolean? "if true, as many properties of this grob as possible will be determined automatically from the musical context.") (grob-property-description 'auto-knee-gap number-or-boolean? "the minimal smallest gap between two adjacent beamed chords for which beam will create auto-knees. Set to false for no auto knees." ) (grob-property-description 'axes list? "list of axis numbers. In the case of alignment grobs, this should contain only one number.") -- 2.39.5