Open craigsapp opened 5 months ago
Commit https://github.com/rism-digital/verovio/commit/55ec0f8222ec4e95a30a59276c992de2f5bf935d forces text with newline (<lb>
) to be enclosed in a <rend>
. This may be required (although this now seems to be optional in verovio).
However there is a strange behavior in verovio: when converting from Humdrum into verovio directly, the <lb>
is ignored whether the text is enclosed in a <rend>
or not.
When converting Humdrum data into MEI and then loading that MEI data into verovio, the <lb>
is not ignored (whether the text is enclosed in a <rend>
or not.
Example:
**kern
!LO:TX:a:t=Allegro\n[quarter]=120
1c
*-
Direct rendering with verovio:
Transcoded from Humdrum
If the converted MEI is then loaded into verovio, the line break is present as expected in the output SVG:
If a space is added before the [quarter]
symbol in the Humdrum data:
**kern
!LO:TX:a:t=Allegro\n [quarter]=120
1c
*-
The direct conversion from Humdrum to SVG with verovio will add the linebreak:
Transcoded from Humdrum
The converted <tempo>
contents for the first example:
<tempo xml:id="tempo-L3F1" place="above" staff="1" tstamp="1.000000">
<rend xml:id="rgi3w8m">Allegro<lb xml:id="lsqb6fi" />
<symbol xml:id="swk2v3e" glyph.auth="smufl" glyph.name="metNoteQuarterUp" fontsize="70.00%" /> = 120</rend>
</tempo>
And the converted <tempo>
contents for the second example with the added whitespace before the symbol:
<tempo xml:id="tempo-L3F1" place="above" staff="1" tstamp="1.000000">
<rend xml:id="rjuj5r1">Allegro<lb xml:id="lg8e0nj" /> <symbol xml:id="s1royt93" glyph.auth="smufl" glyph.name="metNoteQuarterUp" fontsize="70.00%" /> = 120</rend>
</tempo>
One possible solution is to force a space after a newline when processing Humdrum data, although that will shift the text on the second line slightly to the right.
In this example:
There should be a line break after
mosso
, but the square bracket is preventing the linebreak: