summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-syllable.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-syllable.tex')
-rw-r--r--Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-syllable.tex513
1 files changed, 419 insertions, 94 deletions
diff --git a/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-syllable.tex b/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-syllable.tex
index 40588a3705e..22c5dea2e24 100644
--- a/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-syllable.tex
+++ b/Master/texmf-dist/tex/luatex/gregoriotex/gregoriotex-syllable.tex
@@ -1,6 +1,6 @@
%GregorioTeX file.
%
-% Copyright (C) 2007-2016 The Gregorio Project (see CONTRIBUTORS.md)
+% Copyright (C) 2007-2017 The Gregorio Project (see CONTRIBUTORS.md)
%
% This file is part of Gregorio.
%
@@ -19,8 +19,7 @@
% this file contains definitions of the glyphs and the syllables
-\gre@debugmsg{general}{Loading gregoriotex-syllable.tex}%
-\gre@declarefileversion{gregoriotex-syllable.tex}{4.1.5}% GREGORIO_VERSION
+\gre@declarefileversion{gregoriotex-syllable.tex}{5.0.1}% GREGORIO_VERSION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% macros for the typesetting of the different glyphs
@@ -65,6 +64,7 @@
}%
\def\gre@pointandclick#1#2{%
+ \gre@trace{gre@pointandclick{#1}{#2}}%
\def\gre@@arg{#2}%
\ifx\gre@@arg\gre@nothing %
#1%
@@ -85,9 +85,11 @@
\fi %
\fi %
\fi %
+ \gre@trace@end%
}%
\def\gre@newglyphcommon{%
+ \gre@trace{gre@newglyphcommon}%
\global\advance\gre@attr@glyph@id by 1\relax %
% first there is something we must do: setting \gre@lastoflinecount to 0 if its value is 2. The reason of this is that in ab(abzcd), we cannot let \grelastoflinecount set to 2 after the end of line... the only way I found to achieve it is to reset \grelastoflinecount to 0 after each glyph or bar.
\ifnum\gre@lastoflinecount=2\relax %
@@ -103,19 +105,22 @@
\global\gre@lastendswithmorafalse %
\ifgre@boxing\else\ifgre@firstin@euouae %
\ifgre@raggedbreakbeforeeuouae %
- \directlua{gregoriotex.save_pos(\the\gre@lasteuouaeindex,2)}%
+ \directlua{gregoriotex.save_euouae(\the\gre@lasteuouaeindex,2)}%
\fi %
\gre@firstin@euouaefalse %
\fi\fi %
\relax %
+ \gre@trace@end%
}%
\def\gre@endofglyphcommon{%
+ \gre@trace{gre@endofglyphcommon}%
\ifgre@endofscore %
- \gre@penalty{\grefinalpenalty}%
+ \gre@penalty{\the\gre@space@count@finalpenalty}%
\gre@localleftbox{}%
\gre@localrightbox{}%
\fi %
+ \gre@trace@end%
}
% passes the glyph height limits:
@@ -132,7 +137,7 @@
% macro to typeset the glyph. attributes are :
% #1: character : the character that it must call
% #2: height : the height it must be raised : can be negative (must be calculated by a preprocessor)
-% #3: height of the next note : we define the custos with that
+% #3: typesets the next custos
% #4: type : the type of glyph, to determine the aligncenter; can be :
%%%%%%%% 0 : one-note glyph or more than two notes glyph except porrectus : here we must put the aligncenter in the middle of the first note
%%%%%%%% 1 : two notes glyph (podatus is considered as a one-note glyph) : here we put the aligncenter in the middle of the glyph
@@ -160,7 +165,7 @@
\raise\gre@dimen@glyphraisevalue%
\copy\gre@box@temp@width%
\ifgre@endofscore\else\ifgre@boxing\else %
- \GreNextCustos{#3}%
+ #3%
\fi\fi %
\ifgre@firstglyph% we check if it is the first glyph
\gre@calculate@notesaligncenter{#4}%
@@ -195,6 +200,7 @@
% there is a tricky here : if notesaligncenter is not 0, it means that there is a flat before, so we simply add notes aligncenter
% #2 is 0 if we are in the context of current syllable, 1 if we are in the context of next syllable
\def\gre@calculate@simplenotesaligncenter#1#2{%
+ \gre@trace{gre@calculate@simplenotesaligncenter{#1}{#2}}%
\ifcase#1%
%case of punctum
\global\setbox\gre@box@temp@width=\hbox{\gre@font@music\GreCPPunctum}%
@@ -212,10 +218,10 @@
\global\setbox\gre@box@temp@width=\hbox{\gre@font@music\GreCPQuilisma}%
\or %
%case of an oriscus
- \global\setbox\gre@box@temp@width=\hbox{\gre@font@music\GreCPOriscus}%
+ \global\setbox\gre@box@temp@width=\hbox{\gre@font@music\GreCPAscendensOriscus}%
\or %
%case of a punctum inclinatum
- \global\setbox\gre@box@temp@width=\hbox{\gre@font@music\GreCPPunctumInclinatum}%
+ \global\setbox\gre@box@temp@width=\hbox{\gre@font@music\GreCPDescendensPunctumInclinatum}%
\or %
%case of a stropha
\global\setbox\gre@box@temp@width=\hbox{\gre@font@music\GreCPStropha}%
@@ -253,6 +259,7 @@
\fi%
\fi%
\relax%
+ \gre@trace@end%
}%
% aux function to previous one: sets \gre@box@temp@width to \hbox{#1} or \hbox{#2}
@@ -270,6 +277,7 @@
%
% #3 is the same as #2 of previous function
\def\gre@handleclivisspecialalignment#1#2#3{%
+ \gre@trace{gre@handleclivisspecialalignment{#1}{#2}{#3}}%
\ifcase\gre@clivisalignment%
\global\setbox\gre@box@temp@width=\hbox{#1}%
\or%
@@ -290,9 +298,11 @@
\fi%
\else% vowel or first-letter centering
\ifcase#3%
+ % *always* emit end syllable part for proper determination of
+ % clivis alignment
\gre@widthof{\gre@endsyllablepart}%
\else%
- \gre@widthof{\gre@nextendsyllablepart}%
+ \gre@widthof{\gre@evaluatenextsyllable{\gre@nextendsyllablepart}}%
\fi%
\gre@debugmsg{ifdim}{ temp@three > clivisalignmentmin}%
\ifdim\gre@dimen@temp@three >\gre@space@dimen@clivisalignmentmin\relax%
@@ -303,18 +313,22 @@
\fi%
\fi%
\fi%
+ \gre@trace@end%
}%
% the "hat" function, that calls the simple function with the good argument, according to the fact that it's a flat, natural, etc.
% warning: the behaviour of all this is quite difficult to understand: this function is called with simple arguments (between 0 and 20) by the glyph function. In this case we add the align center of the argument to notesaligncenter ; and notesaligncenter can be already set to something by flat and natural.
\def\gre@calculate@notesaligncenter#1{%
+ \gre@trace{gre@calculate@notesaligncenter{#1}}%
\gre@calculate@simplenotesaligncenter{#1}{0}%
\global\advance\gre@dimen@notesaligncenter by \dimexpr(\wd\gre@box@temp@width / 2)\relax %
\relax %
+ \gre@trace@end%
}%
% this is the function that we call when we try to determine the next aligncenter of the notes. In this case we call this function with normal arguments if there is no flat nor natural ; we call it with argument + 20 if there is a flat and argument + 40 if there is a natural, +60 with a sharp
\def\gre@calculate@nextnotesaligncenter#1{%
+ \gre@trace{gre@calculate@nextnotesaligncenter{#1}}%
\ifnum#1<20\relax %
\gre@calculate@simplenotesaligncenter{#1}{1}%
\gre@dimen@temp@five=\dimexpr(\wd\gre@box@temp@width / 2)\relax %
@@ -343,15 +357,41 @@
\global\gre@dimen@notesaligncenter=\gre@dimen@temp@five %
\fi %
\relax %
+ \gre@trace@end%
}%
% box that we will use to determine the width of the notes, to determine wether we typeset a - or not after the letters
\newbox\gre@box@syllablenotes%
+\newif\ifgre@showlyrics%
+\gre@showlyricstrue%
+
+\def\gresetlyrics#1{%
+ \IfStrEqCase{#1}{%
+ {visible}{\gre@showlyricstrue}%
+ {invisible}{\gre@showlyricsfalse}%
+ }[% all other cases
+ \gre@error{Unknown option, "#1" for \protect\gresetlyrics\MessageBreak Possible options are: 'visible' and 'invisible'}%
+ ]%
+}%
+
+\newif\ifgre@shownotes%
+\gre@shownotestrue%
+
+\def\gresetnotes#1{%
+ \IfStrEqCase{#1}{%
+ {visible}{\gre@shownotestrue}%
+ {invisible}{\gre@shownotesfalse}%
+ }[% all other cases
+ \gre@error{Unknown option, "#1" for \protect\gresetnotes\MessageBreak Possible options are: 'visible' and 'invisible'}%
+ ]%
+}%
+
% Macro used to fill \gre@box@syllablenotes with everything contained in #1. This
% saves and restores a few values so that when really typesetting #1 in \GreSyllable,
% the result is identical.
\def\gre@syllablenotes#1{%
+ \gre@trace{gre@syllablenotes{#1}}%
% \gre@count@lastglyphiscavum is reinitialized at each syllable...
% so there's a bug on g(bx)g(b)
\global\gre@count@lastglyphiscavum=0\relax %
@@ -359,7 +399,11 @@
\global\gre@boxingtrue%
\let\ifgre@lastendswithmorasave\ifgre@lastendswithmora%
\xdef\gre@savedlastoflinecount{\number\gre@lastoflinecount\relax }%
- \setbox\gre@box@syllablenotes=\hbox{#1}%
+ \ifgre@shownotes%
+ \setbox\gre@box@syllablenotes=\hbox{#1}%
+ \else%
+ \setbox\gre@box@syllablenotes=\box\voidb@x%
+ \fi%
\gre@debugmsg{spacing}{Width of notes: \the\wd\gre@box@syllablenotes}%
\global\gre@boxingfalse%
\global\gre@lastoflinecount=\gre@savedlastoflinecount\relax %
@@ -380,6 +424,7 @@
\global\gre@skip@bar@lastskip=0pt\relax %
\global\gre@endofscorefalse %
\relax %
+ \gre@trace@end%
}%
@@ -452,7 +497,9 @@
% a function to cancel the previous one
\def\gre@unsetfixedtextformat{%
+ \gre@trace{gre@unsetfixedtextformat}%
\global\let\gre@fixedtextformat\gre@textnormal %
+ \gre@trace@end%
}%
\let\gre@fixedtextformat\gre@textnormal %
@@ -479,7 +526,9 @@
% a function to cancel the previous one
\def\gre@unsetfixednexttextformat{%
+ \gre@trace{gre@unsetfixednexttextformat}%
\global\let\gre@fixednexttextformat\gre@textnormal %
+ \gre@trace@end%
}%
\let\gre@fixednexttextformat\gre@textnormal %
@@ -594,13 +643,6 @@
\xdef\gre@lyriccentering{1}%
-\def\englishcentering{%OBSOLETE
- \gre@obsolete{\protect\englishcentering}{\protect\gresetlyriccentering{syllable}}%
-}%
-
-\def\defaultcentering{%OBSOLETE
- \gre@obsolete{\protect\defaultcentering}{\protect\gresetlyriccentering{vowel} }%
-}%
%% options about clivis centering scheme. Clivis are usually aligned by their
%% center, which is different from most neumes. Gregorio has three modes:
@@ -627,17 +669,6 @@
]%
}%
-\def\clivisalignmentalways{%OBSOLETE
- \gre@obsolete{\protect\clivisalignmentalways}{\protect\gresetclivisalignment{always}}%
-}%
-
-\def\clivisalignmentnever{%OBSOLETE
- \gre@obsolete{\protect\clivisalignmentnever}{\protect\gresetclivisalignment{never}}%
-}%
-
-\def\clivisalignmentspecial{%OBSOLETE
- \gre@obsolete{\protect\clivisalignmentspecial}{\protect\gresetclivisalignment{special}}%
-}%
\newif\ifgre@forceemptyfirstsyllablehyphen%
\gre@forceemptyfirstsyllablehyphentrue%
@@ -648,12 +679,29 @@
{force}%
{\gre@forceemptyfirstsyllablehyphentrue}%
}[% all other cases
- \gre@error{Unrecognized option "#1" for \protect\gresetlyriccentering\MessageBreak Possible options are 'auto' and 'force'}%
+ \gre@error{Unrecognized option "#1" for \protect\gresetemptyfirstsyllablehyphen\MessageBreak Possible options are 'auto' and 'force'}%
]%
}%
+\newif\ifgre@evaluatingnextsyllable%
+\gre@evaluatingnextsyllablefalse%
+\def\gre@evaluatenextsyllable#1{%
+ \gre@trace{gre@evaluatenextsyllable{#1}}%
+ \gre@evaluatingnextsyllabletrue%
+ #1%
+ \gre@evaluatingnextsyllablefalse%
+ \gre@trace@end%
+}%
+
\newif\ifgre@showhyphenafterthissyllable%
-\def\GreForceHyphen{\global\gre@showhyphenafterthissyllabletrue\gre@debugmsg{hyphen}{Forcing hyphen in gabc}}
+\def\GreForceHyphen{%
+ \ifgre@evaluatingnextsyllable%
+ -%
+ \else%
+ \global\gre@showhyphenafterthissyllabletrue%
+ \gre@debugmsg{hyphen}{Forcing hyphen in gabc}%
+ \fi%
+}%
\def\GreEmptyFirstSyllableHyphen{\ifgre@forceemptyfirstsyllablehyphen\GreForceHyphen\fi}%
% if an hyphen maybe be added by lua for this syllable. When syllable is not end of word and
@@ -661,6 +709,130 @@
\newif\ifgre@possibleluahyphenafterthissyllable
\gre@possibleluahyphenafterthissyllablefalse
+\newcount\gre@count@unbreakabletotalnotes %
+\newcount\gre@count@unbreakableinitialnotes %
+\newcount\gre@count@unbreakablefinalnotes %
+% #1 : minimum notes in the syllable before the syllable may be split across lines
+% #2 : minimum notes to keep together at the start of a syllable
+% #3 : minimum notes to keep together at the end of a syllable
+\def\gresetunbreakablesyllablenotes#1#2#3{%
+ \gre@count@unbreakabletotalnotes=\number#1\relax %
+ \gre@count@unbreakableinitialnotes=\number#2\relax %
+ \gre@count@unbreakablefinalnotes=\number#3\relax %
+}%
+\gresetunbreakablesyllablenotes{10}{4}{4}%
+
+\newcount\gre@count@syllablenotes %
+\def\GreSyllableNoteCount#1{%
+ \gre@count@syllablenotes=\number#1\relax %
+}%
+
+\newif\ifgre@rewritesyllables %
+\gre@rewritesyllablestrue %
+\def\gresetsyllablerewriting#1{%
+ \IfStrEqCase{#1}{%
+ {auto}%
+ {\gre@rewritesyllablestrue}%
+ {off}%
+ {\gre@rewritesyllablesfalse}%
+ }[% all other cases
+ \gre@error{Unrecognized option "#1" for \protect\gresetsyllablerewriting\MessageBreak Possible options are 'auto' and 'off'}%
+ ]%
+}%
+
+% Performs #1 if the syllable should be rewitten, else #2
+\newif\ifgre@rewritethissyllable %
+\def\gre@if@rewritesyllable#1#2{%
+ \gre@trace{gre@if@rewritesyllable{#1}{#2}}%
+ \gre@rewritethissyllablefalse %
+ \ifgre@rewritesyllables\relax %
+ \gre@debugmsg{syllablerewriting}{1}%
+ \ifnum\gre@insidediscretionary=0\relax %
+ \gre@debugmsg{syllablerewriting}{2}%
+ \ifgre@showhyphenafterthissyllable\else %
+ \gre@debugmsg{syllablerewriting}{3}%
+ \ifgre@possibleluahyphenafterthissyllable\relax %
+ \gre@debugmsg{syllablerewriting}{4}%
+ \ifx\gre@syllable@next\GreSyllable %
+ \gre@debugmsg{syllablerewriting}{5}%
+ \ifcase\directlua{gregoriotex.is_last_syllable_on_line()}\else %
+ \gre@debugmsg{syllablerewriting}{6}%
+ \gre@rewritethissyllabletrue %
+ \fi %
+ \fi %
+ \fi %
+ \fi %
+ \fi %
+ \fi %
+ \gre@debugmsg{syllablerewriting}{X}%
+ \ifgre@rewritethissyllable %
+ #1%
+ \else %
+ #2%
+ \fi %
+ \gre@trace@end%
+}%
+
+\let\gre@save@endsyllablepart\gre@nothing\relax %
+\let\gre@save@fixedtextformat\gre@textnormal\relax %
+\let\gre@save@pointandclick\gre@nothing\relax %
+\def\gre@push@endsyllable#1{%
+ \gre@trace{gre@push@endsyllable{#1}}%
+ \let\gre@save@endsyllablepart\gre@nothing\relax %
+ \let\gre@save@fixedtextformat\gre@textnormal\relax %
+ \let\gre@save@pointandclick\gre@nothing\relax %
+ \gre@if@rewritesyllable{%
+ \let\gre@save@endsyllablepart\gre@endsyllablepart\relax %
+ \let\gre@save@fixedtextformat\gre@fixedtextformat\relax %
+ \xdef\gre@save@pointandclick{#1}%
+ }{}%
+ \relax %
+ \gre@trace@end%
+}%
+
+\def\gre@emit@syllabletext#1{%
+ \gre@trace{gre@emit@syllabletext{#1}}%
+ \ifx\gre@save@endsyllablepart\gre@nothing %
+ \gre@fixedtextformat{#1}%
+ \else %
+ \ifx\gre@save@fixedtextformat\gre@fixedtextformat %
+ \gre@debugmsg{syllablerewriting}{merging format when prepending previous last syllable part}%
+ \gre@fixedtextformat{\gre@pointandclick{\gre@save@endsyllablepart}{\gre@save@pointandclick}#1}%
+ \else %
+ \gre@debugmsg{syllablerewriting}{prepending previous last syllable part}%
+ \gre@save@fixedtextformat{\gre@pointandclick{\gre@save@endsyllablepart}{\gre@save@pointandclick}}%
+ \gre@fixedtextformat{#1}%
+ \fi %
+ \fi %
+ \relax %
+ \gre@trace@end%
+}%
+
+\def\gre@emit@endsyllablepart{%
+ \gre@trace{gre@emit@endsyllablepart}%
+ \gre@if@rewritesyllable{}{%
+ \gre@debugmsg{syllablerewriting}{not rewriting syllable}%
+ \gre@endsyllablepart %
+ }%
+ \relax %
+ \gre@trace@end%
+}%
+
+\def\gre@emit@endsyllablepartfornextsyllable{%
+ \gre@trace{gre@emit@endsyllablepartfornextsyllable}%
+ \gre@if@rewritesyllable{%
+ \gre@endsyllablepart %
+ }{}%
+ \relax %
+ \gre@trace@end%
+}%
+
+\newif\ifgre@textcleared%
+
+\def\GreClearSyllableText{%
+ \gre@textclearedtrue%
+}%
+
%% general macro : it will typeset the syllable : arguments are :
% #1 : macro setting the letters of this syllable
% #2 : reserved (unused)
@@ -676,10 +848,28 @@
%% with a special option for #7 : if it is a bar, we don't put a space at the end
%% at the end we wall \greendofword or \gre@endofsyllable with #7, to reduce the space in case of a flat or natural
\def\GreSyllable#1#2#3#4#5#6#7#8#9{%
+ \gre@textclearedfalse%
+ \def\gre@syllable@args{{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%
+ \futurelet\gre@syllable@next\gre@syllable@expand%
+}%
+\def\gre@syllable@expand{%
+ \gre@trace{gre@syllable@expand}%
+ \expandafter\gre@syllable@act\gre@syllable@args%
+ \gre@trace@end%
+}%
+\def\gre@syllable@act#1#2#3#4#5#6#7#8#9{%
+ \gre@trace{gre@syllable@act{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%
\gre@debugmsg{general}{}%
\gre@debugmsg{general}{New syllable: \expandafter\unexpanded{#1}}%
\gre@debugmsg{general}{}%
- \global\gre@possibleluahyphenafterthissyllablefalse %
+ % This needs to be calculated early for syllable rewriting, the value
+ % will be refined later on
+ \ifcase#4 %
+ \global\gre@possibleluahyphenafterthissyllabletrue %
+ \else %
+ \global\gre@possibleluahyphenafterthissyllablefalse %
+ \fi %
+ \global\advance\gre@attr@syllable@id by 1\relax %
\gre@showhyphenafterthissyllablefalse%
\ifcase#4\ifgre@forcehyphen%
\gre@debugmsg{hyphen}{Forcing hyphen}%
@@ -688,7 +878,7 @@
#1%
\gre@firstglyphtrue%
\gre@dimen@bolextra = 0pt\relax%
- \gre@calculate@textaligncenter{\gre@firstsyllablepart}{\gre@middlesyllablepart}{0}% we first get the width between the alignment point and the end of the syllable
+ \gre@calculate@textaligncenter{\gre@save@endsyllablepart}{\gre@firstsyllablepart}{\gre@middlesyllablepart}{0}% we first get the width between the alignment point and the end of the syllable
\gre@syllablenotes{#9}% we put the notes in a box, so that we have the width of it
% now we calculate the begin difference, that is to say \gre@dimen@notesaligncenter - \gre@dimen@textaligncenter
\gre@dimen@begindifference=\dimexpr(\gre@dimen@notesaligncenter - \gre@dimen@textaligncenter)\relax %
@@ -737,9 +927,23 @@
% by default, gre@attr@dash will be 2
\gre@attr@dash=2\relax %
#5%
- \gre@calculate@nextbegindifference{\gre@nextfirstsyllablepart}{\gre@nextmiddlesyllablepart}{\gre@nextendsyllablepart}{#7}%
+ \gre@calculate@nextbegindifference{\gre@emit@endsyllablepartfornextsyllable}{\gre@evaluatenextsyllable{\gre@nextfirstsyllablepart}}{\gre@evaluatenextsyllable{\gre@nextmiddlesyllablepart}}{\gre@evaluatenextsyllable{\gre@nextendsyllablepart}}{#7}%
\gre@unsetfixednexttextformat %
- \setbox\gre@box@syllabletext=\hbox{\gre@fixedtextformat{\gre@pointandclick{\gre@firstsyllablepart\gre@middlesyllablepart\gre@endsyllablepart}{#6}}}%
+ \ifgre@showlyrics%
+ \setbox\gre@box@syllabletext=\hbox{%
+ \IfSubStr{\gre@debug}{,notespacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ \gre@emit@syllabletext{\gre@pointandclick{\gre@firstsyllablepart\gre@middlesyllablepart\gre@emit@endsyllablepart}{#6}}%
+ \IfSubStr{\gre@debug}{,notespacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ }%
+ \else%
+ \setbox\gre@box@syllabletext=\box\voidb@x%
+ \fi%
\gre@calculate@enddifference{\wd\gre@box@syllablenotes}{\wd\gre@box@syllabletext}{\gre@dimen@textaligncenter}{\gre@dimen@notesaligncenter}{1}%
% gre@count@temp@one holds 0 if next is a not bar, 1 if it is
\gre@count@temp@one=0%
@@ -772,25 +976,74 @@
\fi %
\fi% ficase#4
\ifgre@showhyphenafterthissyllable\relax%
+ \global\gre@possibleluahyphenafterthissyllablefalse %
\gre@debugmsg{hyphen}{Showing the hyphen}%
% if it's the last syllable of line, the hyphen will be \GreHyph
\ifnum\gre@lastoflinecount=1\relax %
- \setbox\gre@box@syllabletext=\hbox{\gre@fixedtextformat{\gre@pointandclick{\gre@firstsyllablepart\gre@middlesyllablepart\gre@endsyllablepart#3{\GreHyph}\relax}{#6}}}%
+ \ifgre@showlyrics%
+ \setbox\gre@box@syllabletext=\hbox{%
+ \IfSubStr{\gre@debug}{,notespacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ \gre@emit@syllabletext{\gre@pointandclick{\gre@firstsyllablepart\gre@middlesyllablepart\gre@emit@endsyllablepart#3{\GreHyph}\relax}{#6}}%
+ \IfSubStr{\gre@debug}{,notespacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ }%
+ \else%
+ \setbox\gre@box@syllabletext=\box\voidb@x%
+ \fi%
\else %
- \setbox\gre@box@syllabletext=\hbox{\gre@fixedtextformat{\gre@pointandclick{\gre@firstsyllablepart\gre@middlesyllablepart\gre@endsyllablepart#3{-}}{#6}}}%
+ \ifgre@showlyrics%
+ \setbox\gre@box@syllabletext=\hbox{%
+ \IfSubStr{\gre@debug}{,notespacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ \gre@emit@syllabletext{\gre@pointandclick{\gre@firstsyllablepart\gre@middlesyllablepart\gre@emit@endsyllablepart#3{-}}{#6}}%
+ \IfSubStr{\gre@debug}{,notespacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ }%
+ \else%
+ \setbox\gre@box@syllabletext=\box\voidb@x%
+ \fi%
\fi %
% recomputing end difference and final skip with the final hyphen
+ \gre@calculate@nextbegindifference{\gre@emit@endsyllablepartfornextsyllable}{\gre@evaluatenextsyllable{\gre@nextfirstsyllablepart}}{\gre@evaluatenextsyllable{\gre@nextmiddlesyllablepart}}{\gre@evaluatenextsyllable{\gre@nextendsyllablepart}}{#7}%
\gre@calculate@enddifference{\wd\gre@box@syllablenotes}{\wd\gre@box@syllabletext}{\gre@dimen@textaligncenter}{\gre@dimen@notesaligncenter}{0}%
\gre@calculate@syllablefinalskip{#4}{\gre@count@temp@one}%
\else %
\ifcase#4 %
+ \global\gre@possibleluahyphenafterthissyllabletrue %
\gre@debugmsg{hyphen}{No hyphen}%
\gre@attr@dash=1\relax % in this particular case where it is not the end of a word and we haven't put a dash, we set potentital dash to 1
% we rebuild this box, in order it to have the attribute
- \setbox\gre@box@syllabletext=\hbox{\gre@fixedtextformat{\gre@pointandclick{\gre@firstsyllablepart\gre@middlesyllablepart\gre@endsyllablepart}{#6}}}%
- \global\gre@possibleluahyphenafterthissyllabletrue %
+ \ifgre@showlyrics%
+ \setbox\gre@box@syllabletext=\hbox{%
+ \IfSubStr{\gre@debug}{,notespacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ \gre@emit@syllabletext{\gre@pointandclick{\gre@firstsyllablepart\gre@middlesyllablepart\gre@emit@endsyllablepart}{#6}}%
+ \IfSubStr{\gre@debug}{,notespacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ }%
+ \else%
+ \setbox\gre@box@syllabletext=\box\voidb@x%
+ \fi%
+ \else %
+ \global\gre@possibleluahyphenafterthissyllablefalse %
\fi %
\fi%
+ \ifgre@textcleared%
+ \gre@clearsyllable{note}%
+ \fi%
% then we reuse temp, we assign to it the \gre@dimen@begindifference, but only if it is positive, else it is 0
\gre@debugmsg{ifdim}{ begindifference > 0pt}%
\ifdim\gre@dimen@begindifference > 0 pt\relax%
@@ -812,7 +1065,17 @@
% here we need to unset \gre@attr@dash for the typesetting of notes
\gre@attr@dash=0\relax %
\GreNoBreak % no line breaks between text and notes
- #9% we do that instead of \unhbox\Syllablnotes, because it would not set the \localrightbox
+ \ifgre@shownotes%
+ \IfSubStr{\gre@debug}{,notespacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\raise 12pt\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ #9% we do that instead of \unhbox\Syllablnotes, because it would not set the \localrightbox
+ \IfSubStr{\gre@debug}{,notespacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\raise 12pt\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ \fi%
\GreNoBreak % no line breaks between notes and end of syllable skips
\gre@debugmsg{ifdim}{ enddifference < 0pt}%
\ifdim\gre@dimen@enddifference <0pt\relax%
@@ -821,13 +1084,15 @@
\GreNoBreak %
\fi%
% we call end of syllable
- \gre@syllable@end{#7}{\gre@nextfirstsyllablepart\gre@nextmiddlesyllablepart\gre@nextendsyllablepart}{#4}%
+ \gre@syllable@end{#7}{\gre@evaluatenextsyllable{\gre@nextfirstsyllablepart\gre@nextmiddlesyllablepart\gre@nextendsyllablepart}}{#4}%
+ \gre@push@endsyllable{#6}\relax %
\global\gre@dimen@notesaligncenter=0pt\relax% very important, see flat and natural
\gre@unsetfixedtextformat %
\ifgre@blockeolcustos\ifnum\gre@insidediscretionary=0\relax %
\gre@localrightbox{}%
\fi\fi %
\relax %
+ \gre@trace@end%
}%
% #1 is the id of the euouae block (assigned by the C code)
@@ -836,10 +1101,10 @@
\def\GreNextSyllableBeginsEUOUAE#1#2{%
\GreNoBreak %
\ifgre@blockeolcustosbeforeeuouae %
- \gre@usemanualeolcustos %
+ \GreSuppressEolCustos %
\fi %
\ifgre@raggedbreakbeforeeuouae %
- \directlua{gregoriotex.save_pos(#1,1)}%
+ \directlua{gregoriotex.save_euouae(#1,1)}%
\ifcase#2\ifcase\directlua{gregoriotex.is_ypos_different(#1)}\relax%
\gre@newlinecommon{1}{1}%
\fi\fi %
@@ -862,7 +1127,7 @@
%% @arg#2 next syllable text
%% @arg#3 end of word or not (#4 of \GreSyllable)
\def\gre@syllable@end#1#2#3{%
- \gre@debugmsg{syllablespacing}{ syllable@end with #1}%
+ \gre@trace{gre@syllable@end{#1}{#2}{#3}}%
% gre@count@temp@one holds 0 if next is a not bar, 1 if it is
\gre@count@temp@one=0%
\ifnum#1>9\relax %
@@ -890,6 +1155,7 @@
\gre@debugmsg{syllablespacing}{ calling endofsyllable with #3}%
\gre@endofsyllable{1}{#3}{0}%
\fi %
+ \gre@trace@end%
}
%% @desc Macro called at end of a syllable, adds a penalty and a space
@@ -898,25 +1164,30 @@
%% @arg#3 1 if next syllable is a bar, 0 otherwise
%%
\def\gre@endofsyllable#1#2#3{%
- \gre@debugmsg{syllablespacing}{ endofsyllable with #2}%
+ \gre@trace{gre@endofsyllable{#1}{#2}{#3}}%
\ifgre@eolshiftsenabled%
%this shift will shorten the line somewhat to allow the lyrics to extend under the custos should TeX decide to insert a line break after the syllable being ended
\GreNoBreak%
\gre@calculate@eolshift{\gre@dimen@enddifference}%
- \gre@debugmsg{eolshift}{End of line shift: \the\gre@dimen@eolshift}%
\kern -\gre@dimen@eolshift\relax%
\fi%
\ifnum#3=1\relax %
\GreNoBreak %
- \gre@debugmsg{syllablespacing}{ set penalty \grenobreakpenalty}%
+ \gre@debugmsg{syllablespacing}{ set penalty \the\gre@space@count@nobreakpenalty}%
\else %
- \ifnum#2=1\relax %
- \gre@penalty{\greendofwordpenalty}%
- \gre@debugmsg{syllablespacing}{ set penalty \greendofwordpenalty}%
- \else %
- \gre@penalty{\greendofsyllablepenalty}%
- \gre@debugmsg{syllablespacing}{ set penalty \greendofsyllablepenalty}%
- \fi %
+ \gre@count@temp@one=0\relax %
+ \gre@if@rewritesyllable{%
+ \GreNoBreak%
+ }{%
+ \ifnum#2=1\relax %
+ \gre@penalty{\the\gre@space@count@endofwordpenalty}%
+ \gre@debugmsg{syllablespacing}{ set penalty \the\gre@space@count@endofwordpenalty}%
+ \else %
+ \gre@penalty{\the\gre@space@count@endofsyllablepenalty}%
+ \gre@debugmsg{syllablespacing}{ set penalty \the\gre@space@count@endofsyllablepenalty}%
+ \fi %
+ }%
+ \gre@count@temp@one=0\relax %
\fi %
\ifgre@eolshiftsenabled%
%If the above penalties don't result in a line break, then we need to undo the eolshift to prevent the next syllable from overlapping with this one. If the line break did occur, then this shift will occur at the beginning of a line and thus will be ignored automatically by TeX.
@@ -940,6 +1211,7 @@
\fi %
\fi %
\relax%
+ \gre@trace@end%
}%
\def\gresetbarspacing#1{%
@@ -964,12 +1236,18 @@
% end of line for later.
\xdef\gre@newlinearg{-1}
\gdef\gre@newlinecommondelayed#1#2{%
+ \gre@trace{gre@newlinecommondelayed{#1}{#2}}%
\xdef\gre@newlinearg{#1}%
+ \gre@trace@end%
}
%a macro to typeset a syllable with only a bar inside
\def\GreBarSyllable#1#2#3#4#5#6#7#8#9{%
+ \gre@textclearedfalse%
+ \gre@debugmsg{general}{}%
\gre@debugmsg{general}{New bar syllable}%
+ \gre@debugmsg{general}{}%
+ \global\advance\gre@attr@syllable@id by 1\relax %
\gre@possibleluahyphenafterthissyllablefalse %
\gre@showhyphenafterthissyllablefalse %
% the algorithm of this function is *extremely* complex, and has been much painful to write... good luck to understand.
@@ -977,8 +1255,22 @@
% there are two different cases that have almost nothing in common : the case where there is something written under the bar, and the case where there is nothing.
% first of all we need to calculate previousenddifference, begindifference, enddifference and nextbegindifference.
#1%
- \gre@calculate@textaligncenter{\gre@firstsyllablepart}{\gre@middlesyllablepart}{0}%
- \setbox\gre@box@syllabletext=\hbox{\gre@fixedtextformat{\gre@pointandclick{\gre@firstsyllablepart\gre@middlesyllablepart\gre@endsyllablepart}{#6}}}%
+ \gre@calculate@textaligncenter{\gre@save@endsyllablepart}{\gre@firstsyllablepart}{\gre@middlesyllablepart}{0}%
+ \ifgre@showlyrics%
+ \setbox\gre@box@syllabletext=\hbox{%
+ \IfSubStr{\gre@debug}{,barspacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ \gre@emit@syllabletext{\gre@pointandclick{\gre@firstsyllablepart\gre@middlesyllablepart\gre@emit@endsyllablepart}{#6}}%
+ \IfSubStr{\gre@debug}{,barspacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ }%
+ \else%
+ \setbox\gre@box@syllabletext=\box\voidb@x%
+ \fi%
\gre@debugmsg{barspacing}{Width of bar text: \the\wd\gre@box@syllabletext}%
\global\let\gre@newlinecommonsaved\gre@newlinecommon %
\global\let\gre@newlinecommon\gre@newlinecommondelayed %
@@ -989,7 +1281,7 @@
\gre@dimen@begindifference=\dimexpr(\gre@dimen@notesaligncenter - \gre@dimen@textaligncenter)\relax%
\gre@calculate@enddifference{\wd\gre@box@syllablenotes}{\wd\gre@box@syllabletext}{\gre@dimen@textaligncenter}{\gre@dimen@notesaligncenter}{1}%
#5%
- \gre@calculate@nextbegindifference{\gre@nextfirstsyllablepart}{\gre@nextmiddlesyllablepart}{\gre@nextendsyllablepart}{#7}%
+ \gre@calculate@nextbegindifference{\gre@emit@endsyllablepartfornextsyllable}{\gre@evaluatenextsyllable{\gre@nextfirstsyllablepart}}{\gre@evaluatenextsyllable{\gre@nextmiddlesyllablepart}}{\gre@evaluatenextsyllable{\gre@nextendsyllablepart}}{#7}%
\gre@unsetfixednexttextformat %
\gre@debugmsg{barspacing}{previousenddifference: \the\gre@dimen@previousenddifference}%
\gre@debugmsg{barspacing}{begindifference: \the\gre@dimen@begindifference}%
@@ -1000,13 +1292,16 @@
% New bar spacing algorithm
%
\gre@calculate@barposition{#4}{#7}%
+ \ifgre@textcleared%
+ \gre@clearsyllable{bar}%
+ \fi%
%now we can place the text and bar
%we're going to use the bar line to control positioning, so we need to start by getting to the end of the notes of the previous syllable
\ifdim\gre@dimen@adjustedpreviousenddifference < 0pt\relax%
%we need to move back to where the previous notes ended
\kern\gre@dimen@adjustedpreviousenddifference\relax%
- \GreNoBreak %
\fi%
+ \GreNoBreak %
%move to the beginning of the text
\gre@hskip\glueexpr(\gre@skip@bar@allocation/2% right from end of previous notes to nominal middle of bar line
+\gre@dimen@bar@shift% from nominal middle of bar line to actual middle
@@ -1029,7 +1324,17 @@
\kern\dimexpr(\gre@dimen@enddifference% move from end of text to end of bar line
-\wd\gre@box@syllablenotes)\relax % back up from end of bar line to beginning
\GreNoBreak%
- #9%
+ \ifgre@shownotes%
+ \IfSubStr{\gre@debug}{,barspacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\raise 12pt\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ #9%
+ \IfSubStr{\gre@debug}{,barspacing,}%
+ % when debugging we add a zero-width line to mark the syllable bound
+ {\raise 12pt\hbox to 0pt{\rule{0.4pt}{12pt}\hss}}%
+ {}% do nothing if not debugging
+ \fi%
\global\let\gre@newlinecommon\gre@newlinecommonsaved %
\GreNoBreak%
% get into position to place the penalty
@@ -1039,37 +1344,48 @@
\GreNoBreak%
\fi%
\ifgre@eolshiftsenabled%
- %this shift will shorten the line somewhat to allow the lyrics to extend under the custos should TeX decide to insert a line break after the syllable being ended
- \gre@calculate@eolshift{\dimexpr(\gre@dimen@enddifference-\gre@skip@bar@lastskip)\relax }%
- \gre@debugmsg{barspacing}{End of line shift: \the\gre@dimen@eolshift}%
- \ifdim\gre@dimen@eolshift<\gre@skip@bar@lastskip %
- \gre@dimen@eolshift=\gre@skip@bar@lastskip\relax %
- \fi %
- \kern\glueexpr(-\gre@dimen@eolshift)\relax%
+ \ifgre@endofscore%
+ \kern\glueexpr(-\gre@skip@bar@lastskip)\relax%
+ \else%
+ %this shift will shorten the line somewhat to allow the lyrics to extend under the custos should TeX decide to insert a line break after the syllable being ended
+ \gre@calculate@eolshift{\dimexpr(\gre@dimen@enddifference-\gre@skip@bar@lastskip)\relax }%
+ \gre@debugmsg{barspacing}{End of line shift: \the\gre@dimen@eolshift}%
+ \ifdim\gre@dimen@eolshift<\gre@skip@bar@lastskip %
+ \gre@dimen@eolshift=\gre@skip@bar@lastskip\relax %
+ \fi %
+ \kern\glueexpr(-\gre@dimen@eolshift)\relax%
+ \fi%
\fi%
% gre@count@temp@one is "forced end of line or last of score"
\gre@count@temp@one=0\relax %
\ifnum\gre@newlinearg=-1\else %
\gre@count@temp@one=1\relax %
\fi %
+ \ifnum\gre@lastoflinecount=1\relax %
+ \gre@count@temp@one=1\relax %
+ \fi %
\ifgre@endofscore %
\gre@count@temp@one=1\relax %
- \fi %
+ \fi %
% if no end of line or end of score
\ifnum\gre@count@temp@one=0\relax %
% add the penalty
- \gre@debugmsg{barspacing}{after bar penalty: \greendafterbarpenalty}%
- \gre@penalty{\greendafterbarpenalty}%
+ \gre@debugmsg{barspacing}{after bar penalty: \the\gre@space@count@endafterbarpenalty}%
+ \gre@penalty{\the\gre@space@count@endafterbarpenalty}%
\ifgre@eolshiftsenabled%
- %If the above penalties don't result in a line break, then we need to undo the eolshift to prevent the next syllable from overlapping with this one. If the line break did occur, then this shift will occur at the beginning of a line and thus will be ignored automatically by TeX.
- \kern \dimexpr(\gre@dimen@eolshift)\relax%
- \GreNoBreak%
+ \ifgre@endofscore\else%
+ %If the above penalties don't result in a line break, then we need to undo the eolshift to prevent the next syllable from overlapping with this one. If the line break did occur, then this shift will occur at the beginning of a line and thus will be ignored automatically by TeX.
+ \kern \dimexpr(\gre@dimen@eolshift)\relax%
+ \GreNoBreak%
+ \fi%
\fi%
\ifdim\gre@dimen@enddifference < 0pt\relax%
%undo the earlier shift
\kern\gre@dimen@enddifference%
\GreNoBreak%
\fi%
+ % adjustment for alterations:
+ \kern-\gre@skip@alterationshift %
%move to the beginning of the notes of the next syllable
\gre@hskip\glueexpr(-\wd\gre@box@syllablenotes/2% back up to middle of notes
-\gre@dimen@bar@shift% go back from actual middle to nominal middle of bar line
@@ -1083,11 +1399,13 @@
\else %
\ifgre@endofscore %
\gre@localleftbox{}%
- \gre@debugmsg{barspacing}{after bar penalty: \greendafterbarpenalty}%
- \gre@penalty{\grefinalpenalty}%
+ \gre@debugmsg{barspacing}{after bar penalty: \gre@space@count@endafterbarpenalty}%
+ \gre@penalty{\the\gre@space@count@finalpenalty}%
\else %
- \gre@debugmsg{barspacing}{calling new line with argument: \gre@newlinearg}%
- \gre@newlinecommon{\gre@newlinearg}{1}%
+ \ifnum\gre@newlinearg=-1\else %
+ \gre@debugmsg{barspacing}{calling new line with argument: \gre@newlinearg}%
+ \gre@newlinecommon{\gre@newlinearg}{1}%
+ \fi %
\fi %
\fi%
\else%
@@ -1095,6 +1413,10 @@
% Old spacing algorithm
%
%This is the old algorithm. I've kept it in case people still want to use it.
+ \gre@punctummoraadjustment%
+ \ifgre@textcleared%
+ \gre@clearsyllable{bar}%
+ \fi%
% then we check if there is something to write
\global\let\gre@newlinecommon\gre@newlinecommonsaved %
\gre@debugmsg{ifdim}{ wd(gre@box@syllabletext) = 0pt}%
@@ -1113,10 +1435,10 @@
\else %
\gre@skip@temp@two=0 pt\relax%
\fi %
- \gre@debugmsg{ifdim}{ previousenddifference < 0pt}%
- \ifdim\gre@dimen@previousenddifference < 0 pt\relax%
+ \gre@debugmsg{ifdim}{ adjustedpreviousenddifference < 0pt}%
+ \ifdim\gre@dimen@adjustedpreviousenddifference < 0 pt\relax%
\advance\gre@skip@temp@two by %
- \glueexpr(-\gre@dimen@previousenddifference %
+ \glueexpr(-\gre@dimen@adjustedpreviousenddifference %
+ \gre@space@skip@interwordspacetext)\relax%
\else %
\advance\gre@skip@temp@two by \gre@space@skip@interwordspacenotes\relax%
@@ -1130,9 +1452,9 @@
\advance\gre@skip@temp@three by \dimexpr(\wd\gre@box@syllablenotes / -2)\relax %
% now we have our skipone
\gre@skip@temp@two=\gre@skip@temp@three %
- \gre@debugmsg{ifdim}{ previousenddifference < 0pt}%
- \ifdim\gre@dimen@previousenddifference < 0 pt\relax%
- \advance\gre@skip@temp@two by \gre@dimen@previousenddifference\relax%
+ \gre@debugmsg{ifdim}{ adjustedpreviousenddifference < 0pt}%
+ \ifdim\gre@dimen@adjustedpreviousenddifference < 0 pt\relax%
+ \advance\gre@skip@temp@two by \gre@dimen@adjustedpreviousenddifference\relax%
\fi %
\GreNoBreak %
\gre@debugmsg{ifdim}{ temp@skip@two > -wd(gre@box@syllablenotes)}%
@@ -1149,8 +1471,10 @@
\gre@dotranslationcenterend %
\gre@mustdotranslationcenterendfalse%
\fi %
- #9\relax %
- \gre@penalty{\greendafterbaraltpenalty }% TODO: isn't it a bit buggy?
+ \ifgre@shownotes%
+ #9\relax %
+ \fi%
+ \gre@penalty{\the\gre@space@count@endafterbaraltpenalty }% TODO: isn't it a bit buggy?
% end of same code as syllable
\ifnum\gre@lastoflinecount=1\relax %
\global\gre@lastoflinecount=2\relax %
@@ -1193,7 +1517,9 @@
\kern\gre@skip@temp@one %
\gre@skip@temp@one = -\gre@dimen@begindifference\relax%
\kern\gre@skip@temp@one %
- #9%
+ \ifgre@shownotes%
+ #9%
+ \fi%
\gre@debugmsg{ifdim}{ enddifference < 0pt}%
\ifdim\gre@dimen@enddifference <0pt\relax%
%% important, else we are not really at the end of the syllable
@@ -1211,6 +1537,7 @@
%and that's it !!
\fi %
\fi%
+ \gre@push@endsyllable{#6}\relax %
\global\gre@dimen@notesaligncenter= 0 pt\relax % very important, see flat and natural
\gre@unsetfixedtextformat %
\ifgre@blockeolcustos\ifnum\gre@insidediscretionary=0\relax %
@@ -1232,14 +1559,17 @@
%% #5 - Everything after the first letter of the syllable
%% #6 - Macros to run after the text is emitted
\def\gre@setfirstsyllabletext#1#2#3#4#5#6{%
+ \gre@trace{gre@setfirstsyllabletext{#1}{#2}{#3}{#4}{#5}{#6}}%
\def\gre@opening@syllabletext{%
\GreSetThisSyllable{#1}{#2}{#3}%
{\GreFirstWord{\GreFirstSyllable{\GreFirstSyllableInitial{#4}}}}%
{\GreFirstWord{\GreFirstSyllable{#5}}}%
#6\relax %
}%
+ \gre@trace@end%
}%
+% TODO: Change \gre@initiallines to \gre@count@initiallines in 5.0
\def\gresetinitiallines#1{%
\IfInteger{#1}%
{%
@@ -1257,11 +1587,6 @@
}%
\gresetinitiallines{1}% default to one-line initials
-\def\GreSetInitialStyle#1{%%% DEPRECATED by 4.1
- \gre@deprecated{initial-style gabc header}{\protect\gresetinitiallines}%%% DEPRECATED by 4.1
- \def\gre@opening@initialstyle{#1}%%% DEPRECATED by 4.1
-}%%% DEPRECATED by 4.1
-
%% sets the first syllable text
%% #1 - Initial
%% #2 - First letter after the initial
@@ -1270,8 +1595,8 @@
%% #5 - Three syllable parts where there is no separated initial
%% #6 - Extra macros to run if there is an initial
\def\GreSetFirstSyllableText#1#2#3#4#5#6{%
- %%% DEPRECATED by 4.1: When \gre@opening@initialstyle is removed, use \gre@initiallines directly in the following line
- \ifcase\gre@opening@initialstyle\relax % no initial
+ \gre@printcommentary%
+ \ifcase\gre@initiallines\relax % no initial
\gre@noinitial %
\gre@setfirstsyllabletext#5{#1}{#2#3}{}%
\or % regular intiial
@@ -1290,10 +1615,10 @@
\def\GreUpcomingNewLineForcesCustos#1{%
\ifcase#1\relax % 0 - forced off
- \gre@usemanualeolcustos %
+ \GreSuppressEolCustos %
\or % 1 - forced on
\gre@useautoeolcustos %
- \GreNextCustos{\gre@nextcustos}%
+ \GreNextCustos{\gre@nextcustospitch}{\gre@nextcustosalteration}%
\fi %
}%