Skip to content

Commit

Permalink
Fixed the ability to substitute bar glyphs.
Browse files Browse the repository at this point in the history
Part of the implementation for gregorio-project#1360.
  • Loading branch information
henryso committed Nov 25, 2017
1 parent ae191d5 commit 83f2a79
Show file tree
Hide file tree
Showing 13 changed files with 747 additions and 812 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased][unreleased]
- Added support for virgula (gabc: `` `0``) and divisio minima (gabc: `,0`) on the ledger line above the staff (see [#1370](https://github.com/gregorio-project/gregorio/issues/1370)).
- Added support for a dotted bar (gabc: `:?`) (see [#1360](https://github.com/gregorio-project/gregorio/issues/1360)).
- Added support for a dotted bar (gabc: `:?`) (See [#1360](https://github.com/gregorio-project/gregorio/issues/1360) and [#1387](https://github.com/gregorio-project/gregorio/issues/1387))

## [Unreleased][unreleased]
- Fixed issue with Tex Live 2017 latexmk not detecting auto-compiled gabc files as dependencies (see [#1367](https://github.com/gregorio-project/gregorio/issues/1367)).
Expand Down
19 changes: 15 additions & 4 deletions doc/Command_Index_User.tex
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,9 @@ \subsubsection{Glyph Alteration}
& string & (any other string) The name of the glyph to use.
\end{argtable}

\medskip If \texttt{\#1} has a wildcard (a \texttt{*}) in it, then
\texttt{\#3} must start with a dot and all glyphs matching \texttt{\#1}
will be replaced with corresponding glyphs whose names have \texttt{\#3}
appended.
\medskip If \texttt{\#1} has a wildcard (a \texttt{*}) in it, then \texttt{\#3}
must be empty or start with a dot, and all glyphs matching \texttt{\#1} will be
replaced with corresponding glyphs whose names have \texttt{\#3} appended.

\medskip If \texttt{\#2} is \texttt{*}, then the substitution is assumed
to be available in all score fonts.
Expand All @@ -511,6 +510,18 @@ \subsubsection{Glyph Alteration}
\grechangeglyph{TorculusResupinus*}{*}{.alt}
\end{latexcode}

\textbf{Nota Bene:} Because the bar glyphs vary based on number of score lines,
substituting them is more complicated. To cover all numbers of score lines,
you will need to substitute all of the glyphs for the same (like
\texttt{VirgulaTwo} through \texttt{VirgulaSix} for all available virgula
glyphs). For example:

\medskip To replace all "dotted divisio maior" glyphs with their same-named
variants from the \texttt{gregorio} font, use the following:\par\medskip
\begin{latexcode}
\grechangeglyph{DivisioMaiorDotted*}{gregorio}{}
\end{latexcode}

\macroname{\textbackslash greresetglyph}{\{\#1\}}{gregoriotex-main.tex}
Removes a Gregorio\TeX\ score glyph substitution, restoring it back to
its original form.
Expand Down
32 changes: 32 additions & 0 deletions doc/Command_Index_internal.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,38 @@ \subsection{Character Reference Aliases}
\macroname{\textbackslash gre@char@he@...}{\#1}{gregoriotex-chars.tex}
A class of macros for the horizontal episema which populates the \verb=\gre@box@hep= box.
\macroname{\textbackslash gre@char@bar@virgula}{}{gregoriotex-main.tex}
Alias that will hold the character for the virgula for the current number of
lines for the staff.
\macroname{\textbackslash gre@char@bar@virgulahigh}{}{gregoriotex-main.tex}
Alias that will hold the character for the high virgula for the current number
of lines for the staff.
\macroname{\textbackslash gre@char@bar@divisiominima}{}{gregoriotex-main.tex}
Alias that will hold the character for the divisio minima for the current
number of lines for the staff.
\macroname{\textbackslash gre@char@bar@divisiominimahigh}{}{gregoriotex-main.tex}
Alias that will hold the character for the high divisio minima for the current
number of lines for the staff.
\macroname{\textbackslash gre@char@bar@divisiominor}{}{gregoriotex-main.tex}
Alias that will hold the character for the divisio minor for the current
number of lines for the staff.
\macroname{\textbackslash gre@char@bar@divisiomaior}{}{gregoriotex-main.tex}
Alias that will hold the character for the divisio maior for the current
number of lines for the staff.
\macroname{\textbackslash gre@char@bar@divisiomaiordotted}{}{gregoriotex-main.tex}
Alias that will hold the character for the dotted divisio maior for the current
number of lines for the staff.
\macroname{\textbackslash gre@char@bar@divisiomaiordottedbacking}{}{gregoriotex-main.tex}
Alias that will hold the character for the dotted divisio maior backing for the
current number of lines for the staff.
\macroname{\textbackslash gre@nabccharno}{\#1\#2\#3}{gregoriotex-nabc.tex}
Prints the nabc glyphs for the given nabc string.
Expand Down
66 changes: 36 additions & 30 deletions doc/GregorioRef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,27 +119,27 @@ local EXCLUDE = {
QuilismaLineTR = true,
VirgaLineBR = true,
SalicusOriscus = true,
['Virgula.2'] = true,
['Virgula.3'] = true,
['Virgula.5'] = true,
['Virgula.6'] = true,
['DivisioMinima.2'] = true,
['DivisioMinima.3'] = true,
['DivisioMinima.5'] = true,
['DivisioMinima.6'] = true,
['DivisioMinor.2'] = true,
['DivisioMinor.3'] = true,
['DivisioMinor.5'] = true,
['DivisioMaior.2'] = true,
['DivisioMaior.3'] = true,
['DivisioMaior.5'] = true,
['DivisioMaiorDotted.2'] = true,
['DivisioMaiorDotted.3'] = true,
['DivisioMaiorDotted.5'] = true,
['DivisioMaiorDottedBacking.2'] = true,
['DivisioMaiorDottedBacking.3'] = true,
['DivisioMaiorDottedBacking.5'] = true,
VirgaBaseLineBL = true,
['VirgulaTwo'] = true,
['VirgulaThree'] = true,
['VirgulaFive'] = true,
['VirgulaSix'] = true,
['DivisioMinimaTwo'] = true,
['DivisioMinimaThree'] = true,
['DivisioMinimaFive'] = true,
['DivisioMinimaSix'] = true,
['DivisioMinorTwo'] = true,
['DivisioMinorThree'] = true,
['DivisioMinorFive'] = true,
['DivisioMaiorTwo'] = true,
['DivisioMaiorThree'] = true,
['DivisioMaiorFive'] = true,
['DivisioMaiorDottedTwo'] = true,
['DivisioMaiorDottedThree'] = true,
['DivisioMaiorDottedFive'] = true,
['DivisioMaiorDottedBackingTwo'] = true,
['DivisioMaiorDottedBackingThree'] = true,
['DivisioMaiorDottedBackingFive'] = true,
}

-- &&& in the following two tables is a placeholder for the cavum shape 'r'
Expand Down Expand Up @@ -183,11 +183,11 @@ local GABC = {
DescendensPunctumInclinatum = [[G&&&0]],
DivisioDominican = [[,3]],
DivisioDominicanAlt = [[,4]],
DivisioMaior = [[:]],
DivisioMaiorDotted = [[:?]],
DivisioMaiorDottedBacking = [[\excluded{:?}]],
DivisioMinima = [[,]],
DivisioMinor = [[;]],
DivisioMaiorFour = [[:]],
DivisioMaiorDottedFour = [[:?]],
DivisioMaiorDottedBackingFour = [[\excluded{:?}]],
DivisioMinimaFour = [[,]],
DivisioMinorFour = [[;]],
FClefChange = [[f3]],
FClef = [[f3]],
Flat = [[gx]],
Expand Down Expand Up @@ -266,7 +266,7 @@ local GABC = {
VirgaReversa = [[g&&&V]],
VirgaReversaLongqueue = [[h&&&V]],
VirgaReversaOpenqueue = [[a&&&V]],
Virgula = [[^^^^0060]],
VirgulaFour = [[^^^^0060]],
}

local GABC_AMBITUS_ONE = {
Expand Down Expand Up @@ -532,15 +532,21 @@ function GregorioRef.emit_score_glyphs(cs_normal, cs_hollow)
local first = true
local i, name
for i, name in ipairs(glyph_names) do
if not EXCLUDE[name[2]] then
if (name[3] == '' and name[5] == '') or name[3] == '' or only_twos:match(name[3])
or (GABC_AMBITUS_ONE[name[2]] and ambitus_one:match(name[3])) then
local shape = name[2]
local ambitus = name[3]
if shape:match('^Virgula') or shape:match('^Divisio') then
shape = shape..ambitus
ambitus = ''
end
if not EXCLUDE[shape] then
if (ambitus == '' and name[5] == '') or ambitus == '' or only_twos:match(ambitus)
or (GABC_AMBITUS_ONE[shape] and ambitus_one:match(ambitus)) then
if first then
first = false
else
tex.print([[\hline]])
end
emit_score_glyph(name[1], name[2], name[3], name[4], name[5])
emit_score_glyph(name[1], shape, ambitus, name[4], name[5])
end
end
end
Expand Down
Loading

0 comments on commit 83f2a79

Please sign in to comment.