incorrect fonts used when system Qt version is 5.13 or higher

• Oct 8, 2019 - 14:14
Reported version
3.x-dev
Type
Graphical (UI)
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
won't fix
Regression
Yes
Workaround
Yes
Project

When running the latest stable or dev version of MuseScore on a Linux system featuring Qt version 5.13 or higher, fonts in MuseScore are not displayed correctly. I have verified this happens in both Manjaro (presumably also Arch) and KDE neon, which currently use Qt 5.13.0 and 5.13.1 respectively.

Here is what MuseScore looks like using Qt 5.12.3:
MuseScore_fonts_Qt_4.12.3.png

Here it is using Qt 5.13.1:
MuseScore_fonts_Qt_4.13.1.png

You can see the FreeSerif font is not being used, despite it being selected in style preferences. This does not affect the AppImage version of MuseScore, but does affect versions from the system repository (or Ubuntu/neon PPA) and compiled from source, including the latest git.


Comments

Is it only FreeSerif that is affected? I wonder if somehow that font specifically has an issue? Or the problem has to do with the font selection process somehow.

I just tested trying to use other fonts for text, and no font I select seems to work, always appearing as it does in the second screenshot above.

Workaround No Yes

I discovered a workaround for this issue that involves installing Qt version 5.12 and telling MuseScore to use this instead of the system Qt version. Using the MuseScore AppImage also gets around the problem, but then I am bothered by slow mouse wheel scrolling due to the AppImage being built with Qt 5.9. If you are not bothered by this issue, then using the AppImage is certainly the easier workaround.

If, like me, you prefer to use MuseScore from repository/PPA or compile from source, here is how to fix the fonts:

  1. Download Qt:
    1. Go to this page: https://www.qt.io/download
    2. Scroll down, and under "Downloads for open source users", click on the green "Go open source" button.
    3. On the next page, scroll to the bottom, and under "Looking for Qt binaries?", click the green "Download the Qt Online Installer" button, and then on the following page, click the green "Download" button and save the installer (it should be called something like "qt-unified-linux-x64-3.1.1-online.run").
  2. Run the Qt installer you just downloaded (you might need to make it executable first). Click "next" and skip Qt account creation. Make a note of the Qt install directory; you will need this later. By default it will install to "home/username/Qt".
  3. On the next screen, expand the entry for "Qt 5.12.5" and tick the boxes for "Desktop gcc 64-bit" (or 32-bit if you are running such a system) and "Qt WebEngine".
  4. Click through the remaining dialogs to complete the install.
  5. Launch MuseScore using the following command, customizing the path in LD_LIBRARY_PATH based on your install location and Qt version:

LD_LIBRARY_PATH="/home/username/Qt/5.12.5/gcc_64/lib/" mscore3

If this works, you can modify your MuseScore launcher according to your desktop environment's instructions. Plasma 5 users can simply right-click the K menu and choose "Edit Applications...". If your launcher command is:

mscore3 %F

...simply prefix this with the LD_LIBRARY_PATH variable like so:

LD_LIBRARY_PATH="/home/username/Qt/5.12.5/gcc_64/lib/" mscore3 %F

In reply to by Marc Sabatella

I think I have a related problem. I'm opening a v2 file in v3.2.3.7635. I then try to change text font from Muse jazz to Emmentaler, to no effect. Even though the score style shows Emmentaler and Emmentaler Text, text continues to display in Muse jazz. Even text added after changing the style setting continues to display in Muse jazz. I saved the file as .mscx, manually changed all the fontface nodes to Emmentaler Text and reopened the file. Now the text is all in sans-serif.
[this on windows 10 and QT 5.12.2]

No, that's not related - this issue is specifically about Qt 5.13, which we do not currently support. Probably your text has custom formatting applied via the text toolbar that you need to remove first. Impossible to do more than guess without the score, though. Best to ask for help on the Support forum and attach the score so we can understand and assist better.

Regression Yes No
Workaround Yes No

I think this is a general problem in Qt 5.13. I have written a Qt application in Qt 4 and ported it to different Qt versions over the years. Compiled with Qt 5.12 it does not display the correct font. Same source compiled with Qt 5.12 and is working.

I cannot currently test this for 3.6, as the latest MuseScore version available in DEB format for Ubuntu is still 3.2.3. As mentioned in the OP, this bug does not affect the AppImage version, as that version does not use system Qt libraries.