From 69faf7d298715f460501cfef7dc4f132fab2bd26 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 21 Jun 2016 20:29:48 +0200 Subject: [PATCH] Copy'n'paste approach for issue #1153. --- tex/gregoriotex-main.tex | 29 +++++++++++++++++++++++++++++ tex/gregoriotex-nabc.tex | 4 ++-- tex/gregoriotex-spaces.tex | 13 ++++++++++++- tex/gsp-default.tex | 2 ++ 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/tex/gregoriotex-main.tex b/tex/gregoriotex-main.tex index 3fde07407..4f197292c 100644 --- a/tex/gregoriotex-main.tex +++ b/tex/gregoriotex-main.tex @@ -815,6 +815,35 @@ \relax % }% +% similarly, but for typesetting Nabc neumes above lines + +\def\GreSetNabcAboveLines#1{% + \gdef\gre@currenttextabovelines{% + \gre@typesetnabcabovelines{#1}% + \gdef\gre@currenttextabovelines{}% + \relax % + }% +}% + +% typesets the nabc above the line +\def\gre@typesetnabcabovelines#1{% + \gre@style@abovelinestext% + \gre@debugmsg{spacing}{Raise nabc: \gre@space@dimen@abovelinestextraise}% + \endgre@style@abovelinestext% + \gre@dimen@temp@five=\dimexpr(4\gre@dimen@stafflineheight % + + 4\gre@dimen@interstafflinespace % + + \gre@space@dimen@spacebeneathtext % + + \gre@dimen@currenttranslationheight % + + \gre@space@dimen@spacelinestext % + + \gre@dimen@additionalbottomspace % + + \gre@dimen@additionaltopspacenabc % + + \gre@space@dimen@abovelinestextraise)\relax% + \gre@mark@abovelinestext % + \gre@debugmsg{spacing}{Raise nabc: \the\gre@dimen@temp@five}% + \leavevmode\raise\gre@dimen@temp@five\hbox to 0pt{\gre@style@abovelinestext#1\endgre@style@abovelinestext\hss}% + \relax % +}% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% macros for the typesetting of the lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/tex/gregoriotex-nabc.tex b/tex/gregoriotex-nabc.tex index b9178fcaa..a953c5fae 100644 --- a/tex/gregoriotex-nabc.tex +++ b/tex/gregoriotex-nabc.tex @@ -1,6 +1,6 @@ %GregorioTeX file. % -% Copyright (C) 2014-2015 The Gregorio Project (see CONTRIBUTORS.md) +% Copyright (C) 2014-2016 The Gregorio Project (see CONTRIBUTORS.md) % % This file is part of Gregorio. % @@ -51,7 +51,7 @@ }} \def\GreNABCNeumes#1#2{% - \GreSetTextAboveLines{\GreNABCChar{#2}}% + \GreSetNabcAboveLines{\GreNABCChar{#2}}% } \newif\ifgre@nabcfontloaded% diff --git a/tex/gregoriotex-spaces.tex b/tex/gregoriotex-spaces.tex index 682b513e4..41589d131 100644 --- a/tex/gregoriotex-spaces.tex +++ b/tex/gregoriotex-spaces.tex @@ -731,12 +731,17 @@ \newdimen\gre@dimen@additionaltopspace\relax% % the one taken into account for above lines text height \newdimen\gre@dimen@additionaltopspacealt\relax% +% the one taken into account for above lines nabc height +\newdimen\gre@dimen@additionaltopspacenabc\relax% \newcount\gre@space@count@additionaltopspacethreshold\relax% \gre@space@count@additionaltopspacethreshold=2 \newcount\gre@space@count@additionaltopspacealtthreshold\relax% -\gre@space@count@additionaltopspacethreshold=0 +\gre@space@count@additionaltopspacealtthreshold=0 + +\newcount\gre@space@count@additionaltopspacenabcthreshold\relax% +\gre@space@count@additionaltopspacenabcthreshold=4 % #1 is the high height % #2 is the low height @@ -756,6 +761,12 @@ \else % \global\gre@dimen@additionaltopspacealt=0 sp% \fi % + \gre@count@temp@one=\numexpr(#1 - \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 % + \else % + \global\gre@dimen@additionaltopspacenabc=0 sp% + \fi % \gre@count@temp@one=\numexpr((#2 - \gre@pitch@adjust@bottom) * -1)\relax % \ifnum\gre@count@temp@one>0\relax % \global\gre@dimen@additionalbottomspace=\dimexpr(15750 sp * \gre@count@temp@one * \gre@factor)\relax % diff --git a/tex/gsp-default.tex b/tex/gsp-default.tex index f71b3126d..d6dd38b35 100644 --- a/tex/gsp-default.tex +++ b/tex/gsp-default.tex @@ -314,6 +314,8 @@ \grechangecount{additionaltopspacethreshold}{2}% % same, for notes taken into account for alt text vertical position \grechangecount{additionaltopspacealtthreshold}{0}% +% same, for notes taken into account for nabc vertical position +\grechangecount{additionaltopspacenabcthreshold}{4}% %the space between the lines and the bottom of the text \grecreatedim{spacelinestext}{0.60617 cm}{scalable}% %the space beneath the text