Changing default colour does not affect text

• Mar 14, 2018 - 02:58
Reported version
2.1
Type
Functional
Severity
3
Status
active
Project

MuseScore has a hidden option to change the default colour of score elements. The option is not available in the Preferences, but is available by editing the INI configuration file (PLIST file on Mac).

The INI option is:

defaultColor=#ff000000

Changing the hex value affects the colour of lines and musical symbols in the score, but text is not affected.

The reason is as follows:

  • If no custom colour has been set for a particular score element, non-text score elements use the default colour
  • However, text element default to using the colour of the relevant Text Style
  • Black is hardcoded in the constructor of TextStyle and TextStyleData

Comments

This has been 'fixed' in MuseScore 3 by abandoning text styles, so now text behaves like all other elements.

Unfortunately there is a complication which means this is non-trivial to fix in 2.x.

  • Firstly, MScore::init() sets the default colour to black and creates the base style (including text styles).

  • Later, Preferences::read() parses the INI file and sets to default colour to the user's personal setting, but it's too late for text since the text styles were already created in MScore::init() when black was the default colour.

We can't swap the order so that Preferences::read() happens before MScore::init(), otherwise MScore::init() will simply overwrite all preferences (including colour) with default values.

We would have to do something like MScore::initOne(), Preferences::read(), MScore::initTwo(), but that's probably more trouble than it's worth, especially since this is a "secret option" and it's already fixed in MuseScore 3.

To change default colour to white in MuseScore 3 nightlies, add this to the INI file under [ui]:

score\defaultColor=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0)

To change it to red, use:

score\defaultColor=@Variant(\0\0\0\x43\x1\xff\xff\xff\xff\0\0\0\0\0\0)

To make it black again simply delete that line from the file.