SMuFL fonts
Most music notation software applications use music fonts for rendering music symbols or parts of music symbols. These may include clefs, note heads, time signatures or articulation signs. However, these fonts often have incompatible code points – the internal location within the font that points to a symbol. They are most of the time developed with no common agreement on which code point represents which character. The code point for the G clef symbol in one font may be the code point used for a quarter rest in another, or may be simply undefined. Furthermore, they usually have their own metric and positioning system for specifying what the size of the glyph is and where its baseline is. Because of this, music fonts are difficult to use interchangeably.
To address this, the Standard Music Font Layout (SMuFL) specification has been developed to attempt to harmonize code points across music fonts by specifying code points and symbol sizes for music fonts. SMuFL gives users the ability to reference specific Unicode code points with the understanding that it would represent the same, or similar, symbol across fonts. This presents new opportunities for exploring visual representations of music within a music encoding system without necessarily tying them to a particular font. While previous music encoding systems could not reference font code points without becoming tied to that font for representation, the introduction of SMuFL to music encoding can provide a reference to a particular graphical symbol that should be used to render a given encoding.
Verovio follows the SMuFL specification. It means that it is possible to easily change the music font used in Verovio for personalised output. Verovio includes the Leipzig font, its own SMuFL-compliant music font. Leipzig was initially developed by Etienne Darbellay and Jean-François Marti as part of the Wolfgang music notation software. It is SMuFL compliant since version 5.0 and distributed under the SIL Open Font License.
Verovio also supports and includes the Bravura font designed by Daniel Spreadbury, and the Gootville and Leland fonts designed by the MuseScore community.
Fonts included can be selected by setting the --font
option. For example, the Bravura font can be selected with the --font Bravura
option on the command-line tool or by adding { font: "Bravura" }
in the JavaScript toolkit options.
Examples
Leipzig
Bravura
Gootville
Leland
Leipzig
Bravura
Music symbols in text
For cases when music symbols are displayed within text, Verovio uses a text WOFF2 version of the selected music font. The font is included in the SVG as CSS.
The --smufl-text-font
allows to change how the font is included. By default, it is simply embedded as a base64 string. This means that the SVG is fully self-contained and does not require network access for the font glyphs to be displayed. The include of the font can also be ignored with none
, which can be useful when the font is included seperately in the environment.
With linked
, the text font will be included in the SVG but with the following CSS import:
<style type="text/css">
@import url("https://www.verovio.org/javascript/3.13.0/data/Leipzig.css");
</style>
The version of the font path is based on the Verovio version release number, or is develop
for the develop version of the toolkit.
When a music glyph is displayed within text and the music font selected is not Leipzig or Bravura, Verovio will also check if the music glyph exists in the selected music font. If not, it will fallback to the Leipzig font. If other text elements include music glyphs that do exist in the selected font, then both Leipzig and the selected font will be included. In other words, the fallback to Leipzig will be enabled only for the text elements displaying a missing music glyphs but not for the others.
Examples
<verse n="1">
<syl con="b">a</syl>
<syl con="b">b</syl>
<syl>c</syl>
</verse>
<tempo midi.bpm="70" staff="1" tstamp="1.000000">Andante con moto <rend fontfam="smufl"></rend> = 70</tempo>
Characters in tempo indications can be encoded as Unicode characters or as entities (e.g., 
). See the section on MEI in Output formats for more information on how to control them.
Dynamics
For dynamics, Verovio automatically detects dynamic symbols within text and displays them appropriately. In some cases, it might be desirable to disable the automatic detection of dynamic symbols and the use of the music font. This can be achieved by setting a text font explicitly, as illustrated with the <rend fontfam="Times">
in the second dynamic in this example:
<dynam staff="1" tstamp="1.000000">ff e senza sordini ma non sfz</dynam>
<dynam staff="1" tstamp="2.000000">
<rend fontfam="Times">sempre pp e senza sordini</rend>
</dynam>
<dynam staff="1" tstamp="3.000000">sempre fff rfz e poi<lb/>poco <rend fontstyle="normal" fontweight="bold">a</rend> poco crescendo ma non ffff<lb/>troppo</dynam>