Skip to content

Commit

Permalink
Copy'n'paste approach for issue gregorio-project#1153.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubjelinek committed Jun 21, 2016
1 parent be4e1c8 commit 69faf7d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
29 changes: 29 additions & 0 deletions tex/gregoriotex-main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down
4 changes: 2 additions & 2 deletions tex/gregoriotex-nabc.tex
Original file line number Diff line number Diff line change
@@ -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.
%
Expand Down Expand Up @@ -51,7 +51,7 @@
}}

\def\GreNABCNeumes#1#2{%
\GreSetTextAboveLines{\GreNABCChar{#2}}%
\GreSetNabcAboveLines{\GreNABCChar{#2}}%
}

\newif\ifgre@nabcfontloaded%
Expand Down
13 changes: 12 additions & 1 deletion tex/gregoriotex-spaces.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 %
Expand Down
2 changes: 2 additions & 0 deletions tex/gsp-default.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 69faf7d

Please sign in to comment.