Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/).
- Decouple visibility control for NABC and above-lines text from notes. Solves [#1547](https://github.com/gregorio-project/gregorio/issues/1547).
- Added proper vertical spacing and alignment of score elements in NABC+lyrics-only contexts. Solves [#1694](https://github.com/gregorio-project/gregorio/issues/1694).
- Added horizontal spacing preservation for NABC neumes, preventing overlap. Solves [#1699](https://github.com/gregorio-project/gregorio/issues/1699).
- Added `\gresetnabcinterglyphpadding` command to add compensating horizontal space between glyphs when NABC neumes overflow beyond the glyph width. Prevents NABC overlap at glyph boundaries within a syllable. Supports per-voice configuration with optional voice parameter.
- Added overtie/undertie special symbols (`<sp>ut</sp>` for `\greundertie`, `<sp>ot</sp>` for `\greovertie`, and `<sp>dt</sp>` for `\gredoubletie`), and a configurable lyric tying shorthand (`~` for `\GreLyricTie`).
- Added support for the C23 standard (the default in GCC 15). The included build scripts continue to default to GNU89 C.
- Added `nabcintersyllablemingap` distance (configurable via `\grechangedim`), which sets a minimum separation between NABC glyphs of consecutive syllables. Defaults to 0.06 cm (25% of `intersyllablespacenotes`). See [#1715](https://github.com/gregorio-project/gregorio/issues/1715).

### Fixed
- Fixed a bug that could cause a punctum mora that is supposed to be below the line (`.0`) to appear above the line. This bug was platform-dependent and was observed on a Windows system. See [#1642](https://github.com/gregorio-project/gregorio/issues/1642).
- Error messages from executable have been cleaned up to be more uniform. See [#1644](https://github.com/gregorio-project/gregorio/issues/1644).
- NABC neumes are now rendered for syllables with empty GABC/NABC snippets when NABC content is present (e.g. `(|vi|ta)`, `(|vi)`, `(||ta)`, `(g||ta)`). See [#1700](https://github.com/gregorio-project/gregorio/issues/1700).
- Fixed excessive inter-syllable spacing caused by the NABC extrakern mechanism being applied even when the natural spacing between syllables is already sufficient to prevent NABC overlap. See [#1715](https://github.com/gregorio-project/gregorio/issues/1715).

## [Unreleased][CTAN]
### Fixed
Expand Down
4 changes: 4 additions & 0 deletions doc/Command_Index_User.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1840,6 +1840,10 @@ \subsection{Distances}\label{distances}
Larger space between elements in ancient notation.
\end{gdimension}

\begin{gdimension}{nabcintersyllablemingap}
Minimum gap between NABC glyphs of consecutive syllables. When NABC neumes extend beyond the notes box of a syllable, Gregorio\TeX\ computes an overflow that pushes the next syllable to the right to prevent NABC overlap. This distance sets a minimum separation that is enforced even when the NABC would otherwise just barely fit. The default value (0.06\,cm) is 25\% of \texttt{intersyllablespacenotes} and provides a comfortable visual margin. Set to \texttt{0pt} to disable the minimum gap and rely solely on physical overflow.
\end{gdimension}

\begin{gdimension}{clivisalignmentmin}
When \verb=\gre@clivisalignment= is 2, this distance is the maximum length of the consonants after vowels for which the clivis will be aligned on its center.
\end{gdimension}
Expand Down
17 changes: 10 additions & 7 deletions doc/Command_Index_internal.tex
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,8 @@ \section{Gregorio\TeX{} Controls}
\#2 & content & The note material to render.\\
\end{argtable}

\macroname{\textbackslash gre@compute@nabc@extrakern}{}{gregoriotex-syllable.tex}
Computes extra horizontal space needed when NABC neumes extend past the total width of the syllable notes. If \verb=\gre@dimen@nabc@maxwidth= exceeds the width of \verb=\gre@box@syllablenotes=, the difference is stored in \verb=\gre@dimen@nabc@extrakern= and a kern of that amount is appended to the syllable notes box.
\macroname{\textbackslash gre@compute@nabc@syllable@overflow}{}{gregoriotex-syllable.tex}
Computes the inter-syllable right-overflow needed to prevent NABC neumes of adjacent syllables from colliding. Uses \verb=\gre@dimen@nabc@maxwidth= (widest NABC across all voices) plus \verb=\gre@space@dimen@nabcintersyllablemingap= minus the original notes width (before end-difference reduction); the result is clamped to zero. Stored in \verb=\gre@dimen@nabc@syllable@overflow= and carried forward to the next syllable as \verb=\gre@dimen@nabc@syllable@prevoverflow=.

\macroname{\textbackslash gre@check@nabc@needsspacing}{}{gregoriotex-syllable.tex}
Checks if any NABC voice is visible and sets \verb=\ifgre@nabc@needsspacing= accordingly. When true, horizontal spacing must be preserved even when notes are invisible, to prevent NABC neume overlap.
Expand All @@ -804,7 +804,7 @@ \section{Gregorio\TeX{} Controls}
\end{argtable}

\macroname{\textbackslash gre@notes@rendernabc@tight}{\#1}{gregoriotex-syllable.tex}
Renders NABC neumes without preserving any note glyph or inter-element spacing. Uses \verb=\gre@nabconlyglyph= instead of \verb=\GreGlyph= and suppresses all end-of-element and end-of-glyph callbacks, as well as bar output. The total horizontal width comes entirely from \verb=\gre@compute@nabc@extrakern=. This produces tighter spacing than the hphantom path.
Renders NABC neumes without preserving any note glyph or inter-element spacing. Uses \verb=\gre@nabconlyglyph= instead of \verb=\GreGlyph= and suppresses all end-of-element and end-of-glyph callbacks, as well as bar output. The total horizontal width is provided by the inter-syllable overflow mechanism (\verb=\gre@dimen@nabc@syllable@prevoverflow=) rather than by an in-box kern. This produces tighter spacing than the hphantom path.

\begin{argtable}
\#1 & content & The notes material to process for NABC rendering.\\
Expand Down Expand Up @@ -1472,7 +1472,7 @@ \section{Gregorio\TeX{} Controls}
\end{argtable}

\macroname{\textbackslash gre@nabc@prepare}{\#1\#2}{gregoriotex-main.tex}
Phase 1 of NABC two-phase processing: pre-evaluates NABC content, tracks the maximum NABC width in \verb=\gre@dimen@nabc@maxwidth= for right-overflow detection by \verb=\gre@compute@nabc@extrakern=, emits note-level kern for left overflow (in \texttt{neume} alignment mode) unless \verb=\ifgre@nabc@suppress@leftoverflow= is true, and saves the rendered content in a box register.
Phase 1 of NABC two-phase processing: pre-evaluates NABC content, tracks the maximum NABC width in \verb=\gre@dimen@nabc@maxwidth= for right-overflow detection by \verb=\gre@compute@nabc@syllable@overflow=, emits note-level kern for left overflow (in \texttt{neume} alignment mode) unless \verb=\ifgre@nabc@suppress@leftoverflow= is true, and saves the rendered content in a box register.

\begin{argtable}
\#1 & content & The NABC content (from \textbackslash GreNABCChar)\\
Expand Down Expand Up @@ -2357,10 +2357,13 @@ \subsection{Distances}
Saved (pre-zeroed) value of the total staff height. This dimension always holds the true computed value of \verb=\gre@dimen@staffheight= regardless of whether staff dimensions have been zeroed. Computed from \verb=\gre@dimen@stafflineheight@saved= and \verb=\gre@dimen@interstafflinespace@saved=.

\macroname{\textbackslash gre@dimen@nabc@maxwidth}{}{gregoriotex-syllable.tex}
Tracks the maximum NABC width for the current syllable across all voices. Used to detect when NABC extends past the total glyph width and extra horizontal space is needed at the end of the syllable to prevent overlap with the next NABC. Reset to 0pt at the start of each syllable.
Tracks the maximum NABC width for the current syllable across all voices. Used by \verb=\gre@compute@nabc@syllable@overflow= to determine if NABC extends past the notes and extra space is needed. Reset to 0pt at the start of each syllable.

\macroname{\textbackslash gre@dimen@nabc@extrakern}{}{gregoriotex-syllable.tex}
Stores the extra kern needed at the end of the syllable to accommodate NABC overflow. Computed by \verb=\gre@compute@nabc@extrakern= during the pre-measurement pass in \verb=\gre@syllablenotes= and applied after the real notes typesetting in \verb=\GreSyllable=. Reset to 0pt at the start of each syllable.
\macroname{\textbackslash gre@dimen@nabc@syllable@overflow}{}{gregoriotex-syllable.tex}
Stores the inter-syllable right-overflow computed by \verb=\gre@compute@nabc@syllable@overflow= for the current syllable. Reduced by \verb=\gre@dimen@syllablefinalskip= and \verb=\gre@dimen@nextbegindifference= before being saved as \verb=\gre@dimen@nabc@syllable@prevoverflow=. Reset to 0pt at the start of each syllable.

\macroname{\textbackslash gre@dimen@nabc@syllable@prevoverflow}{}{gregoriotex-syllable.tex}
Carries the right-overflow of the previous syllable into the current one. A kern of this amount is prepended before the notes of the current syllable (and subtracted from \verb=\gre@dimen@notesaligncenter=) so that the NABC of the previous syllable does not collide with that of the current syllable. Discarded if the current syllable has no NABC. Reset at the start of each syllable.

\macroname{\textbackslash gre@dimen@glyphraisevalue}{}{gregoriotex-spaces.tex}
The value that a particular glyph must be raised to be set in the correct position.
Expand Down
4 changes: 4 additions & 0 deletions tex/gregoriotex-gsp-default.tex
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
\gre@createdim{skip}{nabcinterelementspace}{0.06927 cm plus 0.00182 cm minus 0.00363 cm}{scalable}%
% larger space between elements in ancient notation
\gre@createdim{skip}{nabclargerspace}{0.10938 cm plus 0.01822 cm minus 0.00911 cm}{scalable}%
% minimum gap between NABC glyphs of consecutive syllables; when the natural
% inter-syllable separation would produce a smaller gap, a compensating kern
% is added. Default: 25% of intersyllablespacenotes.
\gre@createdim{dimen}{nabcintersyllablemingap}{0.06 cm}{scalable}%
% space between elements which has the size of a note
\gre@createdim{skip}{glyphspace}{0.21877 cm plus 0.01822 cm minus 0.01822 cm}{scalable}%
% space before in-line custos
Expand Down
6 changes: 3 additions & 3 deletions tex/gregoriotex-main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,9 @@
% nodes do not carry a stray part=7 when preparing voice 2.
\def\gre@nabc@prepare#1#2{%
\setbox\gre@box@nabctemp=\hbox{#1}%
% Track maximum NABC width for right-overflow detection (extra kern at
% syllable end). Without this, \gre@compute@nabc@extrakern cannot detect
% when NABC content extends past the syllable notes width.
% Track maximum NABC width for inter-syllable right-overflow detection.
% This allows \gre@compute@nabc@syllable@overflow to detect when NABC
% content extends past the effective syllable width.
\ifdim\wd\gre@box@nabctemp>\gre@dimen@nabc@maxwidth\relax%
\global\gre@dimen@nabc@maxwidth=\wd\gre@box@nabctemp\relax%
\fi%
Expand Down
3 changes: 3 additions & 0 deletions tex/gregoriotex-spaces.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,9 @@
\ifgre@scale@nabclargerspace%
\gre@changeonedimenfactor{nabclargerspace}{#1}{#2}%
\fi%
\ifgre@scale@nabcintersyllablemingap%
\gre@changeonedimenfactor{nabcintersyllablemingap}{#1}{#2}%
\fi%
\ifgre@scale@glyphspace%
\gre@changeonedimenfactor{glyphspace}{#1}{#2}%
\fi%
Expand Down
Loading