From 0b80dd278f8e44d92366a4f8c4e121a6694dc21f Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Fri, 12 Feb 2021 14:06:51 -0500 Subject: [PATCH 1/4] Name font calibration distances There were several "magic distances" still in the code. All of these distances are related to calibrating things to the fonts and so should not be user editable. However, having those numbers scattered through the codebase is harder to maintain (if you change one, you have to figure out which of the others also needs to change, by how much, and where they all are), so based on relationships between the numbers, I've reduced them to 6 named dimensions which are then used as needed in the various calculations. --- tex/gregoriotex-main.tex | 16 +++++++++++++++- tex/gregoriotex-signs.tex | 6 +++--- tex/gregoriotex-spaces.tex | 28 +++++++++++----------------- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index d1333924f..655636252 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -1787,6 +1787,14 @@ \gre@trace@end% }% +%% font calibration distances +\newdimen\gre@dimen@stafflinethicknessbase% +\newdimen\gre@dimen@glyphraisebase% +\newdimen\gre@dimen@interstafflinedistancebase% +\newdimen\gre@dimen@inclinatumonlinemoravshiftbase% +\newdimen\gre@dimen@inclinatumonlinemorahshiftbase% +\newdimen\gre@dimen@inclinatumofflinemorahshiftbase% + \def\gre@setgregoriofontscaled[#1]#2#3{% \gre@trace{gre@setgregoriofontscaled[#1]{#2}{#3}}% \IfStrEq{#2}{parmesan}{%%% OBSOLETE @@ -1805,7 +1813,13 @@ \gdef\GreCPVirgaReversaAscendensOnDLine##1{\GreCPVirgaReversaLongqueueAscendens}% \fi % }%%% OBSOLETE - \relax % + % currently all fonts use the same calibration distances + \gre@dimen@stafflinethicknessbase=1500sp\relax % + \gre@dimen@glyphraisebase=-22000sp\relax% + \gre@dimen@interstafflinedistancebase=30000sp\relax% + \gre@dimen@inclinatumonlinemoravshiftbase=4500sp\relax% + \gre@dimen@inclinatumonlinemorahshiftbase=3700sp\relax% + \gre@dimen@inclinatumofflinemorahshiftbase=2500sp\relax% \gre@trace@end% }% diff --git a/tex/gregoriotex-signs.tex b/tex/gregoriotex-signs.tex index 7c196c9f3..80d3884d4 100644 --- a/tex/gregoriotex-signs.tex +++ b/tex/gregoriotex-signs.tex @@ -1210,12 +1210,12 @@ % here we shift a bit left in the case where we have a punctum inclinatum on a line \ifnum#4=1\relax % \ifgre@isonaline % - \gre@dimen@temp@three=\dimexpr(3700sp * \gre@factor)\relax % + \gre@dimen@temp@three=\dimexpr(\gre@dimen@inclinatumonlinemorahshiftbase * \gre@factor)\relax % \kern-\gre@dimen@temp@three % - \gre@dimen@temp@three=\dimexpr(4500sp * \gre@factor)\relax% + \gre@dimen@temp@three=\dimexpr(\gre@dimen@inclinatumonlinemoravshiftbase * \gre@factor)\relax% \advance\gre@dimen@glyphraisevalue by -\gre@dimen@temp@three % \else % - \gre@dimen@temp@three=\dimexpr(2500sp * \gre@factor)\relax % + \gre@dimen@temp@three=\dimexpr(\gre@dimen@inclinatumofflinemorahshiftbase * \gre@factor)\relax % \advance\gre@dimen@glyphraisevalue by -\gre@dimen@temp@three % \fi % \fi % diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index b1a477970..29564efcc 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -166,35 +166,29 @@ % Messing with the staff line thickness directly is messy, so we provide the following interface to make life easier on the user: % stafflineheight is the height of a staff line -% = 1500 * stafflinefactor +% = gre@dimen@stafflinethicknessbase * stafflinefactor \newdimen\gre@dimen@stafflineheight\relax% \def\gre@calculate@stafflineheight{% \gre@trace{gre@calculate@stafflineheight}% - \global\gre@dimen@stafflineheight=\dimexpr(1500 sp * \gre@stafflinefactor)\relax % + \global\gre@dimen@stafflineheight=\dimexpr(\gre@dimen@stafflinethicknessbase * \gre@stafflinefactor)\relax % \gre@trace@end% }% % interstafflinespace is the space between two lines of staff -% = (30000 - (stafflineheight/gre@factor - 1500)) * gre@factor = 31500 * gre@factor - stafflineheight +% = (gre@dimen@interstafflinedistancebase + gre@dimen@stafflinethicknessbase) * gre@factor - gre@dimen@stafflinethicknessbase * gre@stafflinefactor \newdimen\gre@dimen@interstafflinespace\relax% \def\gre@calculate@interstafflinespace{% \gre@trace{gre@calculate@interstafflinespace}% - \global\gre@dimen@interstafflinespace=\dimexpr((31500sp * \gre@factor) % - - \gre@dimen@stafflineheight)\relax% + \global\gre@dimen@interstafflinespace=\dimexpr((\gre@dimen@interstafflinedistancebase + \gre@dimen@stafflinethicknessbase) * \gre@factor - \gre@dimen@stafflinethicknessbase * \gre@stafflinefactor)\relax% \gre@trace@end% }% % a distance to help place glyphs when the lines are not their default thickness -% = (stafflineheight/gre@factor - 1500sp)/2 * gre@factor +% = gre@dimen@stafflinethicknessbase * (gre@stafflinefactor - gre@factor) / 2 \newdimen\gre@dimen@stafflinediff\relax% \def\gre@calculate@stafflinediff{% \gre@trace{gre@calculate@stafflinediff}% - \global\gre@dimen@stafflinediff = \dimexpr(% - ( ( ( \gre@dimen@stafflineheight % - / \gre@factor)% - - 1500sp)% - / 2)% - * \gre@factor)\relax% + \global\gre@dimen@stafflinediff = \dimexpr( \gre@dimen@stafflinethicknessbase * (\gre@stafflinefactor - \gre@factor) / 2 )\relax% \gre@trace@end% }% @@ -217,7 +211,7 @@ % to calculate that, we take the bottom of the third line : it is at 200 in the fonts, and it must be at grespacelinestext + grespacebeneathtext + 2*greinterstafflinespace + 2*grestafflineheight + translationheight \def\gre@calculate@constantglyphraise{% \gre@trace{gre@calculate@constantglyphraise}% - \global\gre@dimen@constantglyphraise = \dimexpr((-22000 sp * \gre@factor) % + \global\gre@dimen@constantglyphraise = \dimexpr((\gre@dimen@glyphraisebase * \gre@factor) % + \gre@dimen@additionalbottomspace % + \gre@space@dimen@spacebeneathtext % + \gre@space@dimen@spacelinestext % @@ -812,7 +806,7 @@ \fi% \fi% \global\advance\gre@count@temp@three by -8 % - \global\gre@dimen@glyphraisevalue = \dimexpr(15750 sp * \gre@factor * \gre@count@temp@three)\relax % + \global\gre@dimen@glyphraisevalue = \dimexpr(((\gre@dimen@interstafflinedistancebase + \gre@dimen@stafflinethicknessbase) / 2 ) * \gre@factor * \gre@count@temp@three)\relax % \ifcase#2 % \or\or\or%3: if it is a vertical episema on a line, we shift it a bit higher, so that it's more beautiful \ifgre@isonaline% @@ -996,21 +990,21 @@ \gre@num@max{#1}{\gre@pitch@cleftop}% \gre@count@temp@one=\numexpr(\gre@count@temp@one - \gre@pitch@adjust@top - \gre@space@count@additionaltopspacethreshold)\relax % \ifnum\gre@count@temp@one>0\relax % - \global\gre@dimen@additionaltopspace=\dimexpr(15750 sp * \gre@count@temp@one * \gre@factor)\relax % + \global\gre@dimen@additionaltopspace=\dimexpr(((\gre@dimen@interstafflinedistancebase + \gre@dimen@stafflinethicknessbase) / 2 ) * \gre@count@temp@one * \gre@factor)\relax % \else % \global\gre@dimen@additionaltopspace=0 sp% \fi % \gre@num@max{#1}{\gre@pitch@cleftop}% \gre@count@temp@one=\numexpr(\gre@count@temp@one - \gre@pitch@adjust@top - \gre@space@count@additionaltopspacealtthreshold)\relax % \ifnum\gre@count@temp@one>0\relax % - \global\gre@dimen@additionaltopspacealt=\dimexpr(15750 sp * \gre@count@temp@one * \gre@factor)\relax % + \global\gre@dimen@additionaltopspacealt=\dimexpr(((\gre@dimen@interstafflinedistancebase + \gre@dimen@stafflinethicknessbase) / 2 ) * \gre@count@temp@one * \gre@factor)\relax % \else % \global\gre@dimen@additionaltopspacealt=0 sp% \fi % \gre@num@max{#1}{\gre@pitch@cleftop}% \gre@count@temp@one=\numexpr(\gre@count@temp@one - \gre@pitch@adjust@top - \gre@space@count@additionaltopspacenabcthreshold)\relax % \ifnum\gre@count@temp@one>0\relax % - \global\gre@dimen@additionaltopspacenabc=\dimexpr(15750 sp * \gre@count@temp@one * \gre@factor)\relax % + \global\gre@dimen@additionaltopspacenabc=\dimexpr(((\gre@dimen@interstafflinedistancebase + \gre@dimen@stafflinethicknessbase) / 2 ) * \gre@count@temp@one * \gre@factor)\relax % \else % \global\gre@dimen@additionaltopspacenabc=0 sp% \fi % From 6bf41681e41480ccc52896f8e03dad0eaf2b04e1 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Sun, 14 Feb 2021 16:08:08 -0500 Subject: [PATCH 2/4] Remove `noteadditionalspacelinestext` The additional distance added between the score and the lyrics for lower than "normal" notes (as defined by `noteadditionalspacelinestextthreshold`) is now calculated automatically based on the exact distance below the "normal" position that the low notes have been placed. This mirrors what was already being done for notes higher than the "normal" position above the staff. The distance is marked as obsolete (skipping deprecated status) because it is no longer functional and we normally require deprecated code to be functional. --- CHANGELOG.md | 3 +++ doc/Command_Index_User.tex | 11 ++--------- tex/gregoriotex-common.tex | 6 +++++- tex/gregoriotex-spaces.tex | 7 ++----- tex/gsp-default.tex | 7 +------ 5 files changed, 13 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0a49b965..bf0fe6354 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). - GregorioTeX will now look in additional places for scores using. Users can specify paths to look in using `\gresetgregpath`. If scores are not found in the current working directory or the list of provided paths, we fall back on kpse to try and find them. See [#1395](https://github.com/gregorio-project/gregorio/issues/1395). - Added the ability to toggle the visibility of the translation and above lines text. See [user request on mailing list](https://groups.google.com/g/gregorio-users/c/J-V0dkBMevY). +### Removed +- `noteadditionalspacelinestext` is removed in favor of calculating the actual amount of additional space needed by low notes. Because the replacement is an automatic calculation, we skip straight to marking `noteadditionalspacelinestext` as obsolete (as we generally require deprecated code to still be functional). + ## [5.2.1] - 2019-04-06 ### Fixed diff --git a/doc/Command_Index_User.tex b/doc/Command_Index_User.tex index 701771570..b8a208f4f 100644 --- a/doc/Command_Index_User.tex +++ b/doc/Command_Index_User.tex @@ -1422,10 +1422,8 @@ \subsection{Counts}\label{counts} \end{gcount} \begin{gcount}{noteadditionalspacelinestextthreshold} -The number of low notes which will add on the -\texttt{noteadditionalspacelinestext} space. For instance, with a threshold of -\texttt{2}, every note below \texttt{c} will add {noteadditionalspacelinestext} -space for each pitch needed below \texttt{c}, accounting for the various signs. +The number of low notes which will add space between the lines and the lyrics. For instance, with a threshold of +\texttt{2}, every note below \texttt{c} will add space for each pitch needed below \texttt{c}, accounting for the various signs. \end{gcount} \subsection{Distances}\label{distances} @@ -1731,11 +1729,6 @@ \subsection{Distances}\label{distances} The space between the lines and the bottom of the text. \end{gdimension} -\begin{gdimension}{noteadditionalspacelinestext} -The space added between the lines and the bottom of the text for every pitch -below the \texttt{noteadditionalspacelinestextthreshold}. -\end{gdimension} - \begin{gdimension}{spacebeneathtext} The space beneath the text. \end{gdimension} diff --git a/tex/gregoriotex-common.tex b/tex/gregoriotex-common.tex index 3295de6bd..d181841ad 100644 --- a/tex/gregoriotex-common.tex +++ b/tex/gregoriotex-common.tex @@ -79,7 +79,11 @@ }% \def\gre@obsolete#1#2{% - \gre@error{#1\space is obsolete.\MessageBreak Use #2\space instead}% + \ifx&% + \gre@error{#1\space is obsolete and no longer has any effect}% + \else% + \gre@error{#1\space is obsolete.\MessageBreak Use #2\space instead}% + \fi% \relax% }% diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index 29564efcc..d37e7beb8 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -1011,7 +1011,7 @@ \gre@num@min{#2}{\gre@pitch@clefbottom}% \gre@count@temp@one=\numexpr(\gre@pitch@adjust@bottom - \gre@count@temp@one)\relax % \ifnum\gre@count@temp@one>0\relax % - \global\gre@dimen@additionalbottomspace=\dimexpr(\gre@space@dimen@noteadditionalspacelinestext * \gre@count@temp@one)\relax % + \global\gre@dimen@additionalbottomspace=\dimexpr(((\gre@dimen@interstafflinedistancebase + \gre@dimen@stafflinethicknessbase) / 2 ) * \gre@count@temp@one * \gre@factor)\relax % \else % \global\gre@dimen@additionalbottomspace=0 sp% \fi % @@ -1579,6 +1579,7 @@ % a macro for changing a dimension. Unlike \grecreatedim, this function won’t create a new distance, just change an existing one. \def\grechangedim#1#2#3{% + \IfStrEq{noteadditionalspacelinestext}{#1}{\gre@obsolete{noteadditionalspacelinestext}{}}{}%%% OBSOLETE \gre@rubberpermit{#1}% % figure out our prefix \ifgre@rubber% @@ -1898,7 +1899,6 @@ {alterationadjustmentbar}{\gre@rubberfalse}% {bracketupshift}{\gre@rubberfalse}% {bracketdownshift}{\gre@rubberfalse}% - {noteadditionalspacelinestext}{\gre@rubberfalse}% }[\gre@rubbertrue]% \gre@trace@end% }% @@ -2349,9 +2349,6 @@ \gre@count@temp@two = \numexpr((\gre@stafflinefactor * #2) / #1)\relax% \xdef\gre@stafflinefactor{\the\gre@count@temp@two}% \fi% - \ifgre@scale@noteadditionalspacelinestext% - \gre@changeonedimenfactor{noteadditionalspacelinestext}{#1}{#2}% - \fi% \relax % \gre@trace@end% }% diff --git a/tex/gsp-default.tex b/tex/gsp-default.tex index ab6b682ef..1ce7eb961 100644 --- a/tex/gsp-default.tex +++ b/tex/gsp-default.tex @@ -358,12 +358,7 @@ \grechangecount{additionaltopspacenabcthreshold}{4}% %the space between the lines and the bottom of the text \grecreatedim{spacelinestext}{0.60617 cm}{scalable}% -%the per-note additional space between lines and the bottom of the text -\grecreatedim{noteadditionalspacelinestext}{0.14413 cm}{scalable}% -% this counter is the number of low notes which will add on the -% noteadditionalspacelinestext. For instance, with a threshold of 2, every -% note below c will add noteadditionalspacelinestext space for each pitch needed -% below c, accounting for the various signs. +% this counter is the number of low notes which will add on additional distance \grechangecount{noteadditionalspacelinestextthreshold}{2}% %the space beneath the text \grecreatedim{spacebeneathtext}{0 cm}{scalable}% From d288525965d6f33f41afed4c9d1b95440296bc65 Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Mon, 15 Feb 2021 13:10:41 -0500 Subject: [PATCH 3/4] Mark `noteadditionalspacelinestext` as deprecated rather than obsolete By making use of the `\ifgre@allowdeprecated` conditional, we can allow the user to preserve the old spacing behavior regarding low notes. --- CHANGELOG.md | 4 ++-- tex/gregoriotex-common.tex | 12 ++++++++++-- tex/gregoriotex-spaces.tex | 12 ++++++++++-- tex/gsp-default.tex | 2 ++ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf0fe6354..8e3c65c17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,8 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). - GregorioTeX will now look in additional places for scores using. Users can specify paths to look in using `\gresetgregpath`. If scores are not found in the current working directory or the list of provided paths, we fall back on kpse to try and find them. See [#1395](https://github.com/gregorio-project/gregorio/issues/1395). - Added the ability to toggle the visibility of the translation and above lines text. See [user request on mailing list](https://groups.google.com/g/gregorio-users/c/J-V0dkBMevY). -### Removed -- `noteadditionalspacelinestext` is removed in favor of calculating the actual amount of additional space needed by low notes. Because the replacement is an automatic calculation, we skip straight to marking `noteadditionalspacelinestext` as obsolete (as we generally require deprecated code to still be functional). +### Deprecated +- `noteadditionalspacelinestext` is removed in favor of calculating the actual amount of additional space needed by low notes. ## [5.2.1] - 2019-04-06 diff --git a/tex/gregoriotex-common.tex b/tex/gregoriotex-common.tex index d181841ad..13a7cd047 100644 --- a/tex/gregoriotex-common.tex +++ b/tex/gregoriotex-common.tex @@ -71,9 +71,17 @@ % #2 - the correct macro to use \def\gre@deprecated#1#2{% \ifgre@allowdeprecated% - \gre@warning{#1\space is deprecated.\MessageBreak Use #2\space instead}% + \ifx&% + \gre@warning{#1\space is deprecated and marked for removal}% + \else% + \gre@warning{#1\space is deprecated.\MessageBreak Use #2\space instead}% + \fi% \else% - \gre@error{#1\space is deprecated.\MessageBreak Use #2\space instead}% + \ifx&% + \gre@error{#1\space is deprecated and marked for removal}% + \else% + \gre@error{#1\space is deprecated.\MessageBreak Use #2\space instead}% + \fi% \fi% \relax% }% diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index d37e7beb8..2339e73f3 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -1011,7 +1011,11 @@ \gre@num@min{#2}{\gre@pitch@clefbottom}% \gre@count@temp@one=\numexpr(\gre@pitch@adjust@bottom - \gre@count@temp@one)\relax % \ifnum\gre@count@temp@one>0\relax % - \global\gre@dimen@additionalbottomspace=\dimexpr(((\gre@dimen@interstafflinedistancebase + \gre@dimen@stafflinethicknessbase) / 2 ) * \gre@count@temp@one * \gre@factor)\relax % + \ifgre@allowdeprecated% DEPRECATED + \global\gre@dimen@additionalbottomspace=\dimexpr(\gre@space@dimen@noteadditionalspacelinestext * \gre@count@temp@one)\relax % DEPRECATED + \else% DEPRECATED + \global\gre@dimen@additionalbottomspace=\dimexpr(((\gre@dimen@interstafflinedistancebase + \gre@dimen@stafflinethicknessbase) / 2 ) * \gre@count@temp@one * \gre@factor)\relax % keep this line + \fi% DEPRECATED \else % \global\gre@dimen@additionalbottomspace=0 sp% \fi % @@ -1579,7 +1583,7 @@ % a macro for changing a dimension. Unlike \grecreatedim, this function won’t create a new distance, just change an existing one. \def\grechangedim#1#2#3{% - \IfStrEq{noteadditionalspacelinestext}{#1}{\gre@obsolete{noteadditionalspacelinestext}{}}{}%%% OBSOLETE + \IfStrEq{noteadditionalspacelinestext}{#1}{\gre@deprecated{noteadditionalspacelinestext}{}}{}%%% DEPRECATED \gre@rubberpermit{#1}% % figure out our prefix \ifgre@rubber% @@ -1899,6 +1903,7 @@ {alterationadjustmentbar}{\gre@rubberfalse}% {bracketupshift}{\gre@rubberfalse}% {bracketdownshift}{\gre@rubberfalse}% + {noteadditionalspacelinestext}{\gre@rubberfalse}% DEPRECATED }[\gre@rubbertrue]% \gre@trace@end% }% @@ -2349,6 +2354,9 @@ \gre@count@temp@two = \numexpr((\gre@stafflinefactor * #2) / #1)\relax% \xdef\gre@stafflinefactor{\the\gre@count@temp@two}% \fi% + \ifgre@scale@noteadditionalspacelinestext% DEPRECATED + \gre@changeonedimenfactor{noteadditionalspacelinestext}{#1}{#2}% DEPRECATED + \fi% DEPRECATED \relax % \gre@trace@end% }% diff --git a/tex/gsp-default.tex b/tex/gsp-default.tex index 1ce7eb961..2018ac058 100644 --- a/tex/gsp-default.tex +++ b/tex/gsp-default.tex @@ -358,6 +358,8 @@ \grechangecount{additionaltopspacenabcthreshold}{4}% %the space between the lines and the bottom of the text \grecreatedim{spacelinestext}{0.60617 cm}{scalable}% +% DEPRECATED the per-note additional space between lines and the bottom of the text DEPRECATED +\grecreatedim{noteadditionalspacelinestext}{0.14413 cm}{scalable}% DEPRECATED % this counter is the number of low notes which will add on additional distance \grechangecount{noteadditionalspacelinestextthreshold}{2}% %the space beneath the text From 02ca4487bfe346ad317b5e3e300f52d26e5fadcb Mon Sep 17 00:00:00 2001 From: "Fr. Samuel Springuel" Date: Tue, 16 Feb 2021 21:44:02 -0500 Subject: [PATCH 4/4] Set as option rather than deprecation --- CHANGELOG.md | 4 ++-- doc/Command_Index_User.tex | 7 +++++++ doc/Command_Index_internal.tex | 4 ++++ tex/gregoriotex-main.tex | 13 +++++++++++++ tex/gregoriotex-spaces.tex | 19 +++++++++---------- tex/gsp-default.tex | 4 ++-- 6 files changed, 37 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e3c65c17..f48f117c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,8 +17,8 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). - GregorioTeX will now look in additional places for scores using. Users can specify paths to look in using `\gresetgregpath`. If scores are not found in the current working directory or the list of provided paths, we fall back on kpse to try and find them. See [#1395](https://github.com/gregorio-project/gregorio/issues/1395). - Added the ability to toggle the visibility of the translation and above lines text. See [user request on mailing list](https://groups.google.com/g/gregorio-users/c/J-V0dkBMevY). -### Deprecated -- `noteadditionalspacelinestext` is removed in favor of calculating the actual amount of additional space needed by low notes. +### Changed +- `noteadditionalspacelinestext` now calculates the actual amount of additional space needed by low notes. To enable the old behavior (when `noteadditionalspacelinestext` is set by the user), use `\gresetnoteadditionalspacelinestext{manual}`. See [#1521](https://github.com/gregorio-project/gregorio/issues/1521) and [#1526](https://github.com/gregorio-project/gregorio/pull/1526). ## [5.2.1] - 2019-04-06 diff --git a/doc/Command_Index_User.tex b/doc/Command_Index_User.tex index b8a208f4f..a4acf7065 100644 --- a/doc/Command_Index_User.tex +++ b/doc/Command_Index_User.tex @@ -410,6 +410,13 @@ \subsubsection{Fine Tuning Dimensions} system should act as if the ledger line exists (\texttt{1}) or not (\texttt{0}). +\macroname{\textbackslash gresetnoteadditionalspacelinestext}{\{\#1\}}{gregoriotex-main.tex} +Macro which determines how much additional space between the notes and the lyrics for really low notes. + +\begin{argtable} + \#1 & \texttt{automatic} & additional space between the notes and the lyrics is computed automatically (default)\\ + & \texttt{manual} & additional space between the notes and the lyrics is based on the user setting of \texttt{noteadditionalspacelinestext} (a spacing adjustable using \verb=\grechangedim=) +\end{argtable} \subsubsection{Staff Lines} diff --git a/doc/Command_Index_internal.tex b/doc/Command_Index_internal.tex index 87e2df76a..4aca26d84 100644 --- a/doc/Command_Index_internal.tex +++ b/doc/Command_Index_internal.tex @@ -1948,6 +1948,10 @@ \subsection{Flags} \macroname{\textbackslash ifgre@evaluatingnextsyllable}{}{gregoriotex-syllable.tex} Boolean indicating that some aspect of the next syllable is being evaluated in advance. +\macroname{\textbackslash ifgre@noteadditionalspacelinestext}{}{gregoriotex-main.tex} +Boolean indicating that the additional space needed between the notes and the lyrics due to really low notes should follow the user setting of noteadditionalspacelinestext (as opposed to being calculated automatically, the default). + + \subsection{Boxes} Boxes are used to store elements of the score before they are printed for the purposes of reusing them and/or measuring them in order to determine their appropriate placement. diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index 655636252..24a33c7ea 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -1126,6 +1126,19 @@ ]% }% +\newif\ifgre@noteadditionalspacelinestext% +\def\gresetnoteadditionalspacelinestext#1{% + \IfStrEqCase{#1}{% + {automatic}% + {\gre@noteadditionalspacelinestextfalse}% + {manual}% + {\gre@noteadditionalspacelinestexttrue}% + }[% all other cases + \gre@error{Unrecognized option "#1" for \protect\gresetnoteadditionalspacelinestext\MessageBreak Possible options are: 'automatic' and 'manual'}% + ]% +}% +\gresetnoteadditionalspacelinestext{automatic}%default setting + % gre@attr@dash (see its definition in gregorio-syllable) is 0 when we are in a score, and unset when we are not \newif\ifgre@beginningofscore% diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index 2339e73f3..9dd5ac1e5 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -1011,11 +1011,11 @@ \gre@num@min{#2}{\gre@pitch@clefbottom}% \gre@count@temp@one=\numexpr(\gre@pitch@adjust@bottom - \gre@count@temp@one)\relax % \ifnum\gre@count@temp@one>0\relax % - \ifgre@allowdeprecated% DEPRECATED - \global\gre@dimen@additionalbottomspace=\dimexpr(\gre@space@dimen@noteadditionalspacelinestext * \gre@count@temp@one)\relax % DEPRECATED - \else% DEPRECATED - \global\gre@dimen@additionalbottomspace=\dimexpr(((\gre@dimen@interstafflinedistancebase + \gre@dimen@stafflinethicknessbase) / 2 ) * \gre@count@temp@one * \gre@factor)\relax % keep this line - \fi% DEPRECATED + \ifgre@noteadditionalspacelinestext% + \global\gre@dimen@additionalbottomspace=\dimexpr(\gre@space@dimen@noteadditionalspacelinestext * \gre@count@temp@one)\relax% + \else% + \global\gre@dimen@additionalbottomspace=\dimexpr(((\gre@dimen@interstafflinedistancebase + \gre@dimen@stafflinethicknessbase) / 2 ) * \gre@factor * \gre@count@temp@one)\relax% + \fi% \else % \global\gre@dimen@additionalbottomspace=0 sp% \fi % @@ -1583,7 +1583,6 @@ % a macro for changing a dimension. Unlike \grecreatedim, this function won’t create a new distance, just change an existing one. \def\grechangedim#1#2#3{% - \IfStrEq{noteadditionalspacelinestext}{#1}{\gre@deprecated{noteadditionalspacelinestext}{}}{}%%% DEPRECATED \gre@rubberpermit{#1}% % figure out our prefix \ifgre@rubber% @@ -1903,7 +1902,7 @@ {alterationadjustmentbar}{\gre@rubberfalse}% {bracketupshift}{\gre@rubberfalse}% {bracketdownshift}{\gre@rubberfalse}% - {noteadditionalspacelinestext}{\gre@rubberfalse}% DEPRECATED + {noteadditionalspacelinestext}{\gre@rubberfalse}% }[\gre@rubbertrue]% \gre@trace@end% }% @@ -2354,9 +2353,9 @@ \gre@count@temp@two = \numexpr((\gre@stafflinefactor * #2) / #1)\relax% \xdef\gre@stafflinefactor{\the\gre@count@temp@two}% \fi% - \ifgre@scale@noteadditionalspacelinestext% DEPRECATED - \gre@changeonedimenfactor{noteadditionalspacelinestext}{#1}{#2}% DEPRECATED - \fi% DEPRECATED + \ifgre@scale@noteadditionalspacelinestext% + \gre@changeonedimenfactor{noteadditionalspacelinestext}{#1}{#2}% + \fi% \relax % \gre@trace@end% }% diff --git a/tex/gsp-default.tex b/tex/gsp-default.tex index 2018ac058..a24c73b3f 100644 --- a/tex/gsp-default.tex +++ b/tex/gsp-default.tex @@ -358,8 +358,8 @@ \grechangecount{additionaltopspacenabcthreshold}{4}% %the space between the lines and the bottom of the text \grecreatedim{spacelinestext}{0.60617 cm}{scalable}% -% DEPRECATED the per-note additional space between lines and the bottom of the text DEPRECATED -\grecreatedim{noteadditionalspacelinestext}{0.14413 cm}{scalable}% DEPRECATED +% the per-note additional space between lines and the bottom of the text +\grecreatedim{noteadditionalspacelinestext}{0.14413 cm}{scalable}% % this counter is the number of low notes which will add on additional distance \grechangecount{noteadditionalspacelinestextthreshold}{2}% %the space beneath the text