gregorio icon indicating copy to clipboard operation
gregorio copied to clipboard

Line height adjustment is off when linebreak is in a clef change

Open olivierberten opened this issue 3 years ago • 8 comments

funnycustos

https://gregobase.selapa.net/chant.php?id=13362

olivierberten avatar Jan 21 '21 22:01 olivierberten

I think that the automatic eol custos should be suppressed in this instance as the clef-change custos already provides the necessary information. Is that what you'd want?

rpspringuel avatar Feb 02 '21 18:02 rpspringuel

Well... I thought the custo was wrong but I just realize the actual bug is the whole second line is shifted down by half a line (except for the clef)... It's been fixed on Gregobase because the gabc code wasn't really optimal but it might be worth checking how this happened...

olivierberten avatar Feb 02 '21 19:02 olivierberten

the whole second line is shifted down by half a line (except for the clef)

Huh? Can you post a full MWE so that I can see this?

rpspringuel avatar Feb 02 '21 19:02 rpspringuel

% !TEX TS-program = lualatex
% !TEX encoding = UTF-8

\documentclass[12pt]{article}
\usepackage{geometry}
\geometry{paperwidth=16cm,paperheight=20cm}
\usepackage{gregoriotex}
\usepackage{fullpage}

\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Linux Libertine O}

\pagestyle{empty}
\begin{document}

\gabcsnippet{(f3) be(gihh)rá(iv//hjIHhf/hih)ti(hv//hhh//hv//hhh) (,) su(f)mus.(f/hhhf/hhh/fgf) (z0)(::) <sp>V/</sp> 1.(c3) Ni(fe)si(ef) quod(fh) Dó(hhhhihivHGhhhf;hhhf/hhiv,hjIHhvGF)mi(f)nus(fhffe) (;) e(fhhhhhihi)rat(f) (;) in(fe~) no(ef)bis,(fhFE,f/hhh/fgFEfgffe) (:) di(bd)cat(dfe) nunc(ef) (;) }

\end{document}

olivierberten avatar Feb 02 '21 19:02 olivierberten

In case it's of any use: it happens on the second pass.

olivierberten avatar Feb 02 '21 20:02 olivierberten

It's not the notes that are being pushed down, it's the staff lines (which include the clef) which are being pushed up (along with the lyrics on the line above, and all content on the line below). There must be an error in the automatic line height adjustment algorithm so that the notes are seeing the same vertical adjustment as everything else.

rpspringuel avatar Feb 02 '21 20:02 rpspringuel

Idea on what might be happening: The custos before the bar lines is the lowest element of the top staff and thus should be setting the line height settings. However, because it's part of a clef change, it's inside a discretionary which may be effecting the timing of its line height settings so that they are applying differently to the stafflines (and clef, both of which are inside the \localleftbox) and the notes (whose height adjustments are read in from the aux file, having been written there by the post_linebreak_filter on the previous pass).

rpspringuel avatar Feb 06 '21 17:02 rpspringuel

This is fixable by replacing (z0)(::) <sp>V/</sp> 1.(c3) with (z0::c3) <sp>V/</sp> 1.. This is how the tutorial website indicates a clef change should be made, and has the additional benefit of allowing the V/-symbol to appear on the following line, where it truly belongs.

Placing the V/-symbol (or anything else) between the forced custos and the new clef seems to be causing of the issue.

https://gregobase.selapa.net/chant.php?id=13362 is now fixed.

fiat96 avatar Feb 10 '21 14:02 fiat96