MasterScore* gscore variable declared in score.cpp

• Dec 5, 2018 - 16:58

This variable is declared here, in score.cpp:
https://github.com/musescore/MuseScore/blob/79b2d80aadceeb47dce4435b681…
It is initialized here, in musescore.cpp:
https://github.com/musescore/MuseScore/blob/79b2d80aadceeb47dce4435b681…
It is referenced as an external variable in score.h:
https://github.com/musescore/MuseScore/blob/79b2d80aadceeb47dce4435b681…

Please excuse my rusty C++, but I was initially confused/surprised this global variable was declared in a .cpp file, and specifically score.cpp, which is primarily home to class Score. Can someone please explain the rationale for this structure? I'm not trying change this, I just want to understand it as part of chipping away at the rust. Thanks.


Comments

On a related note: look at the code 5 lines below the second link above, in musescore.cpp. gscore has its fonts set to Bravura. On the other hand, in the 1st class Score constructor, the font is hardcoded to "emmentaler":
https://github.com/musescore/MuseScore/blob/79b2d80aadceeb47dce4435b681…

It seems that Emmentaler is the default font set everywhere but the gscore variable, which seems to cache "base" default style settings. Why does gscore use Bravura?

gscore->scoreFont() is used here, in bagpembell.cpp:
https://github.com/musescore/MuseScore/blob/79b2d80aadceeb47dce4435b681…
here in textpalette.cpp:
https://github.com/musescore/MuseScore/blob/79b2d80aadceeb47dce4435b681…
https://github.com/musescore/MuseScore/blob/79b2d80aadceeb47dce4435b681…
and here in timesigproperties.cpp:
https://github.com/musescore/MuseScore/blob/79b2d80aadceeb47dce4435b681…

In reply to by sideways

Is there a listing of the glyphs missing from Emmentaler and Gootville? I know I can open the font files and fish around, but it would be great if someone has captured that already. Bagpipe embellishments are clearly Bravura-only at this time.

This Bravura sub-topic is a tangent from the original question, but I'm realizing that it's something I've never tested in the SVG exports, palette elements that use an alternate font. That's why I'm asking all the questions before I test it.

In reply to by Jojo-Schmitz

fyi - I believe the fallbacks for the Text fonts are handled in sym.cpp here:
https://github.com/musescore/MuseScore/blob/39501b5adf082f05c1ea042de0f…
and here:
https://github.com/musescore/MuseScore/blob/39501b5adf082f05c1ea042de0f…

I don't see a similar fallback mechanism for the Symbol fonts, but I do see places like bagpipes that use gscore to get to the Bravura font for their symbols. Different mechanics, same result.

Do you still have an unanswered question? Please log in first to post your question.