Skip to content

Commit

Permalink
Merge branch 'ctan' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rpspringuel committed Feb 23, 2021
2 parents 745edd0 + 80ad57c commit 04735f3
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 80 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ 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).

### 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).

### Removed
- `\gresethyphenprotrusion{percentage}`, supplanted by `\gresetprotrusionfactor{eolhyphen}{factor}`. Note that the value the new command takes is a factor rather than a percentage.


## [5.2.1] - 2019-04-06
### Fixed
Expand Down
25 changes: 11 additions & 14 deletions contrib/900_gregorio.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,19 @@
</empty-frame-text>
<!-- you can change the basic headers here -->
<preamble>
\documentclass[$scribus_grefontsize$]{extarticle}
\usepackage[paperwidth=$scribus_realwidth$ pt,
paperheight=$scribus_realheight$ pt,
left=0cm,top=0cm,right=0cm,bottom=0cm,nohead,nofoot]{geometry}
\documentclass[$scribus_grefontsize$]{extarticle}
\usepackage[paperwidth=$scribus_realwidth$ pt, paperheight=$scribus_realheight$ pt, left=0cm,top=0cm,right=0cm,bottom=0cm,nohead,nofoot]{geometry}
\usepackage[autocompile]{gregoriotex}
\usepackage{filecontents}
\title{Scribus-Latex-File}
$scribus_additionalgreheaders$
\author{Scribus}
\pagestyle{empty}
\setlength{\textwidth}{$scribus_realwidth$ pt}
\title{Scribus-Latex-File}
$scribus_additionalgreheaders$
\author{Scribus}
\pagestyle{empty}
\setlength{\textwidth}{$scribus_realwidth$ pt}

\begin{filecontents*}{scribus_file-score.gabc}
</preamble>
<postamble>
\end{filecontents*}
\begin{filecontents*}[overwrite]{scribus_file-score.gabc}
</preamble> <!-- this line's indentation is purposefully off because of the way that scribus interprets the preamble section -->
<postamble>
\end{filecontents*}

\begin{document}
$scribus_greconf$
Expand Down
18 changes: 9 additions & 9 deletions doc/Command_Index_User.tex
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,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}

Expand Down Expand Up @@ -1411,10 +1418,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}
Expand Down Expand Up @@ -1720,11 +1725,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}
Expand Down
6 changes: 2 additions & 4 deletions doc/Command_Index_gregorio.tex
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,8 @@ \section{Gregorio Controls}

