verovio icon indicating copy to clipboard operation
verovio copied to clipboard

Improve support for SMuFL glyphs within text

Open lpugin opened this issue 2 years ago • 0 comments

Verovio currently supports mixing text and SMuFL glyphs in the following situations:

  • Lyrics for text elisions
  • Tempo indication with notes
  • Dynamics mixing text and dynamic glyphs (e.g., "sempre pp")
  • Directives, for example for repeat signs

In such cases, the VerovioText font is used because we need the SMuFL glyphs to be treated as text in the SVG - and not as SVG shapes like elsewhere in the music rendering. VerovioText is a very small subset of Leipzig which is embedded in the SVG as woff.

There are a number of limitations:

  • Only the Leipzig typeface is supported, and the music font option is ignored. As a result, music fonts can be mixed up when another font than Leipzig is selected, which is not optimal
  • There might be some scaling difference between the original Leipzig and the set included in VerovioText. These are difficult to handle

Proposal

It would be much better to have a woff being a subset for all music fonts supported by Verovio and not only for Leipzig. It would also be much better if these would be generated from the original music fonts and not maintained by hand.

What we would need is

  • A list of glyph we would like to be available to be mixed up with text (elision, dynamics, repeats, notes for tempo and tuplets, etc.)
  • Adjust the script to extract these glyphs from the music fonts and generate a woff for each music font (Leipzig, Bravura, Leland, etc.)
  • Adjust Verovio to select the matching text font (for example, if Bravura is selected, we want to use the corresponding woff file)

Open question

Because the woff file is embedded in the SVG, there is no need to have the font installed on a machine for it to display properly. We would maintain this. In some cases, however, it is necessary to have the font installed (e.g., when converting to PDF or PNG). For this, it is necessary to have the corresponding font available as TrueType (or similar) to be installable. We would need to think about the font name.

VerovioText was a quick naming solution but would not be appropriate any more. Furthermore the resulting fonts would not exactly be a LeipzigText or a BravuraText, because SMuFL text fonts fulfil a different purpose. That means that we probably need to think about another font names, assuming that installing the complete music font would not work - even thought maybe that would work?

(Somehow related to https://github.com/music-encoding/music-encoding/pull/897 and https://github.com/music-encoding/music-encoding/pull/704)

lpugin avatar Feb 16 '22 13:02 lpugin