+ return make_spanner ("VaticanaLigature", SCM_EOL);
+}
+
+bool
+Vaticana_ligature_engraver::is_stacked_head (int prefix_set,
+ int context_info)
+{
+ bool is_stacked;
+
+ // upper head of pes is stacked upon lower head of pes ...
+ is_stacked = context_info & PES_UPPER;
+
+ // ... unless this note starts a flexa
+ if (context_info & FLEXA_LEFT)
+ is_stacked = false;
+
+ // ... or another pes
+ if (context_info & PES_LOWER)
+ is_stacked = false;
+
+ // ... or the previous note is a semivocalis or inclinatum
+ if (context_info & AFTER_DEMINUTUM)
+ is_stacked = false;
+
+ // auctum head is never stacked upon preceding note
+ if (prefix_set & AUCTUM)
+ is_stacked = false;
+
+ // virga is never stacked upon preceding note
+ if (prefix_set & VIRGA)
+ is_stacked = false;
+
+ // oriscus is never stacked upon preceding note
+ if (prefix_set & ORISCUS)
+ is_stacked = false;
+
+ if ((prefix_set & DEMINUTUM)
+ && ! (prefix_set & INCLINATUM)
+ && (context_info & FLEXA_RIGHT))
+ is_stacked = true; // semivocalis head of deminutus form
+
+ return is_stacked;
+}
+
+/*
+ * When aligning the heads, sometimes extra space is needed, e.g. to
+ * avoid clashing with the appendix of an adjacent notehead or with an
+ * adjacent notehead itself if it has the same pitch. Extra space is
+ * added at most once between to heads.
+ */
+bool
+Vaticana_ligature_engraver::need_extra_horizontal_space (int prev_prefix_set, int prefix_set,
+ int context_info, int delta_pitch)
+{
+ if (prev_prefix_set & VIRGA)
+ /*
+ * After a virga, make a an additional small space such that the
+ * appendix on the right side of the head does not touch the
+ * following head.
+ */
+ return true;
+
+ if ((prefix_set & INCLINATUM)
+ && ! (prev_prefix_set & INCLINATUM))
+ /*
+ * Always start a series of inclinatum heads with an extra space.
+ */
+ return true;
+
+ if ((context_info & FLEXA_LEFT) && ! (context_info & PES_UPPER))
+ /*
+ * Before a flexa (but not within a torculus), make a an
+ * additional small space such that the appendix on the left side
+ * of the flexa does not touch the this head.
+ */
+ return true;
+
+ if (delta_pitch == 0)
+ /*
+ * If there are two adjacent noteheads with the same pitch, add
+ * additional small space between them, such that they do not
+ * touch each other.
+ */
+ return true;
+
+ return false;