- /*
- * In the backend, flexa shapes and joins need to know about line
- * thickness. Hence, for simplicity, let's distribute the
- * ligature grob's value for thickness to each ligature head (even
- * if not all of them need to know).
- */
- primitive->set_grob_property ("thickness", gh_double2scm (thickness));
+ /*
+ * Execptional rule for porrectus:
+ *
+ * If the current head is preceded by a \flexa and succeded by a
+ * \pes (e.g. "a \flexa g \pes a"), then join the current head and
+ * the previous head into a single curved flexa shape.
+ */
+ if ((context_info & FLEXA_RIGHT) && (context_info & PES_LOWER))
+ {
+ check_for_prefix_loss (prev_primitive);
+ prev_glyph_name = "flexa";
+ prev_primitive->set_property ("flexa-height",
+ scm_from_int (prev_delta_pitch));
+ prev_primitive->set_property ("flexa-width",
+ scm_from_double (flexa_width));
+ bool add_cauda = !(prev_prefix_set && PES_OR_FLEXA);
+ prev_primitive->set_property ("add-cauda",
+ ly_bool2scm (add_cauda));
+ check_for_prefix_loss (primitive);
+ glyph_name = "";
+ primitive->set_property ("flexa-width",
+ scm_from_double (flexa_width));
+ }
+
+ /*
+ * Exceptional rule for pes:
+ *
+ * If this head is stacked on the previous one due to a \pes, then
+ * set the glyph of the previous head to that for this special
+ * case, thereby avoiding potential vertical collision with the
+ * current head.
+ */
+ if (prefix_set & PES_OR_FLEXA)
+ {
+ if ((context_info & PES_UPPER) && (context_info & STACKED_HEAD))
+ {
+ if (prev_glyph_name == "vaticana.punctum")
+ if (prev_delta_pitch > 1)
+ prev_glyph_name = "vaticana.lpes";
+ else
+ prev_glyph_name = "vaticana.vlpes";
+ }
+ }