Browse Source

Wrap long text in Lilypond subtext with automatic linebreaks.

master
Nils 1 year ago
parent
commit
fad8b981f1
  1. 2
      CHANGELOG
  2. 4
      engine/lilypond.py
  3. 8
      engine/resources/lilypondTemplates/default.ly

2
CHANGELOG

@ -8,7 +8,7 @@ External contributors notice at the end of the line: (LastName, FirstName / nick
## 2022-10-15 2.2.2
Empty blocks with explicit minimum tick duration will not be deleted anymore by "Delete All Empty Blocks" command.
Add option to use current block duration when entering a minimum duration in block properties GUI
Wrap long text in Lilypond subtext with automatic linebreaks.
## 2022-08-15 2.2.1
"Flip the page" earlier during live playback, showing the last measure (or so) twice

4
engine/lilypond.py

@ -84,6 +84,7 @@ def lilyfy(string):
if string.startswith("\\markup"):
return string #trust the user
string = string.replace('\\n', '\n') #replace the user newline with actual one
string = string.replace('"', '\\"')
return string
@ -132,7 +133,8 @@ def fromTemplate(session, data, meta, tempoStaff):
templateString = templateString.replace("%$$GLOBAL-STAFF-SIZE$$", str(meta["global-staff-size"]))
templateString = templateString.replace("%$$FILENAME$$", session.sessionPrefix)
templateString = templateString.replace("%$$HEADER$$", processMeta(meta))
templateString = templateString.replace("%$$SUBTEXT$$", '"' + lilyfy(meta["subtext"]) + '"')
#templateString = templateString.replace("%$$SUBTEXT$$", '"' + lilyfy(meta["subtext"]) + '"')
templateString = templateString.replace("%$$SUBTEXT$$", lilyfy(meta["subtext"]) )
voicesString, structureString = processData(data)
templateString = templateString.replace("%$$VOICES$$", voicesString)
templateString = templateString.replace("%$$STRUCTURE$$", structureString)

8
engine/resources/lilypondTemplates/default.ly

@ -107,8 +107,12 @@ tempoStaff = { %$$TEMPOSTAFF$$ }
>>}
\markup{
%\column {
\vspace #2
\column {
\wordwrap {
%$$SUBTEXT$$
%}
}
}
}

Loading…
Cancel
Save