verovio
verovio copied to clipboard
How to choose stylistic alternates in SMuFL
Some SMuFL fonts bring stylistic alternates for some glyphs like the recommended ones in Bravura: https://w3c.github.io/smufl/latest/tables/clefs.html
The problem is, that they share a code point with another glyph and the current method for bounding box calculation and glyph extraction relies on code points alone. Also in SVG fonts they appear at code points outside the SMuFL range.
Question is if there is any possibility to select these glyphs in Verovio with the glyph.num
attribute.
Could we use the alternates
and codepoint
informations from metadata.json
file for font generation?
Never mind, I found it https://w3c.github.io/smufl/latest/specification/glyphswithalternates.html
- I think we would need something similar to https://github.com/rism-digital/verovio/blob/develop/fonts/supported.xsl to list the alternates we support. With this in hand, alternate codepoints glyphs will be extracted as well as their bounding box without major changes to the building scripts.
- We need use the metadata.json to do make the mapping available in Verovio in
Resources::s_smuflNames
- obviously we assume that all fonts use the same mapping, which seems to be the case from what I have seen in fonts but not from the specifications since alternates are recommended. It would add entries like{ "gClefSmall", SMUFL_alt_F472_gClefSmall }
- The alternate could be selected with
@glyph.name="gClefSmall"
(which would be mapped to the alternate codepoint preserved in 2., which we already support)