]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/translation-functions.scm (format-bass-figure): translate
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 30 May 2006 15:47:16 +0000 (15:47 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 30 May 2006 15:47:16 +0000 (15:47 +0000)
digits over 10 to the left

* scm/define-markup-commands.scm (translate-scaled): new markup.

* mf/feta-nummer-code.mf (code): overshoot the topright tip of the
7 glyph.

* ly/engraver-init.ly: add Figured_bass_engraver

* lily/engraver-group.cc (acknowledge_grobs): use start/stop drul.

* lily/figured-bass-engraver.cc (clear_spanners): use everywhere.

* lily/score-engraver.cc (announce_grob): only note START announces.

* lily/include/engraver-group.hh (Translator_group):
acknowledge_hash_table_ is now drul.

* lily/engraver.cc (announce_end_grob): new method.

* lily/include/grob-info.hh (class Grob_info): add start_end_ member.

* lily/translator-dispatch-list.cc (create): take start_end argument.

* lily/include/translator.hh (TRANSLATOR_DECLARATIONS): change
acknowledge_static_array_ to drul

* lily/include/translator.icc (ADD_END_ACKNOWLEDGER): new macro.

* scm/define-grob-interfaces.scm
(bass-figure-alignment-interface): add bass-figure-alignment-interface

* scm/define-grobs.scm (all-grob-descriptions): add
BassFigureAlignmentPositioning

* ly/Welcome-to-LilyPond-MacOS.ly: include in LilyPond, so version number
stays up to date. Backportme.

22 files changed:
ChangeLog
input/regression/figured-bass-staff.ly [new file with mode: 0644]
lily/engraver-group.cc
lily/engraver.cc
lily/figured-bass-engraver.cc
lily/grob-info.cc
lily/include/engraver-group.hh
lily/include/engraver.hh
lily/include/grob-info.hh
lily/include/translator-dispatch-list.hh
lily/include/translator.hh
lily/include/translator.icc
lily/score-engraver.cc
lily/stem-engraver.cc
lily/translator-dispatch-list.cc
ly/Welcome-to-LilyPond-MacOS.ly [new file with mode: 0644]
ly/engraver-init.ly
mf/feta-nummer-code.mf
scm/define-grob-interfaces.scm
scm/define-grobs.scm
scm/define-markup-commands.scm
scm/translation-functions.scm

index 49fb05cd08acab8c374916ef2fb5edb86453542f..94ea1a857b4bb970c44dd0b8c6e557dc17452cb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2006-05-30  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * scm/translation-functions.scm (format-bass-figure): translate
+       digits over 10 to the left
+
+       * scm/define-markup-commands.scm (translate-scaled): new markup.
+
+       * mf/feta-nummer-code.mf (code): overshoot the topright tip of the
+       7 glyph. 
+
+       * ly/engraver-init.ly: add Figured_bass_engraver
+
+       * lily/engraver-group.cc (acknowledge_grobs): use start/stop drul.
+
+       * lily/figured-bass-engraver.cc (clear_spanners): use everywhere.
+
+       * lily/score-engraver.cc (announce_grob): only note START announces.
+
+       * lily/include/engraver-group.hh (Translator_group):
+       acknowledge_hash_table_ is now drul.
+
+       * lily/engraver.cc (announce_end_grob): new method.
+
+       * lily/include/grob-info.hh (class Grob_info): add start_end_ member.
+
+       * lily/translator-dispatch-list.cc (create): take start_end argument.
+
+       * lily/include/translator.hh (TRANSLATOR_DECLARATIONS): change
+       acknowledge_static_array_ to drul
+
+       * lily/include/translator.icc (ADD_END_ACKNOWLEDGER): new macro.
+
+       * scm/define-grob-interfaces.scm
+       (bass-figure-alignment-interface): add bass-figure-alignment-interface
+
+       * scm/define-grobs.scm (all-grob-descriptions): add
+       BassFigureAlignmentPositioning
+
+       * ly/Welcome-to-LilyPond-MacOS.ly: include in LilyPond, so version number
+       stays up to date. Backportme.
+
 2006-05-30  Mats Bengtsson  <mabe@drongo.s3.kth.se>
 
        * Documentation/user/basic-notation.itely (Bar lines): Document
diff --git a/input/regression/figured-bass-staff.ly b/input/regression/figured-bass-staff.ly
new file mode 100644 (file)
index 0000000..fc49f90
--- /dev/null
@@ -0,0 +1,31 @@
+
+\paper {
+  ragged-right = ##t
+
+}
+\version "2.9.7"
+\header {
+
+
+  texidoc = "Figured bass can also be added to Staff context directly.
+In that case, the figures must be entered with @code{\\figuremode} and be directed
+to an existing @code{Staff} context."
+
+  }
+
+<<
+
+  \new Staff = someUniqueName
+  \relative c'' {
+    c4 c'8 r8 c,4 c'
+  }
+
+  %% send to existing Staff.
+  \context Staff = someUniqueName 
+  \figuremode {
+    <4>4 <4>8 s8
+    
+    \set Staff.useBassFigureExtenders = ##t
+    <4 6>4 <4 6>
+  }
+>>
index 5742288d69cc46b8d3407da3fb991ec7e4efb384..71533cd116cd8e353d853285578ed287fc3344c6 100644 (file)
@@ -23,6 +23,7 @@ Engraver_group::announce_grob (Grob_info info)
     = context_->get_parent_context ()
     ? dynamic_cast<Engraver_group *> (context_->get_parent_context ()->implementation ())
     : 0;
+
   if (dad_eng)
     dad_eng->announce_grob (info);
 }
