gregorio icon indicating copy to clipboard operation
gregorio copied to clipboard

Control horizontal alignment of NABC neumes relative to GABC notes

Open lbssousa opened this issue 6 months ago • 3 comments

Following https://github.com/gregorio-project/gregorio/issues/1662#issuecomment-2850994662, I would like to suggest a feature in GregorioTeX to allow controlling the horizontal alignment (left, center, right) of NABC neums relative to its GABC counterparts. Currently, they're left-aligned.

lbssousa avatar May 07 '25 21:05 lbssousa

Currently there is not any notion of a gabc "counterpart", so this could be harder than it sounds.

davidweichiang avatar May 08 '25 00:05 davidweichiang

Currently there is not any notion of a gabc "counterpart", so this could be harder than it sounds.

Currently, in a score generated by e.g. Text(gabc1|nabc1|gabc2|nabc2...) the NABC neumes rendered by nabc1 are left-aligned to square notes rendered by gabc1, nabc2 left-aligned to gabc2, and so on. How is this currently calculated? Is it so hard in current GregorioTeX implementation to calculate the widths of rendered glyphs to allow centering or right-alignment?

lbssousa avatar May 10 '25 12:05 lbssousa

What I mean is that if you have a score like

word(ababab|pu|cdcdcd|pu)

internally the ababab is split into two elements, ababa and b, and the pu is attached to the ababa. Presumably it would be surprising to center the pu over just ababa.

Maybe the mechanism already used for centering a translation over multiple syllables could be repurposed for centering nabc over multiple elements. gregorio would emit a command \GreNABCCenterEnd at the end of each nabc segment, and the Lua post-linebreak filter could do the centering.

davidweichiang avatar May 10 '25 16:05 davidweichiang