\macroname{\textbackslash GreFirstSyllableInitial}{\#1}{gregoriotex-syllable.tex}
A macro which is called with the first letter of the first syllable which is
not the initial of the score. If the \texttt{initial-style} is \texttt{0}, the
first letter of the syllable will be passed. If the \texttt{initial-style} is
\texttt{1} or \texttt{2}, the \emph{second} letter will be passed. This macro
may be redefined to style the first letter appropriately.
not the initial of the score. If there is no initial (\verb=\gresetinitiallines{0}= has been called), the
first letter of the syllable will be passed. Otherwise, the \emph{second} letter will be passed.

\begin{argtable}
\#1 & string & The first letter of the first syllable which is not the
Expand Down
4 changes: 4 additions & 0 deletions doc/Command_Index_internal.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2003,6 +2003,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.
Expand Down
7 changes: 2 additions & 5 deletions doc/gsp-sample.tex
Original file line number Diff line number Diff line change
Expand Up @@ -403,12 +403,9 @@
\grechangecount{additionaltopspacenabcthreshold}{4}%
%the space between the lines and the bottom of the text
\grechangedim{spacelinestext}{0.60617 cm}{scalable}%
%the per-note additional space between lines and the bottom of the text
% the per-note additional space between lines and the bottom of the text
\grechangedim{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
\grechangedim{spacebeneathtext}{0 cm}{scalable}%
Expand Down
18 changes: 15 additions & 3 deletions tex/gregoriotex-common.tex
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,27 @@
% #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&#2&%
\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&#2&%
\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%
}%

\def\gre@obsolete#1#2{%
\gre@error{#1\space is obsolete.\MessageBreak Use #2\space instead}%
\ifx&#2&%
\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%
}%

Expand Down
57 changes: 39 additions & 18 deletions tex/gregoriotex-main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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%
Expand Down Expand Up @@ -1803,25 +1816,34 @@
\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
\gre@obsolete{'parmesan' font}{'granapadano' font}%%% OBSOLETE
}{%%% OBSOLETE
% keep this section
\if\relax\detokenize{#1}\relax %
\xdef\gre@gregoriofontname{#2}%
\expandafter\xdef\csname gre@fontfactor@#2\endcsname{#3}%
\gre@loadgregoriofont%
\gdef\GreCPVirgaReversaAscendensOnDLine##1{##1}%
\else %
\xdef\gre@gregoriofontname{#2-#1}%
\expandafter\xdef\csname gre@fontfactor@#2-#1\endcsname{#3}%
\gre@loadgregoriofont%
\gdef\GreCPVirgaReversaAscendensOnDLine##1{\GreCPVirgaReversaLongqueueAscendens}%
\fi %
}%%% OBSOLETE
\relax %
\if\relax\detokenize{#1}\relax %
\xdef\gre@gregoriofontname{#2}%
\expandafter\xdef\csname gre@fontfactor@#2\endcsname{#3}%
\gre@loadgregoriofont%
\gdef\GreCPVirgaReversaAscendensOnDLine##1{##1}%
\else %
\xdef\gre@gregoriofontname{#2-#1}%
\expandafter\xdef\csname gre@fontfactor@#2-#1\endcsname{#3}%
\gre@loadgregoriofont%
\gdef\GreCPVirgaReversaAscendensOnDLine##1{\GreCPVirgaReversaLongqueueAscendens}%
\fi %
% 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%
}%

Expand Down Expand Up @@ -1874,7 +1896,6 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\grechangestyle#1#2{%
\IfStrEq{#1}{biginitial}{\gre@obsolete{biginitial style}{initial style}}{}%%% OBSOLETE
\@ifnextchar[{\gre@changestyle{#1}{#2}}{\gre@changestyle{#1}{#2}[\relax]}%
}%

Expand Down
6 changes: 3 additions & 3 deletions tex/gregoriotex-signs.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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 %
Expand Down
45 changes: 21 additions & 24 deletions tex/gregoriotex-spaces.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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%
}%

Expand All @@ -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 %
Expand Down Expand Up @@ -581,10 +575,9 @@
\hbox to \gre@dimen@temp@four{#2\hss}%
}%

\def\gresethyphenprotrusion#1{% DEPRECATED for removal in 5.1
\gre@deprecated{\protect\gresethyphenprotrusion{percentage}}{\protect\gresetprotrusionfactor{eolhyphen}{factor}}% DEPRECATED for removal in 5.1
\gresetprotrusionfactor{eolhyphen}{\directlua{tex.print(string.format(string.char(37)..'g', #1 / 100.0))}}% DEPRECATED for removal in 5.1
}% DEPRECATED for removal in 5.1
\def\gresethyphenprotrusion#1{% OBSOLETE
\gre@obsolete{\protect\gresethyphenprotrusion{percentage}}{\protect\gresetprotrusionfactor{eolhyphen}{factor}}% OBSOLETE
}% OBSOLETE

% dimen keeping the shift computed with next function
\newdimen\gre@dimen@eolshift
Expand Down Expand Up @@ -812,7 +805,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%
Expand Down Expand Up @@ -996,28 +989,32 @@
\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 %
\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 %
\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 %
Expand Down Expand Up @@ -1578,7 +1575,7 @@
{inherited}%
{\grescaledim{#1}{false}}%
}[% all other cases
\gre@error{Unrecognized option "#3" for \protect\grecreatedim\MessageBreak Possible options are: 'scalable' and 'fixed' and 'inherited'}%
\gre@error{Unrecognized option "#3" for \protect\gre@createdim\MessageBreak Possible options are: 'scalable' and 'fixed' and 'inherited'}%
]%
\gre@dimension{#1}{#2}{#3}%
}%
Expand Down Expand Up @@ -1628,7 +1625,7 @@
\fi%
\fi%
\else%
\gre@error{#1 is not a recognized distance.}
\gre@error{#1 is not a recognized distance.}%
\fi%
}%

Expand Down

0 comments on commit 04735f3

Please sign in to comment.