@@ -39,7 +40,7 @@ Engraver_group::acknowledge_grobs ()
   for (vsize j = 0; j < announce_infos_.size (); j++)
     {
       Grob_info info = announce_infos_[j];
-
+      
       SCM meta = info.grob ()->internal_get_property (meta_sym);
       SCM nm = scm_assoc (name_sym, meta);
       if (scm_is_pair (nm))
@@ -47,7 +48,9 @@ Engraver_group::acknowledge_grobs ()
       else
        continue;
 
-      SCM acklist = scm_hashq_ref (acknowledge_hash_table_, nm, SCM_BOOL_F);
+      SCM acklist = scm_hashq_ref (acknowledge_hash_table_drul_[info.start_end()],
+                                  nm, SCM_BOOL_F);
+      
       Engraver_dispatch_list *dispatch
        = Engraver_dispatch_list::unsmob (acklist);
 
@@ -56,12 +59,12 @@ Engraver_group::acknowledge_grobs ()
          SCM ifaces
            = scm_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta));
          acklist = Engraver_dispatch_list::create (get_simple_trans_list (),
-                                                   ifaces);
+                                                   ifaces, info.start_end ());
 
          dispatch
            = Engraver_dispatch_list::unsmob (acklist);
 
-         scm_hashq_set_x (acknowledge_hash_table_, nm, acklist);
+         scm_hashq_set_x (acknowledge_hash_table_drul_[info.start_end ()], nm, acklist);
        }
 
       if (dispatch)
@@ -124,8 +127,12 @@ Engraver_group::do_announces ()
 
 Engraver_group::Engraver_group ()
 {
-  acknowledge_hash_table_ = SCM_EOL;
-  acknowledge_hash_table_ = scm_c_make_hash_table (61);
+  acknowledge_hash_table_drul_[LEFT] 
+    = acknowledge_hash_table_drul_[RIGHT] 
+    = SCM_EOL;
+  
+  acknowledge_hash_table_drul_[LEFT] = scm_c_make_hash_table (61);
+  acknowledge_hash_table_drul_[RIGHT] = scm_c_make_hash_table (61);
 }
 
 #include "translator.icc"
@@ -140,5 +147,6 @@ ADD_TRANSLATOR_GROUP (Engraver_group,
 void
 Engraver_group::derived_mark () const
 {
-  scm_gc_mark (acknowledge_hash_table_);
+  scm_gc_mark (acknowledge_hash_table_drul_[LEFT]);
+  scm_gc_mark (acknowledge_hash_table_drul_[RIGHT]);
 }
index f17a211afc392127047458d769f48b8febe3cb6a..eebd22e4bea706dbf8635b70c0e1ebf412cedb24 100644 (file)
@@ -29,6 +29,12 @@ Engraver::announce_grob (Grob_info inf)
   get_daddy_engraver ()->announce_grob (inf);
 }
 
