verovio icon indicating copy to clipboard operation
verovio copied to clipboard

Support for new glyphs

Open annakijas1 opened this issue 1 year ago • 3 comments

We would like to request that the following SMuFL glyphs be added so they can be rendered in Verovio:

Medium xylophone stick up, U+E774 xylophone-up

Medium xylophone stick down, U+E775 xylophone-down

Hand, U+E7E3 hand

Snare sticks up, U+E7D1 snaresticks-up

Play, U+EB1C play

Pause, U+EB1E pause

Additional context We are using these for an incipit encoding project and will add them to the MEI files where these graphics are used. For example we might encode them as:

<ornam tstamp="1">
<symbol glyph.auth="smufl" glyph.num="U+E774" glyph.name="pictBeaterMediumXylophoneUp"/>
</ornam>

Screen Shot 2022-07-21 at 2 40 24 PM

annakijas1 avatar Jul 21 '22 18:07 annakijas1

It's somewhat tangential to the issue, but <dir> is probably a better semantic element to use rather than <ornam>. <ornam> is intended for use as a generic note ornament, while <dir> is a performance direction:

<dir tstamp="1">
    <symbol glyph.auth="smufl" glyph.num="U+E774" glyph.name="pictBeaterMediumXylophoneUp"/>
</dir>

ahankinson avatar Jul 22 '22 08:07 ahankinson

We can make this work. Ideally, symbol could refer to any glyphs we currently support in Verovio. However, this is not currently possible.

It is a bit technical, but SMuFL glyphs are included in two ways in Verovio. One is within <g> SVG elements, and one within <text> SVG elements. Glyphs within <g> use SVG <path> – This is the list of glyph currently supported – and this is used for most of the glyphs (note head, stem flags, sharps, etc.). For glyphs within <text>, we have a text font, which currently has only a very small subset of glyph (text elisions, coda, tempo small notes, etc.).

One idea would be not to require this type of glyphs to be added to the text font because this is complicated and not very flexible (see this issue on this matter). However, allowing any glyphs supported means we would need to use SVG <g> and not a <text> when rendering an MEI <dir>. That means the glyphs could not be mixed with text. In other words, something like this would not work even though this is perfectly valid in MEI:

<dir tstamp="1">
    some text
    <symbol glyph.auth="smufl" glyph.num="U+E774" glyph.name="pictBeaterMediumXylophoneUp"/>
   some more text
</dir>

Any thoughts on this limitation? Would this be problematic?

lpugin avatar Jul 23 '22 20:07 lpugin

Thanks for your explanation @lpugin. If we used the SVG <g> instead of <text> when rendering an MEI <dir> and did not mix it with text would that be valid? So if we want to use one of the symbols, like the snare sticks up, above a measure could we do that if it is included in the <g> SVG elements? Would adding these symbols there create any issues?

annakijas1 avatar Aug 10 '22 15:08 annakijas1

If we used the SVG instead of when rendering an MEI <dir> and did not mix it with text would that be valid?

Yes, that would be valid MEI and will be supported by Verovio. This will work:

<dir>
    <symbol glyph.auth="smufl" glyph.num="U+E774" glyph.name="pictBeaterMediumXylophoneUp"/>
</dir>

BTW, specifying @glyph.auth but only @glyph.name or @glyph.num would be enough. If both are specified, the precedence will be given to @glyph.name.

Having more than one symbol is also expected work:

<dir>
    <symbol glyph.auth="smufl" glyph.name="pictBeaterMediumXylophoneUp"/>
    <symbol glyph.auth="smufl" glyph.name="pictBeaterMediumXylophoneDown"/>
</dir>

Having mixed content (text and <symbol>) as in the example posted above is valid MEI, however that would not be supported by Verovio. The same with <rend> and editorial markup within <dir>, which are valid in MEI but that would also not be supported by Verovio:

<dir>
   <rend>
      <symbol glyph.auth="smufl" glyph.name="pictBeaterMediumXylophoneUp"/>
   </rend>
</dir>
<dir>
    <choice>
        <sic>
            <symbol glyph.auth="smufl" glyph.name="pictBeaterMediumXylophoneUp"/>
        </sic>
        <corr>
            <symbol glyph.auth="smufl" glyph.name="pictBeaterMediumXylophoneDown"/>
        </corr>
    </choice>
</dir>

For the second example, you would need to do

<choice>
    <sic>
        <dir>
            <symbol glyph.auth="smufl" glyph.name="pictBeaterMediumXylophoneUp"/>
        </dir>
    </sic>
    <corr>
        <dir>
            <symbol glyph.auth="smufl" glyph.name="pictBeaterMediumXylophoneDown"/>
        </dir>
   </corr>
</choice>

So if we want to use one of the symbols, like the snare sticks up, above a measure could we do that if it is included in the <g> SVG elements? Would adding these symbols there create any issues?

Yes, you will be able to it and it would not create any issues as long as it remains in the limitation above.

lpugin avatar Aug 11 '22 06:08 lpugin

Thank you @lpugin. I'm not clear on one thing - will the glyphs be added to the SVG elements?

annakijas1 avatar Aug 11 '22 19:08 annakijas1