Skip to content

Commit

Permalink
Merge commit 'c400a14e2e1357747b9d2ab97408346d2861317e' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rpspringuel committed Oct 10, 2023
2 parents 1de1080 + c400a14 commit 170b351
Show file tree
Hide file tree
Showing 24 changed files with 513 additions and 261 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ indent_size = 2
charset = utf-8
trim_trailing_whitespace = true

[*.{py,c,h}]
[*.{py,c,h,l,y}]
indent_size = 4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,4 @@ ctan
*.pyg
.agignore
*.orig
compile_commands.json
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ All notable changes to this project will be documented in this file.
As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/). It follows [some conventions](http://keepachangelog.com/).

## [Unreleased][develop]
### Fixed
- Fixed the interaction between hyphens and styles. See [#1538](https://github.com/gregorio-project/gregorio/issues/1538).
- Fixed the loss of ongoing styles when a syllable starts with a forced center. See [#1551](https://github.com/gregorio-project/gregorio/issues/1551).

### Added
- Added a configurable setting `\gresetunisonbreakbehavior` to control automatic line breaks between unison notes above a syllable. Defaults to `breakable` for backwards compatibility, but may be set to `unbreakable` if that behavior is desired. See [#1504](https://github.com/gregorio-project/gregorio/issues/1504).
- Added the ability to fuse upwards to a virga. See [#1558](https://github.com/gregorio-project/gregorio/issues/1558)
- Added the ability to use the "stroke" form of a clivis instead of the default two-notes form by specifying `[shape:stroke]` after the clivis to change. See [#1558](https://github.com/gregorio-project/gregorio/issues/1558)

## [Unreleased][CTAN]

Expand Down
13 changes: 13 additions & 0 deletions doc/Command_Index_User.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,19 @@ \subsubsection{End of Line Behavior}
lines. Defaults to \getgrecount{unbreakablefinalnotes}.\\
\end{argtable}

\macroname{\textbackslash gresetunisonbreakbehavior}{\{\#1\}}{gregoriotex-main.tex}
Macro to determine whether an automatic linebreak may occur between unison notes
over a syllable. This behavior governs how the system works when no explicit
space is put between the notes. In other words, any explicit space between the
notes take precedence over this setting.

\begin{argtable}
\#1 & \texttt{breakable} & Allow automatic linebreaks between unison notes
(default)\\
& \texttt{unbreakable} & Disallow automatic linebreaks between unison
notes\\
\end{argtable}


\subsubsection{Bar spacing}

Expand Down
2 changes: 2 additions & 0 deletions doc/Command_Index_gregorio.tex
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ \section{Gregorio Controls}
& \texttt{4} & Ad-hoc space.\\
\#2 & \texttt{0} & Space is breakable.\\
& \texttt{1} & Space is unbreakable.\\
& \texttt{2} & Space is breakable according to the \verb=\setunisonbreakbehavior= setting.\\
\#3 & integer & The number of notes in the syllable prior to this macro.\\
\end{argtable}

Expand Down Expand Up @@ -444,6 +445,7 @@ \section{Gregorio Controls}
& \texttt{20} & Space between a punctum inclinatum and a ``no-bar'' glyph two pitches above. \\
& \texttt{21} & Space between a punctum inclinatum and a ``no-bar'' glyph three or four pitches above \\
& \texttt{22} & Half-space. \\
& \texttt{23} & Space between unison puncta inclinata. \\
\end{argtable}

\macroname{\textbackslash GreFinalCustos}{\#1\#2}{gregoriotex-signs.tex}
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 @@ -1961,6 +1961,10 @@ \subsection{Flags}
\macroname{\textbackslash ifgre@unbreakableendofelement}{}{gregoriotex-main.tex}
Boolean used by \verb=\GreEndOfElement= to store whether the line may be broken at that point.
\macroname{\textbackslash gre@unbreakableendofelement@unison}{}{gregoriotex-main.tex}
Alias that sets \verb=\ifgre@unbreakableendofelement= according to the
\verb=\setunisonbreakbehavior= preference.
\macroname{\textbackslash gre@count@syllablenotes}{}{gregoriotex-syllable.tex}
Count containing the number of notes in the syllable.
Expand Down
18 changes: 16 additions & 2 deletions doc/Gabc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ \subsection{File Structure}
mode-modifier: t.;
annotation: IN.;
annotation: 6;

%%

(clef) text(notes)
% another comment
com(notes)plex(notes) word(notes)
Expand Down Expand Up @@ -579,6 +579,7 @@ \subsubsection{Neume Fusion}
\texttt{gf} & flexus & if not at the end, must be followed by a higher note to fuse \\
\texttt{gh} & pes & at the end only; in non-liquescent form, the previous note must be lower to fuse \\
\texttt{gfg} & porrectus & at the end only, previous note must be lower to fuse \\
\texttt{gv} & virga & at the end only, previous note must be lower to fuse \\
\end{tabularx}

In the above table, \texttt{f}, \texttt{g}, and \texttt{h} are representative
Expand Down Expand Up @@ -646,6 +647,19 @@ \subsubsection{Neume Spacing}\label{neumespacing}
space, makes the space that follows a non-breaking space \\
\end{tabularx}

\subsubsection{Shape Hints}

In some cases, an alternate form of a shape is desired. To do this, put a
\texttt{[shape:}\textit{hint}\texttt{]} after the figure that needs to be
altered. The available alternate form hints are as follows:

\begin{tabularx}{\textwidth}{l|X}
\textit{hint} & Description \\
\hline
\texttt{stroke} & Render a clivis/flexus as a stroke (like in a porrectus)
rather than as two notes \\
\end{tabularx}

\subsubsection{Additional Symbols}

Puncta mora, episemata, and other symbols may also be added to a note by
Expand Down
5 changes: 4 additions & 1 deletion doc/GregorioRef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ local function sort_unique_keys(tables, compare)
end
end
return sort_keys(set)
end
end

local EXCLUDE = {
['.notdef'] = true,
Expand Down Expand Up @@ -326,6 +326,9 @@ local GABC_FUSE = {
Flexus = [[\excluded{e}@]],
FlexusOriscus = [[\excluded{e}@]],
FlexusOriscusInusitatus = [[\excluded{e}@]],
Virga = [[\excluded{e}@]],
VirgaLongqueue = [[\excluded{f}@]],
VirgaOpenqueue = { [[\excluded{a}@]], [[cv]] },
},
Lower = {
Punctum = [[\excluded{i}@]],
Expand Down
8 changes: 7 additions & 1 deletion fonts/squarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,9 @@ def get_width(glyphName):
S_VIRGA = 'Virga'
S_VIRGA_LONGQUEUE = 'VirgaLongqueue'
S_VIRGA_OPENQUEUE = 'VirgaOpenqueue'
S_UPPER_VIRGA = 'UpperVirga'
S_UPPER_VIRGA_LONGQUEUE = 'UpperVirgaLongqueue'
S_UPPER_VIRGA_OPENQUEUE = 'UpperVirgaOpenqueue'
S_VIRGA_REVERSA = 'VirgaReversa'
S_VIRGA_REVERSA_LONGQUEUE = 'VirgaReversaLongqueue'
S_VIRGA_REVERSA_OPENQUEUE = 'VirgaReversaOpenqueue'
Expand Down Expand Up @@ -813,7 +816,7 @@ def set_width(width):
"Set the width of a glyph"
global newfont, glyphnumber
if glyphnumber in newfont:
newfont[glyphnumber].width = width
newfont[glyphnumber].width = int(width)

def get_queue_glyph(height, rev = False):
"Creates the asked line glyph in tmpglyph"
Expand Down Expand Up @@ -1009,6 +1012,9 @@ def virga():
write_virga(S_VIRGA, L_NOTHING, True, 'virgabase', 'short', S_VIRGA)
write_virga(S_VIRGA_LONGQUEUE, L_NOTHING, True, 'virgabase', 'long', S_VIRGA)
write_virga(S_VIRGA_OPENQUEUE, L_NOTHING, True, 'virgabase', 'open', S_VIRGA)
write_virga(S_UPPER_VIRGA, L_NOTHING, True, 'VirgaBaseLineBL', 'short', S_VIRGA)
write_virga(S_UPPER_VIRGA_LONGQUEUE, L_NOTHING, True, 'VirgaBaseLineBL', 'long', S_VIRGA)
write_virga(S_UPPER_VIRGA_OPENQUEUE, L_NOTHING, True, 'VirgaBaseLineBL', 'open', S_VIRGA)
write_virga(S_VIRGA_REVERSA, L_NOTHING, False, 'rvirgabase', 'short',
S_VIRGA_REVERSA)
write_virga(S_VIRGA_REVERSA_LONGQUEUE, L_NOTHING, False, 'rvirgabase',
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ LDADD += gregorio-resources.o
endif

gabc/gabc-score-determination-y.c: gabc/gabc-score-determination.y
$(YACC) -v -d -p "gabc_score_determination_" -o $@ $<
$(YACC) -Wno-yacc -v -d -p "gabc_score_determination_" -o $@ $<
gabc/gabc-score-determination-y.h: gabc/gabc-score-determination-y.c
## Recover from the removal of gabc/gabc-score-determination-y.h, see
## https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html
Expand Down
70 changes: 35 additions & 35 deletions src/characters.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ static void free_styles(det_style **first_style)


/*
* inline function that will be used for verbatim and special-characters in the
*
* inline function that will be used for verbatim and special-characters in the
*
* next function, it calls function with a grewchar * which is the verbatim or
* special-character. It places current_character to the character next to the
* end of the verbatim or special_char charachters.
Expand Down Expand Up @@ -376,7 +376,7 @@ static __inline void verb_or_sp(const gregorio_character **ptr_character,
* does not test at all the gregorio_character list, if it is wrong, then the
* ouput will be wrong. It is very simple to understand, even if it is a bit
* long.
*
*
* @warning The difficulty comes when we have to write the first syllable text,
* without the first letter.
* The behaviour can have some bugs in this case if the first syllable has some
Expand Down Expand Up @@ -586,53 +586,53 @@ void gregorio_write_first_letter_alignment_text(

/*
* Here starts the code of the handling of text and styles.
*
* This part is not the easiest, in fact is is the most complicated. The reason
*
* This part is not the easiest, in fact is is the most complicated. The reason
* is that I want to make something coherent in memory (easy to interprete),
* and to let the user type whatever he wants. This part was originally written
* and to let the user type whatever he wants. This part was originally written
* for gabc, that's why it's always talking about it. But it could as well be
* used by other read plugins, to put things in order.
*
*
* Basically all the following lines of code are made for the last function,
* that will take a "user-written" gregorio_character list into a xml-compliant
* that will take a "user-written" gregorio_character list into a xml-compliant
* and tex-compliant list. It's more complicated than it seems...
*
*
* Functionalities: For example if the user types tt<i>ttt<b>ttt</i>tt I want
* it to be represented as tt<i>ttt<b>ttt</b></i><b>tt</b>. The fabulous thing
* is that it is xml-compliant. This part also determines the middle, for
* example pot will be interpreted as p{o}t. When I did that I also thought
* about TeX styles that needed things like {p}{o}{t}, so when the user types
* <i>pot</i>, it is interpreted as <i>p</i>{<i>o</i>}<i>t</i>.
*
*
* Internal structure: To do so we have a structure, det_style, that will help
* us : it is a stack (double chained list) of the styles that we have seen
* until now. When we encounter a <i>, we push the i style on the stack. If we
* encounter a </i> we suppress the i style from the stack. Let's take a more
* complex example: if we encounter <i><b></i>, the stack will be first null,
* then i then bi, and there we want to end i, but it is not the first style of
* then i then bi, and there we want to end i, but it is not the first style of
* the stack, so we close all the styles that we encounter before we encounter
* i (remember, this is for xml-compliance), so we insert a </b> before the
* </i>. But that's not all, we also write a <b> after the </i>, so that the b
* style continues. There our stack is just b. For center, we just close all
* the styles in the stack, insert a { and reopen all the styles in the stack.
*
*
* The structure used for character, styles, etc. is described in
* include/struct.h
*
*
* The functionment in this file is quite simple : we add all the characters
* that we see, even if they are incoherent, in the gregorio_character list,
* and then we call a very complex function that will build a stack of the
* style, determine the middle, make all xml-compliant, mow the lawn, etc.
*
*
* This code is *really* spaghetti, but I think it's a necessary pain.
*
*
*/

/*
*
*
* This function inserts a style before current_character, updating the double
* chained list.
*
*
*/

static void insert_style_before(unsigned char type,
Expand All @@ -652,11 +652,11 @@ static void insert_style_before(unsigned char type,
}

/*
*
*
* This function puts a style after current_character, and updates
* current_character to the gregorio_character it created. It updates the
* double chained list. It does not touche to the det_styles list.
*
*
*/

static void insert_style_after(unsigned char type, unsigned char style,
Expand Down Expand Up @@ -695,10 +695,10 @@ static void insert_char_after(grewchar c,
#endif

/*
*
*
* This function suppresses the character, updates the double chained
* list, and returns the character after, if there is one.
*
*
*/

static __inline gregorio_character *suppress_character(
Expand All @@ -721,12 +721,12 @@ static __inline gregorio_character *suppress_character(
}

/*
*
*
* Then start the inline functions for the big function. the first one is the
* function we call when we close a style. The magic thing is that is will
* prevent things like a<i></i>{<i>b</b>: when the user types a<i>b</i>, if the
* middle is between a and b (...), it will interpret it as a{<i>b</i>.
*
*
*/

static __inline void close_style(gregorio_character *current_character,
Expand Down Expand Up @@ -755,10 +755,10 @@ static __inline void close_style(gregorio_character *current_character,
}

/*
*
*
* next the function called when we have determined that we must end the center
* here : it closes all styles, adds a } and then reopens all styles.
*
*
*/

/* type is ST_CENTER or ST_FORCED_CENTER */
Expand Down Expand Up @@ -791,7 +791,7 @@ static __inline void end_center(grestyle_style type,
}

/*
* about the same, but adding a {
* about the same, but adding a {
*/

static __inline void begin_center(grestyle_style type,
Expand Down Expand Up @@ -825,16 +825,16 @@ static __inline void begin_center(grestyle_style type,
/*
* THE big function. Very long, using a lot of long macros, etc. I hope you
* really want to understand it, 'cause it won't be easy.
*
*
* current character is a pointer to a gregorio_character. The
* gregorio_character double-chained list it is in will be totally reorganized
* so that it is xml compliant, and the function will update it to the first
* character of this brand new list.
*
*
* center_is_determined has the values present in characters.h.
*
*
* Another difficulty is the fact that we must consider characters in verbatim
* and special character styles like only one block, we can't say the center is
* and special character styles like only one block, we can't say the center is
* in the middle of a verbatim block.
*/

Expand All @@ -847,7 +847,7 @@ void gregorio_rebuild_characters(gregorio_character **const param_character,
det_style *first_style = NULL;
/* determining the type of centering (forced or not) */
grestyle_style center_type = ST_NO_STYLE;
int start = -1, end = -1, index = -1;
int start = -1, end = -1, index = -1;
bool in_elision = false;
det_style *current_style;
/* so, here we start: we go to the first_character */
Expand All @@ -869,7 +869,7 @@ void gregorio_rebuild_characters(gregorio_character **const param_character,
}
}
/* first we see if there is already a center determined */
if (center_is_determined == 0) {
if (center_is_determined == CENTER_NOT_DETERMINED) {
center_type = ST_CENTER;
determine_center(current_character, &start, &end);
} else {
Expand Down Expand Up @@ -1118,9 +1118,9 @@ void gregorio_rebuild_characters(gregorio_character **const param_character,
}

/**
* @brief This function will determine the behaviour of gregorio when it comes to the recognition of the initial.
*
* Basically it will take a gregorio_character list and return the same list, but with a style added : ST_INITIAL. This style will incidate the initial. The center will be placed at the second letter, unless there is a FORCED_CENTER somewhere.
* @brief This function will determine the behaviour of gregorio when it comes to the recognition of the initial.
*
* Basically it will take a gregorio_character list and return the same list, but with a style added : ST_INITIAL. This style will incidate the initial. The center will be placed at the second letter, unless there is a FORCED_CENTER somewhere.
* Finally all will be xml-compliant and tex-compliant when we call gregorio_rebuild_characters.
*
* If we note <> for the initial and {} for the center, here is what we want:
Expand Down
Loading

0 comments on commit 170b351

Please sign in to comment.