Add music symbol font for OMR

• Aug 2, 2018 - 20:42
Reported version
3.0
Type
Functional
Severity
S5 - Suggestion
Status
active
Project

Hello,
I'm a PhD student working on OMR and I started using MuseScore with the IMETA branch in order to generate bounding box and class annotation in order to train a music object detector.
In the process of generating annotation, I would like to vary the music symbol font used in MuseScore to create more variation in my training data.
From what I have understood, MuseScore doesn't include the ability to install new music font because it would break portability of the MuseScore file.
However, portability is not a concern in my use case.

I tried to add a SMuFL compliant font Ekmelos: http://www.ekmelic-music.org/en/extra/ekmelos.htm in the fonts directory (MuseScore/fonts) of MuseScore, but that didn't work.
I would like to ask what would be the method to add a music symbol font to musescore, either what files I need to add, or which portion of code I need to modify.
I've started to get a little bit familiar with the c++ code while investigating the generation of annotations with the imeta branch, so I think I will be able to figure out how to do it on my own only with a little bit of advice.

Thanks again for your help


Comments

Here is a quick and dirty method I found to add music symbol font to musescore:
in file libmscore/sym.cpp, line 36, you have this QVector ScoreFont::_scoreFonts:

QVector ScoreFont::_scoreFonts {
      ScoreFont("Bravura",    "Bravura",     ":/fonts/bravura/",   "Bravura.otf"  ),
      ScoreFont("Emmentaler", "MScore",      ":/fonts/mscore/",    "mscore.ttf"   ),
      ScoreFont("Gonville",   "Gootville",   ":/fonts/gootville/", "Gootville.otf" ),
      ScoreFont("MuseJazz",   "MuseJazz",     ":/fonts/musejazz/", "MuseJazz.otf" ),
      ScoreFont("JazzyBasic",   "JazzyBasic",     "/home/kyc/prog/MuseScore/fonts/JazzyBasic/", "JazzyBasic.otf" ),
      */
      };

You can just add any font by adding the absolute path to your font and it will appear in the format -> general style -> Musical symbols font menu.

So, from what I have understood, MuseScore can use any SMuFL compliant music font, right?
In my quest to add more music fonts, I've come across fonts like Leipzig 1803: https://www.fontshop.com/families/leipzig-1803 which is part of a family of font called urtext font.
If I understood correctly, urtext edition of music scores attempt to exactly reproduce the original score.
I would like to know if MuseScore has the ability to use such fonts?
The use of urtext fonts would be very precious for OMR, as we would be able to produce synthetic data, which would be very close to graphically from historical music scores.

As a quick hack, your method of appending to _scoreFonts should work. Make sure that metadata.json is in the same path.

In theory, MuseScore should be able to use any SMuFL font, but SMuFL is a flexible standard. FWIU, a SMuFL font could contain only the glyphs for a very specific domain but for example no noteheads, or fermatas, while MuseScore will rely on the availability of noteheads or fermatas. If they are not present in the font, MuseScore will fallback to Bravura.