+void
+Engraver::announce_end_grob (Grob_info inf)
+{
+  get_daddy_engraver ()->announce_grob (inf);
+}
+
 /*
   CAUSE is the object (typically a Music object)  that
   was the reason for making E.
@@ -46,6 +52,26 @@ Engraver::announce_grob (Grob *e, SCM cause)
     g->announce_grob (i);
 }
 
+
+/*
+  CAUSE is the object (typically a Music object)  that
+  was the reason for making E.
+*/
+void
+Engraver::announce_end_grob (Grob *e, SCM cause)
+{
+  if (unsmob_music (cause) || unsmob_grob (cause))
+    e->set_property ("cause", cause);
+
+  Grob_info i (this, e);
+
+  i.start_end_ = STOP;
+  Engraver_group *g = get_daddy_engraver ();
+  if (g)
+    g->announce_grob (i);
+}
+
+
 Engraver::Engraver ()
 {
 }
index 158959eda8b20644a6710c4a101017473e1fc271..01b352f28d647f067eab52bb7f2b4fd42f9944d0 100644 (file)
@@ -209,12 +209,32 @@ Figured_bass_engraver::clear_spanners ()
 {
   if (!alignment_)
     return;
-  
-  alignment_ = 0;
+
+  if (alignment_)
+    {
+      announce_end_grob (alignment_, SCM_EOL);
+      alignment_ = 0;
+    }
+
   if (to_boolean (get_property ("figuredBassCenterContinuations")))
     center_repeated_continuations();
   
-  groups_.clear ();
+  for (vsize i = 0; i < groups_.size (); i++)
+    {
+      if (groups_[i].group_)
+       {
+         announce_end_grob (groups_[i].group_ , SCM_EOL);
+         groups_[i].group_ = 0;
+       }
+      
+      if (groups_[i].continuation_line_)
+       {
+         announce_end_grob (groups_[i].continuation_line_ , SCM_EOL);
+         groups_[i].continuation_line_ = 0;
+       }
+    }
+
+  /* Check me, groups_.clear () ? */
 }
 
 void
@@ -255,6 +275,7 @@ Figured_bass_engraver::process_music ()
   if (rest_event_)
     {
       clear_spanners ();
+      groups_.clear ();
       return;
     }
   
@@ -262,6 +283,7 @@ Figured_bass_engraver::process_music ()
       && new_musics_.empty ())
     {
       clear_spanners ();
+      groups_.clear ();
       return;
     }
 
@@ -276,20 +298,15 @@ Figured_bass_engraver::process_music ()
   bool use_extenders = to_boolean (get_property ("useBassFigureExtenders"));
   if (!use_extenders)
     {
-      if (to_boolean (get_property ("figuredBassCenterContinuations")))
-       center_repeated_continuations ();
-      
-      alignment_ = 0;
-      for (vsize i = 0; i < groups_.size (); i++)
-       {
-         groups_[i].group_ = 0;
-         groups_[i].continuation_line_ = 0;
-       }
+      clear_spanners ();
     }
   
   if (!continuation_)
-    clear_spanners ();
-  
+    {
+      clear_spanners ();
+      groups_.clear ();
+    }
+
   vsize k = 0;
   for (vsize i = 0; i < new_musics_.size (); i++)
     {
@@ -438,10 +455,10 @@ Figured_bass_engraver::create_grobs ()
          group.figure_item_->set_property ("transparent", SCM_BOOL_T);
          group.continuation_line_->set_bound (RIGHT, group.figure_item_);
        }
-
       
       if (groups_[i].group_)
        groups_[i].group_->set_bound (RIGHT, muscol);
+
     }
 
 }
index bd8279e5f7d7b67c692d7c45dff78b357246478b..a8f3f4c7b1c5320b1cfa34a2ddb9381fee193c5a 100644 (file)
@@ -18,11 +18,13 @@ Grob_info::Grob_info (Translator *t, Grob *g)
 {
   origin_trans_ = t;
   grob_ = g;
+  start_end_ = START;
 }
 
 Grob_info::Grob_info ()
 {
   grob_ = 0;
+  start_end_ = START;
   origin_trans_ = 0;
 }
 
