]> git.donarmstrong.com Git - lilypond.git/blob - lily/vaticana-ligature-engraver.cc
fixes for dots in vaticana ligatures
[lilypond.git] / lily / vaticana-ligature-engraver.cc
1 /*
2   vaticana-ligature-engraver.cc -- implement Vaticana_ligature_engraver
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2003--2007 Juergen Reuter <reuter@ipd.uka.de>
7 */
8
9 #include "gregorian-ligature-engraver.hh"
10
11 #include "font-interface.hh"
12 #include "gregorian-ligature.hh"
13 #include "international.hh"
14 #include "output-def.hh"
15 #include "paper-column.hh"
16 #include "separation-item.hh"
17 #include "spanner.hh"
18 #include "staff-symbol-referencer.hh"
19 #include "stream-event.hh"
20 #include "vaticana-ligature.hh"
21 #include "warn.hh"
22 #include "dot-column.hh"
23 #include "rhythmic-head.hh"
24 #include "pitch.hh"
25 #include "translator.icc"
26
27 /*
28  * This class implements the notation specific aspects of Vaticana
29  * style ligatures for Gregorian chant notation.
30  */
31
32 /*
33  * TODO: Maybe move handling of dots/mora to
34  * Gregorian_ligature_engraver?  It's probably common for all types of
35  * Gregorian chant notation that have dotted notes.
36  *
37  * FIXME: The horizontal alignment of the mora column is bad (too far
38  * to the left), if the last dotted note is not the last primitive in
39  * the ligature.  Fortunately, in practice this bug should have no
40  * negative impact, since dotted notes appear within a ligature
41  * usually always at the end of the ligature, such that the bug never
42  * should apply for valid ligatures.
43  *
44  * TODO: Graduale Triplex, tempus per annum, hebdomada septima,
45  * alleluia (page 280) shows a counter-example for collecting dots
46  * always in a single column behind the ligature.  Maybe only the last
47  * two dots in a ligature should be collected and all other dots put
48  * behind or on top of the head?
49  */
50 class Vaticana_ligature_engraver : public Gregorian_ligature_engraver
51 {
52
53 private:
54   static bool
55   need_extra_horizontal_space (int prev_prefix_set, int prefix_set,
56                                int context_info, int delta_pitch);
57   bool is_stacked_head (int prefix_set,
58                         int context_info);
59   Real align_heads (vector<Grob_info> primitives,
60                     Real flexa_width,
61                     Real thickness);
62   void check_for_prefix_loss (Item *primitive);
63   void check_for_ambiguous_dot_pitch (Grob_info primitive);
64   void add_mora_column (Paper_column *column);
65   vector<Grob_info> augmented_primitives_;
66
67 public:
68   TRANSLATOR_DECLARATIONS (Vaticana_ligature_engraver);
69
70 protected:
71   virtual Spanner *create_ligature_spanner ();
72   virtual void transform_heads (Spanner *ligature,
73                                 vector<Grob_info> primitives);
74   DECLARE_TRANSLATOR_LISTENER (pes_or_flexa);
75   DECLARE_TRANSLATOR_LISTENER (ligature);
76 };
77
78 IMPLEMENT_TRANSLATOR_LISTENER (Vaticana_ligature_engraver, pes_or_flexa);
79 void
80 Vaticana_ligature_engraver::listen_pes_or_flexa (Stream_event *ev)
81 {
82   Gregorian_ligature_engraver::listen_pes_or_flexa (ev);
83 }
84
85 IMPLEMENT_TRANSLATOR_LISTENER (Vaticana_ligature_engraver, ligature);
86 void
87 Vaticana_ligature_engraver::listen_ligature (Stream_event *ev)
88 {
89   Ligature_engraver::listen_ligature (ev);
90 }
91
92 Vaticana_ligature_engraver::Vaticana_ligature_engraver ()
93 {
94   brew_ligature_primitive_proc = 
95     Vaticana_ligature::brew_ligature_primitive_proc;
96   augmented_primitives_.clear ();
97 }
98
99 Spanner *
100 Vaticana_ligature_engraver::create_ligature_spanner ()
101 {
102   return make_spanner ("VaticanaLigature", SCM_EOL);
103 }
104
105 bool
106 Vaticana_ligature_engraver::is_stacked_head (int prefix_set,
107                                              int context_info)
108 {
109   bool is_stacked_b;
110
111   // upper head of pes is stacked upon lower head of pes ...
112   is_stacked_b = context_info & PES_UPPER;
113
114   // ... unless this note starts a flexa
115   if (context_info & FLEXA_LEFT)
116     is_stacked_b = false;
117
118   // ... or another pes
119   if (context_info & PES_LOWER)
120     is_stacked_b = false;
121
122   // ... or the previous note is a semivocalis or inclinatum
123   if (context_info & AFTER_DEMINUTUM)
124     is_stacked_b = false;
125
126   // auctum head is never stacked upon preceding note
127   if (prefix_set & AUCTUM)
128     is_stacked_b = false;
129
130   // virga is never stacked upon preceding note
131   if (prefix_set & VIRGA)
132     is_stacked_b = false;
133
134   // oriscus is never stacked upon preceding note
135   if (prefix_set & ORISCUS)
136     is_stacked_b = false;
137
138   if ((prefix_set & DEMINUTUM)
139       && ! (prefix_set & INCLINATUM)
140       && (context_info & FLEXA_RIGHT))
141     is_stacked_b = true; // semivocalis head of deminutus form
142
143   return is_stacked_b;
144 }
145
146 /*
147  * When aligning the heads, sometimes extra space is needed, e.g. to
148  * avoid clashing with the appendix of an adjacent notehead or with an
149  * adjacent notehead itself if it has the same pitch.  Extra space is
150  * added at most once between to heads.
151  */
152 bool
153 Vaticana_ligature_engraver::need_extra_horizontal_space (int prev_prefix_set, int prefix_set,
154                                                          int context_info, int delta_pitch)
155 {
156   if (prev_prefix_set & VIRGA)
157     /*
158      * After a virga, make a an additional small space such that the
159      * appendix on the right side of the head does not touch the
160      * following head.
161      */
162     return true;
163
164   if ((prefix_set & INCLINATUM)
165       && ! (prev_prefix_set & INCLINATUM))
166     /*
167      * Always start a series of inclinatum heads with an extra space.
168      */
169     return true;
170
171   if ((context_info & FLEXA_LEFT) && ! (context_info & PES_UPPER))
172     /*
173      * Before a flexa (but not within a torculus), make a an
174      * additional small space such that the appendix on the left side
175      * of the flexa does not touch the this head.
176      */
177     return true;
178
179   if (delta_pitch == 0)
180     /*
181      * If there are two adjacent noteheads with the same pitch, add
182      * additional small space between them, such that they do not
183      * touch each other.
184      */
185     return true;
186
187   return false;
188 }
189
190 Real
191 Vaticana_ligature_engraver::align_heads (vector<Grob_info> primitives,
192                                          Real flexa_width,
193                                          Real thickness)
194 {
195   if (!primitives.size ())
196     {
197       programming_error ("Vaticana_ligature: "
198                          "empty ligature [ignored]");
199       return 0.0;
200     }
201
202   /*
203    * The paper column where we put the whole ligature into.
204    */
205   Paper_column *column
206     = dynamic_cast<Item *> (primitives[0].grob ())->get_column ();
207
208   Real join_thickness
209     = thickness * column->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
210
211   /*
212    * Amount of extra space two put between some particular
213    * configurations of adjacent heads.
214    *
215    * TODO: make this a property of primtive grobs.
216    */
217   Real extra_space = 4.0 * join_thickness;
218
219   /*
220    * Keep track of the total width of the ligature.
221    */
222   Real ligature_width = 0.0;
223
224   Item *prev_primitive = 0;
225   int prev_prefix_set = 0;
226   for (vsize i = 0; i < primitives.size (); i++)
227     {
228       Item *primitive = dynamic_cast<Item *> (primitives[i].grob ());
229       int prefix_set
230         = scm_to_int (primitive->get_property ("prefix-set"));
231       int context_info
232         = scm_to_int (primitive->get_property ("context-info"));
233
234       /*
235        * Get glyph_name, delta_pitch and context_info for this head.
236        */
237
238       SCM glyph_name_scm = primitive->get_property ("glyph-name");
239       if (glyph_name_scm == SCM_EOL)
240         {
241           primitive->programming_error ("Vaticana_ligature:"
242                                         "undefined glyph-name -> "
243                                         "ignoring grob");
244           continue;
245         }
246       string glyph_name = ly_scm2string (glyph_name_scm);
247
248       int delta_pitch = 0;
249       if (prev_primitive) /* urgh, need prev_primitive only here */
250         {
251           SCM delta_pitch_scm = prev_primitive->get_property ("delta-position");
252           if (delta_pitch_scm != SCM_EOL)
253             delta_pitch = scm_to_int (delta_pitch_scm);
254           else
255             {
256               primitive->programming_error ("Vaticana_ligature:"
257                                             "delta-position undefined -> "
258                                             "ignoring grob");
259               continue;
260             }
261         }
262
263       /*
264        * Now determine width and x-offset of head.
265        */
266
267       Real head_width;
268       Real x_offset;
269
270       if (context_info & STACKED_HEAD)
271         {
272           /*
273            * This head is stacked upon the previous one; hence, it
274            * does not contribute to the total width of the ligature,
275            * and its width is assumed to be 0.0.  Moreover, it is
276            * shifted to the left by its width such that the right side
277            * of this and the other head are horizontally aligned.
278            */
279           head_width = 0.0;
280           x_offset = join_thickness
281             - Font_interface::get_default_font (primitive)->
282             find_by_name ("noteheads.s" + glyph_name).extent (X_AXIS).length ();
283         }
284       else if (glyph_name == "flexa" || glyph_name == "")
285         {
286           /*
287            * This head represents either half of a flexa shape.
288            * Hence, it is assigned half the width of this shape.
289            */
290           head_width = 0.5 * flexa_width;
291           x_offset = 0.0;
292         }
293       else
294         {
295           /*
296            * This is a regular head, placed right to the previous one.
297            * Retrieve its width from corresponding font.
298            */
299           head_width
300             = Font_interface::get_default_font (primitive)->
301             find_by_name ("noteheads.s" + glyph_name).extent (X_AXIS).length ();
302           x_offset = 0.0;
303         }
304
305       /*
306        * Save the head's final x-offset.
307        */
308       primitive->set_property ("x-offset",
309                                scm_from_double (x_offset));
310
311       /*
312        * If the head is the 2nd head of a pes or flexa (but not a
313        * flexa shape), mark this head to be joined with the left-side
314        * neighbour head (i.e. the previous head) by a vertical beam.
315        */
316       if ((context_info & PES_UPPER)
317           || ((context_info & FLEXA_RIGHT)
318               && ! (context_info & PES_LOWER)))
319         {
320           if (!prev_primitive)
321             {
322               primitive->programming_error ("vaticana ligature: add-join: "
323                                             "missing previous primitive");
324             }
325           else
326             {
327               prev_primitive->set_property ("add-join",
328                                             ly_bool2scm (true));
329
330               /*
331                * Create a small overlap of adjacent heads so that the join
332                * can be drawn perfectly between them.
333                */
334               ligature_width -= join_thickness;
335             }
336         }
337       else if (glyph_name == "")
338         {
339           /*
340            * This is the 2nd (virtual) head of flexa shape.  Join it
341            * tightly with 1st head, i.e. do *not* add additional
342            * space, such that next head will not be off from the flexa
343            * shape.
344            */
345         }
346
347       if (need_extra_horizontal_space (prev_prefix_set, prefix_set,
348                                        context_info, delta_pitch))
349         ligature_width += extra_space;
350
351       /*
352        * Horizontally line-up this head to form a ligature.
353        */
354       move_related_items_to_column (primitive, column, ligature_width);
355       ligature_width += head_width;
356
357       prev_primitive = primitive;
358       prev_prefix_set = prefix_set;
359     }
360
361   /*
362    * Add extra horizontal padding space after ligature, such that
363    * neighbouring ligatures do not touch each other.
364    */
365   ligature_width += extra_space;
366
367   return ligature_width;
368 }
369
370 /*
371  * Depending on the typographical features of a particular ligature
372  * style, some prefixes may be ignored.  In particular, if a curved
373  * flexa shape is produced, any prefixes to either of the two
374  * contributing heads that would select a head other than punctum, is
375  * by definition ignored.
376  *
377  * This function prints a warning, if the given primitive is prefixed
378  * such that a head other than punctum would be chosen, if this
379  * primitive were engraved as a stand-alone head.
380  */
381 void
382 Vaticana_ligature_engraver::check_for_prefix_loss (Item *primitive)
383 {
384   int prefix_set
385     = scm_to_int (primitive->get_property ("prefix-set"));
386   if (prefix_set & ~PES_OR_FLEXA)
387     {
388       string prefs = Gregorian_ligature::prefixes_to_str (primitive);
389       primitive->warning (_f ("ignored prefix (es) `%s' of this head according "
390                               "to restrictions of the selected ligature style",
391                               prefs.c_str ()));
392     }
393 }
394
395 void
396 Vaticana_ligature_engraver::add_mora_column (Paper_column *column)
397 {
398   if (augmented_primitives_.size () == 0) // no dot for column
399     return;
400   if (!column) // empty ligature???
401     {
402       augmented_primitives_[0].grob ()->
403         programming_error ("no paper column to add dot");
404       return;
405     }
406   Item *dotcol = make_item ("DotColumn", SCM_EOL);
407   dotcol->set_parent (column, X_AXIS);
408   for (vsize i = 0; i < augmented_primitives_.size (); i++)
409     {
410       Item *primitive =
411         dynamic_cast<Item *> (augmented_primitives_[i].grob ());
412       Item *dot = make_item ("Dots", primitive->self_scm ());
413       dot->set_property ("dot-count", scm_from_int (1));
414       dot->set_parent (primitive, Y_AXIS);
415       primitive->set_object ("dot", dot->self_scm ());
416       Dot_column::add_head (dotcol, primitive);
417
418       // FIXME: why isn't the dot picked up by Paper_column_engraver?
419       // it is, but in the wrong timestep. UGH
420       Separation_item::add_item (column, dot);
421     }
422 }
423
424 /*
425  * This function prints a warning, if the given primitive has the same
426  * pitch as at least one of the primitives already stored in the
427  * augmented_primitives_ array.
428  *
429  * The rationale of this check is, that, if there are two dotted
430  * primitives with the same pitch, then collecting all dots in a dot
431  * column behind the ligature leads to a notational ambiguity of to
432  * which head the corresponding dot refers.
433  *
434  * Such a case should be treated as a badly specified ligature.  The
435  * user should split the ligature to make the notation of dots
436  * unambiguous.
437  */
438 void
439 Vaticana_ligature_engraver::check_for_ambiguous_dot_pitch (Grob_info primitive)
440 {
441   // TODO: Fix performance, which is currently O (n^2) (since this
442   // method is called O (n) times and takes O (n) steps in the for
443   // loop), but could be O (n) (by replacing the for loop by e.g. a
444   // bitmask based O (1) test); where n=<number of primitives in the
445   // ligature> (which is typically small (n<10), though).
446   Stream_event *new_cause = primitive.event_cause ();
447   int new_pitch = unsmob_pitch (new_cause->get_property ("pitch"))->steps ();
448   for (vsize i = 0; i < augmented_primitives_.size (); i++)
449     {
450       Stream_event *cause = augmented_primitives_[i].event_cause ();
451       int pitch = unsmob_pitch (cause->get_property ("pitch"))->steps ();
452       if (pitch == new_pitch)
453         {
454           primitive.grob ()->
455             warning ("Ambiguous use of dots in ligature: there are "
456                      "multiple dotted notes with the same pitch.  "
457                      "The ligature should be split.");
458           return; // supress multiple identical warnings
459         }
460     }
461 }
462
463 void
464 Vaticana_ligature_engraver::transform_heads (Spanner *ligature,
465                                              vector<Grob_info> primitives)
466 {
467   Real flexa_width = robust_scm2double (ligature->get_property ("flexa-width"), 2);
468
469   Real thickness = robust_scm2double (ligature->get_property ("thickness"), 1);
470
471   Item *prev_primitive = 0;
472   int prev_prefix_set = 0;
473   int prev_context_info = 0;
474   int prev_delta_pitch = 0;
475   string prev_glyph_name = "";
476   augmented_primitives_.clear ();
477   for (vsize i = 0; i < primitives.size (); i++)
478     {
479       Item *primitive = dynamic_cast<Item *> (primitives[i].grob ());
480
481       int delta_pitch;
482       SCM delta_pitch_scm = primitive->get_property ("delta-position");
483       if (delta_pitch_scm != SCM_EOL)
484         delta_pitch = scm_to_int (delta_pitch_scm);
485       else
486         {
487           primitive->programming_error ("Vaticana_ligature:"
488                                         "delta-position undefined -> "
489                                         "ignoring grob");
490           continue;
491         }
492
493       /* retrieve & complete prefix_set and context_info */
494       int prefix_set
495         = scm_to_int (primitive->get_property ("prefix-set"));
496       int context_info
497         = scm_to_int (primitive->get_property ("context-info"));
498
499       if (Rhythmic_head::dot_count (primitive) > 0)
500         // remove dots from primitive and add remember primitive for
501         // creating a dot column
502         {
503           Rhythmic_head::get_dots (primitive)->set_property ("dot-count",
504                                                              scm_from_int (0));
505           // TODO: Maybe completely remove grob "Dots" (dots->suicide
506           // () ?) rather than setting property "dot-count" to 0.
507
508           check_for_ambiguous_dot_pitch (primitives[i]);
509           augmented_primitives_.push_back (primitives[i]);
510         }
511       else if (augmented_primitives_.size () > 0)
512         {
513           primitive->warning ("This ligature has a dotted head followed by "
514                               "a non-dotted head.  The ligature should be "
515                               "split after the last dotted head before "
516                               "this head.");
517         }
518
519       if (is_stacked_head (prefix_set, context_info))
520         {
521           context_info |= STACKED_HEAD;
522           primitive->set_property ("context-info",
523                                    scm_from_int (context_info));
524         }
525
526       /*
527        * Now determine which head to typeset (this is context sensitive
528        * information, since it depends on neighbouring heads; therefore,
529        * this decision must be made here in the engraver rather than in
530        * the backend).
531        */
532       string glyph_name;
533       if (prefix_set & VIRGA)
534         {
535           glyph_name = "vaticana.punctum";
536           primitive->set_property ("add-stem", ly_bool2scm (true));
537         }
538       else if (prefix_set & QUILISMA)
539         glyph_name = "vaticana.quilisma";
540       else if (prefix_set & ORISCUS)
541         glyph_name = "solesmes.oriscus";
542       else if (prefix_set & STROPHA)
543         if (prefix_set & AUCTUM)
544           glyph_name = "solesmes.stropha.aucta";
545         else glyph_name = "solesmes.stropha";
546       else if (prefix_set & INCLINATUM)
547         if (prefix_set & AUCTUM)
548           glyph_name = "solesmes.incl.auctum";
549         else if (prefix_set & DEMINUTUM)
550           glyph_name = "solesmes.incl.parvum";
551         else
552           glyph_name = "vaticana.inclinatum";
553       else if (prefix_set & DEMINUTUM)
554         if (i == 0)
555           {
556             // initio debilis
557             glyph_name = "vaticana.reverse.plica";
558           }
559         else if (prev_delta_pitch > 0)
560           {
561             // epiphonus
562             if (! (prev_context_info & FLEXA_RIGHT))
563               /* correct head of previous primitive */
564               if (prev_delta_pitch > 1)
565                 prev_glyph_name = "vaticana.epiphonus";
566               else
567                 prev_glyph_name = "vaticana.vepiphonus";
568             if (prev_delta_pitch > 1)
569               glyph_name = "vaticana.plica";
570             else
571               glyph_name = "vaticana.vplica";
572           }
573         else if (prev_delta_pitch < 0)
574           {
575             // cephalicus
576             if (! (prev_context_info & FLEXA_RIGHT))
577               /* correct head of previous primitive */
578               {
579                 if (i > 1)
580                   {
581                     /* cephalicus head with fixed size cauda */
582                     prev_glyph_name = "vaticana.inner.cephalicus";
583                   }
584                 else
585                   {
586                     /* cephalicus head without cauda */
587                     prev_glyph_name = "vaticana.cephalicus";
588                   }
589
590                 /*
591                  * Flexa has no variable size cauda if its left head is
592                  * stacked on the right head.  This is true for
593                  * cephalicus.  Hence, remove the cauda.
594                  *
595                  * Urgh: for the current implementation, this rule only
596                  * applies for cephalicus; but it is a fundamental rule.
597                  * Therefore, the following line of code should be
598                  * placed somewhere else.
599                  */
600                 prev_primitive->set_property ("add-cauda",
601                                               ly_bool2scm (false));
602               }
603             if (prev_delta_pitch < - 1)
604               glyph_name = "vaticana.reverse.plica";
605             else
606               glyph_name = "vaticana.reverse.vplica";
607           }
608         else // (prev_delta_pitch == 0)
609           {
610             primitive->programming_error ("Vaticana_ligature:"
611                                           "deminutum head must have different "
612                                           "pitch -> ignoring grob");
613           }
614       else if (prefix_set & (CAVUM | LINEA))
615         if ((prefix_set & CAVUM) && (prefix_set & LINEA))
616           glyph_name = "vaticana.linea.punctum.cavum";
617         else if (prefix_set & CAVUM)
618           glyph_name = "vaticana.punctum.cavum";
619         else
620           glyph_name = "vaticana.linea.punctum";
621       else if (prefix_set & AUCTUM)
622         if (prefix_set & ASCENDENS)
623           glyph_name = "solesmes.auct.asc";
624         else
625           glyph_name = "solesmes.auct.desc";
626       else if ((context_info & STACKED_HEAD)
627                && (context_info & PES_UPPER))
628         if (prev_delta_pitch > 1)
629           glyph_name = "vaticana.upes";
630         else
631           glyph_name = "vaticana.vupes";
632       else
633         glyph_name = "vaticana.punctum";
634
635       /*
636        * This head needs a cauda, if it starts a flexa, is not the upper
637        * head of a pes, and if it is a punctum.
638        */
639       if ((context_info & FLEXA_LEFT) && ! (context_info & PES_UPPER))
640         if (glyph_name == "vaticana.punctum")
641           primitive->set_property ("add-cauda", ly_bool2scm (true));
642
643       /*
644        * Execptional rule for porrectus:
645        *
646        * If the current head is preceded by a \flexa and succeded by a
647        * \pes (e.g. "a \flexa g \pes a"), then join the current head and
648        * the previous head into a single curved flexa shape.
649        */
650       if ((context_info & FLEXA_RIGHT) && (context_info & PES_LOWER))
651         {
652           check_for_prefix_loss (prev_primitive);
653           prev_glyph_name = "flexa";
654           prev_primitive->set_property ("flexa-height",
655                                         scm_from_int (prev_delta_pitch));
656           prev_primitive->set_property ("flexa-width",
657                                         scm_from_double (flexa_width));
658           bool add_cauda = !(prev_prefix_set && PES_OR_FLEXA);
659           prev_primitive->set_property ("add-cauda",
660                                         ly_bool2scm (add_cauda));
661           check_for_prefix_loss (primitive);
662           glyph_name = "";
663           primitive->set_property ("flexa-width",
664                                    scm_from_double (flexa_width));
665         }
666
667       /*
668        * Exceptional rule for pes:
669        *
670        * If this head is stacked on the previous one due to a \pes, then
671        * set the glyph of the previous head to that for this special
672        * case, thereby avoiding potential vertical collision with the
673        * current head.
674        */
675       if (prefix_set & PES_OR_FLEXA)
676         {
677           if ((context_info & PES_UPPER) && (context_info & STACKED_HEAD))
678             {
679               if (prev_glyph_name == "vaticana.punctum")
680                 if (prev_delta_pitch > 1)
681                   prev_glyph_name = "vaticana.lpes";
682                 else
683                   prev_glyph_name = "vaticana.vlpes";
684             }
685         }
686
687       if (prev_primitive)
688         prev_primitive->set_property ("glyph-name",
689                                       ly_string2scm (prev_glyph_name));
690
691       /*
692        * In the backend, flexa shapes and joins need to know about line
693        * thickness.  Hence, for simplicity, let's distribute the
694        * ligature grob's value for thickness to each ligature head (even
695        * if not all of them need to know).
696        */
697       primitive->set_property ("thickness", scm_from_double (thickness));
698
699       prev_primitive = primitive;
700       prev_prefix_set = prefix_set;
701       prev_context_info = context_info;
702       prev_delta_pitch = delta_pitch;
703       prev_glyph_name = glyph_name;
704     }
705
706   prev_primitive->set_property ("glyph-name",
707                                 ly_string2scm (prev_glyph_name));
708
709   align_heads (primitives, flexa_width, thickness);
710
711   // append all dots to paper column of ligature's last head
712   add_mora_column (prev_primitive->get_column ());
713
714 #if 0 // experimental code to collapse spacing after ligature
715   /* TODO: set to max (old/new spacing-increment), since other
716      voices/staves also may want to set this property. */
717   Item *first_primitive = dynamic_cast<Item *> (primitives[0].grob ());
718   Paper_column *paper_column = first_primitive->get_column ();
719   paper_column->warning (_f ("Vaticana_ligature_engraver: "
720                              "setting `spacing-increment = %f': ptr =%ul",
721                              ligature_width, paper_column));
722   paper_column->
723     set_property ("forced-spacing", scm_from_double (ligature_width));
724 #endif
725 }
726
727 ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, rest);
728 ADD_ACKNOWLEDGER (Vaticana_ligature_engraver, note_head);
729 ADD_TRANSLATOR (Vaticana_ligature_engraver,
730                 /* doc */ "Handles ligatures by glueing special ligature heads together.",
731                 /* create */ "VaticanaLigature DotColumn",
732                 /* read */ "",
733                 /* write */ "");