Skip to content

Commit

Permalink
Merge pull request #1154 from jakubjelinek/release-4.2
Browse files Browse the repository at this point in the history
Copy'n'paste approach for issue #1153.
  • Loading branch information
henryso authored Jun 23, 2016
2 parents d11992e + b06d804 commit c1b861e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
23 changes: 19 additions & 4 deletions tex/gregoriotex-main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -790,31 +790,46 @@

\def\GreSetTextAboveLines#1{%
\gdef\gre@currenttextabovelines{%
\gre@typesettextabovelines{#1}%
\gre@typesettextabovelines{#1}{0}%
\gdef\gre@currenttextabovelines{}%
\relax %
}%
}%

% typesets the text above the line
\def\gre@typesettextabovelines#1{%
% typesets the text or nabc neumes above the line
\def\gre@typesettextabovelines#1#2{%
\gre@style@abovelinestext%
\gre@debugmsg{spacing}{Raise alt text: \gre@space@dimen@abovelinestextraise}%
\endgre@style@abovelinestext%
\ifnum#2=0\relax%
\gre@dimen@temp@five=\gre@dimen@additionaltopspacealt\relax%
\else%
\gre@dimen@temp@five=\gre@dimen@additionaltopspacenabc\relax%
\fi%
\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@additionaltopspacealt %
+ \gre@dimen@temp@five %
+ \gre@space@dimen@abovelinestextraise)\relax%
\gre@mark@abovelinestext %
\gre@debugmsg{spacing}{Raise alt text: \the\gre@dimen@temp@five}%
\leavevmode\raise\gre@dimen@temp@five\hbox to 0pt{\gre@style@abovelinestext#1\endgre@style@abovelinestext\hss}%
\relax %
}%

% similarly, but for typesetting Nabc neumes above lines

\def\GreSetNabcAboveLines#1{%
\gdef\gre@currenttextabovelines{%
\gre@typesettextabovelines{#1}{1}%
\gdef\gre@currenttextabovelines{}%
\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 @@ -737,12 +737,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 @@ -762,6 +767,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 c1b861e

Please sign in to comment.