From ed65b71e2fbf600457cbfb1699b52b416ccff5e2 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Mon, 15 Feb 2016 11:37:23 +0100 Subject: [PATCH 1/4] fix 4.1 part of #922 --- CHANGELOG.md | 2 ++ doc/Command_Index_User.tex | 5 +++++ doc/GregorioRef.lua | 1 + doc/GregorioRef.tex | 3 ++- tex/gregoriotex-spaces.tex | 22 ++++++++++++++++++---- tex/gregoriotex-syllable.tex | 4 ++-- tex/gsp-default.tex | 10 ++++++---- 7 files changed, 36 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index facbb3514..f6e613b00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). - New bar spacing algorithm now accounts for translations (and other below lyrics stuff). - Horizontal episema on initio debilis is now sized correctly (see [#880](https://github.com/gregorio-project/gregorio/issues/880)). - Elisions immediately after the vowel are now properly left out of the center (see [#907](https://github.com/gregorio-project/gregorio/issues/907)) +- Space between the text of two syllables of the same word when no hyphen is necessary is now strictly 0 (see [#922](https://github.com/gregorio-project/gregorio/issues/922)) ### Changed - Adjustments to the heuristic for ledger lines to include adjacent notes (see [#862](https://github.com/gregorio-project/gregorio/issues/862)). @@ -17,6 +18,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). ### Added - Controls for tuning horizontal episema vertical position. See GregorioRef for details (for the change request, see [#872](https://github.com/gregorio-project/gregorio/issues/872)). - More dimensions are tunable: `overhepisemalowshift`, `overhepisemahighshift`, `underhepisemalowshift`, `underhepisemahighshift`, `hepisemamiddleshift`, `vepisemalowshift`, `vepisemahighshift`, `linepunctummorashift`, `spacepunctummorashift`, `spaceamonepespunctummorashift`, `lineporrectuspunctummorashift`, `spaceporrectuspunctummorashift`, and `raresignshift`. See GregorioRef for details (for the change request, see comments in [#872](https://github.com/gregorio-project/gregorio/issues/872)). +- A new dimension, `intersyllablespacestretchhyphen` is now available to add stretching in the case of syllables separated by an hyphen (see comments in [#922](https://github.com/gregorio-project/gregorio/issues/922)) ## [4.1.0-beta3] - 2016-02-09 diff --git a/doc/Command_Index_User.tex b/doc/Command_Index_User.tex index b9f924894..dd73074ea 100644 --- a/doc/Command_Index_User.tex +++ b/doc/Command_Index_User.tex @@ -1180,6 +1180,11 @@ \subsection{Distances}\label{distances} Minimum space between notes of different syllables. \end{gdimension} +\begin{gdimension}{intersyllablespacestretchhyphen} +Stretching added in the case where the text of two syllables of the same word are +separated with an automatic hyphen. +\end{gdimension} + \begin{gdimension}{interwordspacenotes} Minimum space between notes of syllables from different words. \end{gdimension} diff --git a/doc/GregorioRef.lua b/doc/GregorioRef.lua index 50bd52134..596708fe5 100644 --- a/doc/GregorioRef.lua +++ b/doc/GregorioRef.lua @@ -389,6 +389,7 @@ function GregorioRef.emit_extra_glyphs(csname) end function GregorioRef.emit_dimension(value) + texio.write_nl(value) value = string.gsub(value, '(-?%d+%.%d+)%s*(%a+)', [[\unit[%1]{%2}]]) value = string.gsub(value, '(-?%d+%.)%s*(%a+)', [[\unit[%1]{%2}]]) value = string.gsub(value, '(-?%.?%d+)%s*(%a+)', [[\unit[%1]{%2}]]) diff --git a/doc/GregorioRef.tex b/doc/GregorioRef.tex index 0264f1d52..d7eae9a92 100644 --- a/doc/GregorioRef.tex +++ b/doc/GregorioRef.tex @@ -124,12 +124,13 @@ \makeatletter% \NewDocumentEnvironment{gdimension}{m}{\macroname{#1}{}{gsp-default.tex}}{% - \gre@rubberpermit{#1}% + \makeatletter\gre@rubberpermit{#1}% \ifgre@rubber% Default: \directlua{GregorioRef.emit_dimension("\luaescapestring{\csname gre@space@skip@#1\endcsname}")} \else% Default: \directlua{GregorioRef.emit_dimension("\luaescapestring{\csname gre@space@dimen@#1\endcsname}")} \fi% + \makeatother% } \newcommand{\writemode}[3]{% diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index 5d0d00481..6abf5df3f 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -261,7 +261,7 @@ \gre@skip@minNotesDistance=\gre@space@skip@interwordspacenotes\relax% \fi % \else % - \gre@skip@minNotesDistance=\gre@space@skip@intersyllablespacenotes\relax% + \gre@skip@minNotesDistance=\gre@space@dimen@intersyllablespacenotes\relax% \fi % \ifcase\gre@count@shiftaftermora\or\or\or\or % \ifgre@thisendswithmora % @@ -277,7 +277,7 @@ \ifnum#1=1\relax % \gre@skip@minNotesDistance=\gre@space@skip@interwordspacenotes@alteration\relax % \else % - \gre@skip@minNotesDistance=\gre@space@skip@intersyllablespacenotes@alteration\relax% + \gre@skip@minNotesDistance=\gre@space@dimen@intersyllablespacenotes@alteration\relax% \fi % \fi % \gre@debugmsg{syllablespacing}{ minNotesDistance = \the\gre@skip@minNotesDistance}% @@ -317,11 +317,14 @@ \gre@debugmsg{syllablespacing}{ minShiftText = \the\gre@skip@minShiftText}% \ifdim\gre@skip@minShiftNotes < \gre@skip@minShiftText % \global\gre@skip@syllablefinalskip = \gre@skip@minShiftText % - \gre@debugmsg{syllablespacing}{ syllablefinalskip = \the\gre@skip@minShiftText}% \else % \global\gre@skip@syllablefinalskip = \gre@skip@minShiftNotes % - \gre@debugmsg{syllablespacing}{ syllablefinalskip = \the\gre@skip@minShiftNotes}% \fi % + \ifgre@showhyphenafterthissyllable % + \gre@debugmsg{syllablespacing}{ add intersyllablespacestretchhyphen (\gre@space@skip@intersyllablespacestretchhyphen)}% + \advance\gre@skip@syllablefinalskip by \gre@space@skip@intersyllablespacestretchhyphen\relax% + \fi % + \gre@debugmsg{syllablespacing}{ syllablefinalskip = \the\gre@skip@syllablefinalskip}% \relax % } @@ -1009,6 +1012,8 @@ {minimalspaceatlinebeginning}{\gre@rubberfalse}% {manualinitialwidth}{\gre@rubberfalse}% {annotationseparation}{\gre@rubberfalse}% + {intersyllablespacenotes}{\gre@rubberfalse}% + {intersyllablespacenotes@alteration}{\gre@rubberfalse}% {annotationraise}{\gre@rubberfalse}% {commentaryseparation}{\gre@rubberfalse}% {commentaryraise}{\gre@rubberfalse}% @@ -1193,6 +1198,15 @@ \ifgre@scale@intersyllablespacenotes% \gre@changeonedimenfactor{intersyllablespacenotes}{#1}{#2}% \fi% + \ifgre@scale@interwordspacenotes@alteration% + \gre@changeonedimenfactor{interwordspacenotes@alteration}{#1}{#2}% + \fi% + \ifgre@scale@intersyllablespacenotes@alteration% + \gre@changeonedimenfactor{intersyllablespacenotes@alteration}{#1}{#2}% + \fi% + \ifgre@scale@intersyllablespacestretchhyphen% + \gre@changeonedimenfactor{intersyllablespacestretchhyphen}{#1}{#2}% + \fi% \ifgre@scale@interwordspacetext% \gre@changeonedimenfactor{interwordspacetext}{#1}{#2}% \fi% diff --git a/tex/gregoriotex-syllable.tex b/tex/gregoriotex-syllable.tex index 0d848a5d6..6dd4c559d 100644 --- a/tex/gregoriotex-syllable.tex +++ b/tex/gregoriotex-syllable.tex @@ -928,7 +928,7 @@ \gre@skip@syllablefinalskip=\gre@space@skip@interwordspacenotes\relax% \fi % \else % - \gre@skip@syllablefinalskip=\gre@space@skip@intersyllablespacenotes\relax% + \gre@skip@syllablefinalskip=\gre@space@dimen@intersyllablespacenotes\relax% \fi % \or % \gre@skip@syllablefinalskip=\gre@space@skip@notebarspace\relax% @@ -936,7 +936,7 @@ \ifnum#4=1\relax % \gre@skip@syllablefinalskip=\gre@space@skip@interwordspacenotes@alteration\relax % \else % - \gre@skip@syllablefinalskip=\gre@space@skip@intersyllablespacenotes@alteration\relax% + \gre@skip@syllablefinalskip=\gre@space@dimen@intersyllablespacenotes@alteration\relax% \fi % \fi % \gre@debugmsg{syllablespacing}{ space after bar = \the\gre@skip@syllablefinalskip}% diff --git a/tex/gsp-default.tex b/tex/gsp-default.tex index 6611efc7a..be35ed9a1 100644 --- a/tex/gsp-default.tex +++ b/tex/gsp-default.tex @@ -126,8 +126,10 @@ % minimal space between notes of different words \grecreatedim{interwordspacenotes}{0.27 cm plus 0.15 cm minus 0.05 cm}{scalable}% % minimal space between notes of the same syllable. -% Warning: always keep minus to 0; also keep plus very low, or some words won't be hyphenated -\grecreatedim{intersyllablespacenotes}{0.24 cm plus 0.04cm minus 0cm}{scalable}% +\grecreatedim{intersyllablespacenotes}{0.24 cm}{scalable}% +% stretching added in the case where the text of two syllables of the same word are +% separated with an automatic hyphen +\grecreatedim{intersyllablespacestretchhyphen}{0cm plus 0.05cm}{scalable}% % minimal space between letters of different words. Makes sense to have % the same plus and minus as interwordspacenotes. \grecreatedim{interwordspacetext}{0.38 cm plus 0.15 cm minus 0.05 cm}{scalable}% @@ -137,7 +139,7 @@ % versions of note spaces when the first note of the second syllable is an alteration % those are used in euouae blocks \grecreatedim{interwordspacenotes@alteration}{0.1 cm plus 0.07 cm minus 0.01 cm}{scalable}% -\grecreatedim{intersyllablespacenotes@alteration}{0.1 cm plus 0.04 cm minus 0 cm}{scalable}% +\grecreatedim{intersyllablespacenotes@alteration}{0.1 cm}{scalable}% % space between notes of a bivirga or trivirga \grecreatedim{bitrivirspace}{0.06927 cm plus 0.00182 cm minus 0.00546 cm}{scalable}% % space between notes of a bistropha or tristrophae @@ -202,7 +204,7 @@ % minimal space between a note and a bar \grecreatedim{notebarspace}{0.31903 cm plus 0.27345 cm minus 0.02824 cm}{scalable}% % maximal space between two syllables for which we consider a dash is not needed -\grecreatedim{maximumspacewithoutdash}{0.02 cm}{scalable}% +\grecreatedim{maximumspacewithoutdash}{0 cm}{scalable}% % an extensible space for the beginning of lines \grecreatedim{afterclefnospace}{0 cm plus 0.27345 cm minus 0 cm}{scalable}% % space between the initial and the beginning of the score From 8c15437e4b71983d95d71d999a0b94fdd2b9a599 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Mon, 15 Feb 2016 14:15:13 +0100 Subject: [PATCH 2/4] oops --- doc/GregorioRef.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/GregorioRef.lua b/doc/GregorioRef.lua index 596708fe5..50bd52134 100644 --- a/doc/GregorioRef.lua +++ b/doc/GregorioRef.lua @@ -389,7 +389,6 @@ function GregorioRef.emit_extra_glyphs(csname) end function GregorioRef.emit_dimension(value) - texio.write_nl(value) value = string.gsub(value, '(-?%d+%.%d+)%s*(%a+)', [[\unit[%1]{%2}]]) value = string.gsub(value, '(-?%d+%.)%s*(%a+)', [[\unit[%1]{%2}]]) value = string.gsub(value, '(-?%.?%d+)%s*(%a+)', [[\unit[%1]{%2}]]) From fe0e9a734610bc30502fb94ef699e741882c8838 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Mon, 15 Feb 2016 20:34:37 +0100 Subject: [PATCH 3/4] fix #925 --- doc/GregorioRef.tex | 3 ++- tex/gregoriotex-spaces.tex | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/GregorioRef.tex b/doc/GregorioRef.tex index d7eae9a92..bfdc9fe5c 100644 --- a/doc/GregorioRef.tex +++ b/doc/GregorioRef.tex @@ -124,7 +124,8 @@ \makeatletter% \NewDocumentEnvironment{gdimension}{m}{\macroname{#1}{}{gsp-default.tex}}{% - \makeatletter\gre@rubberpermit{#1}% + \makeatletter% + \gre@rubberpermit{#1}% \ifgre@rubber% Default: \directlua{GregorioRef.emit_dimension("\luaescapestring{\csname gre@space@skip@#1\endcsname}")} \else% diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index 6abf5df3f..e8a7f1d8f 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -1002,7 +1002,7 @@ \newif\ifgre@rubber% \def\gre@rubberpermit#1{% % is length one that cannot be rubber? - \IfStrEqCase{#1}{% + \IfStrEqCase*{#1}{% {additionallineswidth}{\gre@rubberfalse}% {additionalcustoslineswidth}{\gre@rubberfalse}% {zerowidthspace}{\gre@rubberfalse}% From cc3b417f8c29d9d4c8dc072192793a95045cc450 Mon Sep 17 00:00:00 2001 From: Elie Roux Date: Mon, 15 Feb 2016 21:32:55 +0100 Subject: [PATCH 4/4] revert makeatletter in GregorioRef --- doc/GregorioRef.tex | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/GregorioRef.tex b/doc/GregorioRef.tex index bfdc9fe5c..0264f1d52 100644 --- a/doc/GregorioRef.tex +++ b/doc/GregorioRef.tex @@ -124,14 +124,12 @@ \makeatletter% \NewDocumentEnvironment{gdimension}{m}{\macroname{#1}{}{gsp-default.tex}}{% - \makeatletter% \gre@rubberpermit{#1}% \ifgre@rubber% Default: \directlua{GregorioRef.emit_dimension("\luaescapestring{\csname gre@space@skip@#1\endcsname}")} \else% Default: \directlua{GregorioRef.emit_dimension("\luaescapestring{\csname gre@space@dimen@#1\endcsname}")} \fi% - \makeatother% } \newcommand{\writemode}[3]{%