index 0af77fca311bd8344f2bd83b1ebc43dbf94f4b64..d1df4cffb37c39008cb27d295c8289768ecbab72 100644 (file)
@@ -16,7 +16,8 @@ class Engraver_group : public virtual Translator_group
 {
 protected:
   vector<Grob_info> announce_infos_;
-  SCM acknowledge_hash_table_;
+  Drul_array<SCM> acknowledge_hash_table_drul_;
+
 public:
   VIRTUAL_COPY_CONSTRUCTOR (Translator_group, Engraver_group);
   Engraver_group ();
index d4330f93541adbb90a01e26ec632f9c99c9c9b7a..04a7623e3f47e2ae6adb1aa2588e4e8f3e2839a3 100644 (file)
@@ -30,6 +30,7 @@ protected:
   */
   virtual void acknowledge_grob (Grob_info) {}
   virtual void announce_grob (Grob_info);
+  virtual void announce_end_grob (Grob_info);
   Engraver_group *get_daddy_engraver () const;
 
 public:
@@ -37,6 +38,7 @@ public:
      Announce element. Default: pass on to daddy. Utility
   */
   void announce_grob (Grob *, SCM cause);
+  void announce_end_grob (Grob *, SCM cause);
 
   /**
      override other ctor
index 35e3eab64e60de6617f891da69d7b1bc08e66def..4ed3790954532d9695634631cef2ae10cd2c7be7 100644 (file)
@@ -20,9 +20,11 @@ class Grob_info
 {
   Translator *origin_trans_;
   Grob *grob_;
-
+  Direction start_end_;
+  
   friend class Engraver;
 public:
+  Direction start_end () const { return start_end_; }
   Grob *grob () const { return grob_; }
   Translator *origin_translator () const { return origin_trans_; }
 
index 060ab173aff7d4c582aac7ffe2b4ee4de713627b..38543eff114d2e5bcb1361aa2430df92a8eeea80 100644 (file)
@@ -26,7 +26,7 @@ class Engraver_dispatch_list
 public:
   void apply (Grob_info);
   SCM static create (SCM trans_list,
-                    SCM iface_list);
+                    SCM iface_list, Direction);
 
   DECLARE_SIMPLE_SMOBS (Engraver_dispatch_list,);
 };
index 8566f0e3a27fc141da2ca84f5969e38e5f6fadbf..398a32ce063bc76593d0b49518dc12b3d5b257d3 100644 (file)
@@ -28,7 +28,7 @@ struct Acknowledge_information
   NAME ();                                                             \
   VIRTUAL_COPY_CONSTRUCTOR (Translator, NAME);                         \
   static SCM static_description_;                                      \
-  static vector<Acknowledge_information> acknowledge_static_array_;    \
+  static Drul_array<vector<Acknowledge_information> > acknowledge_static_array_drul_; \
   virtual void fetch_precomputable_methods (Translator_void_method_ptr methods[]); \
   virtual SCM static_translator_description () const;                  \
   virtual SCM translator_description () const;                         \
@@ -36,9 +36,17 @@ struct Acknowledge_information
   {                                                                    \
     return static_get_acknowledger (sym);                              \
   }                                                                    \
-  static Engraver_void_function_engraver_grob_info static_get_acknowledger (SCM sym);
+  virtual Engraver_void_function_engraver_grob_info get_end_acknowledger (SCM sym) \
+  {                                                                    \
+    return static_get_end_acknowledger (sym);                          \
+  } \
+  static Engraver_void_function_engraver_grob_info static_get_acknowledger (SCM sym); \
+  static Engraver_void_function_engraver_grob_info static_get_end_acknowledger(SCM); \
+  /* end #define */
+
 
 #define DECLARE_ACKNOWLEDGER(x) public : void acknowledge_ ## x (Grob_info); protected:
+#define DECLARE_END_ACKNOWLEDGER(x) public : void acknowledge_end_ ## x (Grob_info); protected:
 
 enum Translator_precompute_index
   {
index 255adc3ff9634535dc249816145fbd4eb90ffa23..14ba2b62b6b022e2dcd994de4dc0b29ccc588696 100644 (file)
   ADD_GLOBAL_CTOR (_ ## T ## _adder);
 
 #define ADD_TRANSLATOR(classname, desc, grobs, accepted, read, write)  \
-  vector<Acknowledge_information> classname::acknowledge_static_array_;        \
+  Drul_array< vector<Acknowledge_information> > classname::acknowledge_static_array_drul_;     \
   IMPLEMENT_FETCH_PRECOMPUTABLE_METHODS (classname);                   \
   ADD_THIS_TRANSLATOR (classname);                                     \
   Engraver_void_function_engraver_grob_info                            \
   classname::static_get_acknowledger (SCM sym)                         \
   {                                                                    \
-    return generic_get_acknowledger (sym, &acknowledge_static_array_); \
+    return generic_get_acknowledger (sym, &acknowledge_static_array_drul_[START]);     \
+  }                                                                    \
+  Engraver_void_function_engraver_grob_info                            \
+  classname::static_get_end_acknowledger (SCM sym)                             \
+  {                                                                    \
+    return generic_get_acknowledger (sym, &acknowledge_static_array_drul_[STOP]);      \
   }                                                                    \
   SCM                                                                  \
   classname::static_translator_description () const                    \
@@ -101,10 +106,17 @@ generic_get_acknowledger (SCM sym,
 #define ADD_ACKNOWLEDGER(CLASS, NAME)                                  \
   void CLASS ## NAME ## _ack_adder ()                                  \
   {                                                                    \
-    add_acknowledger ((Engraver_void_function_engraver_grob_info) & CLASS::acknowledge_ ## NAME, #NAME, &CLASS::acknowledge_static_array_); \
+    add_acknowledger ((Engraver_void_function_engraver_grob_info) & CLASS::acknowledge_ ## NAME, #NAME, &CLASS::acknowledge_static_array_drul_[START]); \
   }                                                                    \
   ADD_SCM_INIT_FUNC (CLASS ## NAME ## _ack_adder_initclass, CLASS ## NAME ## _ack_adder);
 
+#define ADD_END_ACKNOWLEDGER(CLASS, NAME)                                      \
+  void CLASS ## NAME ## _end_ack_adder ()                                      \
+  {                                                                    \
+    add_acknowledger ((Engraver_void_function_engraver_grob_info) & CLASS::acknowledge_end_ ## NAME, #NAME, &CLASS::acknowledge_static_array_drul_[STOP]); \
+  }                                                                    \
+  ADD_SCM_INIT_FUNC (CLASS ## NAME ## _end_ack_adder_initclass, CLASS ## NAME ## _end_ack_adder);
+
 
 #endif /* TRANSLATOR_ICC */
 
index 9566a43558021880cd770761e2d03b3d5437ade8..ba80e75bb6ac6052cecd38c0e3b465ba4e47e51a 100644 (file)
@@ -111,9 +111,12 @@ Score_engraver::one_time_step ()
 void
 Score_engraver::announce_grob (Grob_info info)
 {
-  announce_infos_.push_back (info);
-  pscore_->root_system ()->typeset_grob (info.grob ());
-  elems_.push_back (info.grob ());
+  Engraver_group::announce_grob (info);
+  if (info.start_end () == START)
+    {
+      pscore_->root_system ()->typeset_grob (info.grob ());
+      elems_.push_back (info.grob ());
+    }
 }
 
 void
index b14bdbae649ccf0daf573c51470a573e0240e0c8..797406b4fbc062d28aa0cc9af6f152d3435073ce 100644 (file)
@@ -177,7 +177,12 @@ ADD_ACKNOWLEDGER (Stem_engraver, rhythmic_head);
 ADD_TRANSLATOR (Stem_engraver,
                /* doc */ "Create stems and single-stem tremolos.  It also works together with "
                "the beam engraver for overriding beaming.",
-               /* create */ "Stem StemTremolo",
+               /* create */
+               "Stem "
+               "StemTremolo ",
                /* accept */ "tremolo-event",
-               /* read */ "tremoloFlags stemLeftBeamCount stemRightBeamCount",
+               /* read */
+               "tremoloFlags "
+               "stemLeftBeamCount "
+               "stemRightBeamCount ",
                /* write */ "");
index 91978565972d57f843fbec9685b86537e46ed59f..28ea71afa248746eab08669ed95763185f67a340 100644 (file)
@@ -29,7 +29,7 @@ Engraver_dispatch_list::apply (Grob_info gi)
 
 SCM
 Engraver_dispatch_list::create (SCM trans_list,
-                               SCM iface_list)
+                               SCM iface_list, Direction start_end)
 {
   SCM retval = Engraver_dispatch_list ().smobbed_copy ();
   Engraver_dispatch_list *list = Engraver_dispatch_list::unsmob (retval);
@@ -48,7 +48,10 @@ Engraver_dispatch_list::create (SCM trans_list,
       for (SCM i = iface_list; scm_is_pair (i); i = scm_cdr (i))
        {
          Engraver_void_function_engraver_grob_info ptr
-           = eng->get_acknowledger (scm_car (i));
+           = (start_end == START)
+           ? eng->get_acknowledger (scm_car (i))
+           : eng->get_end_acknowledger (scm_car (i));
+         
          if (ptr)
            {
              entry.function_ = ptr;
diff --git a/ly/Welcome-to-LilyPond-MacOS.ly b/ly/Welcome-to-LilyPond-MacOS.ly
new file mode 100644 (file)
index 0000000..4f876ed
--- /dev/null
@@ -0,0 +1,35 @@
+%{
+Welcome to LilyPond
+===================
+
+Congratulations, LilyPond has been installed successfully.
+
+Now to take it for the first test run.
+
+  1. Save this file
+
+  2. Select
+
+       Compile > Typeset file
+
+  from the menu.
+
+  The file is processed, and
+
+  3.  The PDF viewer will pop up. Click one of the noteheads.
+
+
+That's it.  For more information, visit http://lilypond.org .
+
+%}
+
+\header{
+  title = "A scale in LilyPond"
+}
+
+\relative {
+  c d e f g a b c
+}
+
+
+\version "2.9.6"  % necessary for upgrading to future LilyPond versions.
index 8ad404160ada8de89be997218d758ecc91023e9b..654f5dd8df3e2f05c9824e9ef25d4300fe743fd4 100644 (file)
@@ -38,6 +38,8 @@
   \consists "Instrument_name_engraver"
   \consists "String_number_engraver"
   \consists "Axis_group_engraver"
+  \consists "Figured_bass_engraver"
+  \consists "Figured_bass_position_engraver"
 
   \override VerticalAxisGroup #'minimum-Y-extent = #'(-4 . 4)
   extraVerticalExtent = ##f
index 1574669256a2da86d5138c0b27491bf490f1c685..ae264fa5038bc516e76999dde0737221c0a3d70e 100644 (file)
@@ -242,13 +242,6 @@ dot_diam# = 7/8 flare#;
 define_pixels (dot_diam);
 
 
-code := 31;    % , 32
-
-fet_beginchar ("Space", "space");
-       set_char_box (0, space#, 0, height#);
-fet_endchar;
-
-
 code := 42;    % , 43
 
 fet_beginchar ("Plus", "plus");
@@ -734,16 +727,18 @@ fet_beginchar ("Numeral 7", "seven");
        save tolerance;
        save alpha, beta, gamma, delta;
        save bow;
+       save x_overshoot;
+
        path bow;
 
-       set_char_box (0, 11/15 height# * widen, 0, height#);
+       set_char_box (0, 11/15 height# * widen - thin#, 0, height#);
+       overshoot_x = .75 thin;
 
        message "w:" & decimal w;
        message "h:" & decimal h;
 
        alpha = -180;
 
-if true:
        penpos1 (3/2 thick, 180 + alpha);
        penpos2 (hair, 180 + alpha - 45);
        penpos3 (hair, 180 + alpha + 45);
@@ -751,16 +746,12 @@ if true:
        z2 = z1l + (1/4 sqrt (2) * hair) * dir (alpha - 135);
        z3 = z1r + (1/4 sqrt (2) * hair) * dir (alpha - 45);
        z4 = z1 + kuulleke * dir (alpha - 90);
-else:
-       % does not work
-       calc_kuulleke (3/2 thick, -alpha);
-fi;
 
        z1l = (thin, 0);
 
        beta = 55;
        penpos5 (thin, 90 + beta);
-       z5 = (w, h) + (1/2 sqrt (2) * thin) * dir (-135);
+       z5 = (w, h) + (1/2 sqrt (2) * thin) * dir (-135) + (overshoot_x, 0);
 
        gamma = angle (length (z1r - z1), 2 kuulleke);
        delta = 12;
index 1cf4793b7b8cc0eedbc45b800b45c1d0da18d209..4234fd5e1ede18b1e96dcaa465a659ce1ad342f8 100644 (file)
  "A bass figure text"
  '(implicit))
 
+(ly:add-interface
+ 'bass-figure-alignment-interface
+ ""
+ '())
 
 (ly:add-interface
  'dynamic-interface
index 304360f4f110c14a0c9dea08bc58ac2b039e0190..02bc9cc8ad924c156ab73cf3cfde1ae2d024f3dd 100644 (file)
                                rhythmic-grob-interface
                                bass-figure-interface
                                font-interface))))))
+
+    (BassFigureAlignment
+     . (
+       (axes . (,Y))
+       (threshold . (2 . 1000))
+       (positioning-done . ,ly:align-interface::calc-positioning-done)
+       (Y-extent . ,ly:axis-group-interface::height)
+       (stacking-dir . -1)
+       (meta . ((class . Spanner)
+                (interfaces . (align-interface
+                               bass-figure-alignment-interface
+                               axis-group-interface))))))
+
+    (BassFigureAlignmentPositioning
+     . ((Y-offset . ,ly:side-position-interface::y-aligned-side)
+       (side-axis . ,Y)
+       (direction . ,UP)
+       (Y-extent . ,ly:axis-group-interface::height)
+       (axes . (,Y))
+       (staff-padding . 1.0)
+       (padding . 0.5)
+       (meta . ((class . Spanner)
+                (interfaces . (side-position-interface
+                               axis-group-interface
+                            ))))))
+    
     (BassFigureBracket
      . (
        (stencil . ,ly:enclosing-bracket::print)
                 (interfaces . (axis-group-interface
                                ))))))
 
-    (BassFigureAlignment
-     . (
-       (axes . (,Y))
-       (threshold . (2 . 1000))
-       (positioning-done . ,ly:align-interface::calc-positioning-done)
-       (Y-extent . ,ly:axis-group-interface::height)
-       (stacking-dir . -1)
-       (meta . ((class . Spanner)
-                (interfaces . (align-interface
-                               axis-group-interface))))))
 
     (Beam
      . (
index 5eea9071697b96ef37e15e6c13f773eccc13a665..1a940b13834e8c2dd79b0b60a367b82c9a1b28f2 100644 (file)
@@ -1267,6 +1267,17 @@ A negative @var{amount} indicates raising, see also @code{\\raise}.
                             (- amount) Y))
 
 
+(define-markup-command (translate-scaled layout props offset arg) (number-pair? markup?)
+  "Translate @var{arg} by @var{offset}, scaling the offset by the @code{font-size}."
+
+  (let*
+      ((factor (magstep (chain-assoc-get 'font-size props 0)))
+       (scaled (cons (* factor (car offset))
+                    (* factor (cdr offset)))))
+    
+  (ly:stencil-translate (interpret-markup layout props arg)
+                       scaled)))
+
 (define-markup-command (raise layout props amount arg) (number? markup?)
   "
 Raise @var{arg}, by the distance @var{amount}.
index 27bbd5200b909f552d2817c8174fbecc8be57f15..f3bd6163828558557a9f30d5c581e28d98eaf690 100644 (file)
 (define-public (format-bass-figure figure event context)
   (let* ((fig (ly:music-property event 'figure))
         (fig-markup (if (number? figure)
-                        (if (eq? #t (ly:music-property event 'diminished))
-                            (markup #:slashed-digit figure)
-                            (markup #:number (number->string figure 10)))
+
+                        ;; this is not very elegant, but center-aligning all digits
+                        ;; is problematic with other markups, and shows problems
+                        ;; in the (lack of) overshoot of feta alphabet glyphs.
+                        
+                        ((if (<= 10 figure)
+                             (lambda (y) (make-translate-scaled-markup (cons -0.7 0) y))
+                             identity)
+
+                         (if (eq? #t (ly:music-property event 'diminished))
+                             (markup #:slashed-digit figure)
+                             (markup #:number (number->string figure 10))))
                         #f
                         ))
         (alt (ly:music-property event 'alteration))
         (alt-markup
          (if (number? alt)
              (markup
-                     #:general-align Y DOWN #:fontsize
-                     (if (not (= alt DOUBLE-SHARP))
-                         -2 2)
-                     (alteration->text-accidental-markup alt))
+              #:general-align Y DOWN #:fontsize
+              (if (not (= alt DOUBLE-SHARP))
+                  -2 2)
+              (alteration->text-accidental-markup alt))
              
              #f))
         (plus-markup (if (eq? #t (ly:music-property event 'augmented))