[Windows] underline too close to (lyrics) letters
Reported version
3.0
Priority
P1 - High
Type
Functional
Frequency
Few
Severity
S3 - Major
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
No
Project
Version 2.3.2 and current 3.0 dev.
1) Upload this file: AZ selection.mscz
(or complete version): AZ_CHTE_SE_PODMLADIA piano MP.mscz
2) Double-click a syllable, and in Text toolbar: click on the Underline symbol
-
Expected:
-
Actual and unexpected result: the underline almost clashes with the words base.
Comments
After checking, this issue occurs end 2017.
Works on November 23, and gives this bad result on December 8.
Seems to be an undesired result of: https://github.com/musescore/MuseScore/pull/3298
I guess https://musescore.com/groups/improving-musescore-com/discuss/5024732 is about the same issue
This is the same problem we are having. What can be done about the unexpected display of the underline feature. We depend on it for our use. Are we stuck using an old version of Musescore?
Kenneth
Underline works, it just gets rendered (slightly) different (closer to the letters), I don't see a big issue here. It is an issue since MuseScore 2.2, you could of course use 2.1 instead to generate your PDFs if you really need those underlines with more distance to the letters.
The question is whether this is Windows only, or also Mac and Linux?
A short test with saving a score online seems to indicate that Linux (which is what musescore.com uses to render scores) doesn't have that issue. So there's another workaround :-)
In reply to Underline works, it just… by Jojo-Schmitz
Am i understanding that it is not possible to fix the problem in a future version of MuseScore?
Kenneth
It should be possible to fix, although I have no idea how
Raised to Major Severity. And even if Normal was possible, I think Major would be adapted.
Because it' really an unexpected and ugly rendering. And not up to it, worthy of a major version release.
What indeed does make this major is the difference in rendering depending on platform.
I strongly suspect it could be a Qt bug.
I asked for help in Qt forum, here: https://forum.qt.io/topic/96900/strange-behavior-of-underline-when-scal…
Attached you can find my test program and the resulting svg under Windows 10, Linux Mint 18 and MacOS 13.
Under the hood, MuseScore is scaling up the text for better resolution (due to the antialiasing behavior under Windows) and then rescaling down the drawn text, but for large text size Qt draws the underline attached to the text base line under Windows: this is exactly what we are seeing here.
At the moment I do not have idea of what work-around we could use, except for re-implementing the drawing of underline (which could possibly be a hard task).
It definitely Qt's fault.
The underline position is calculated inside QPainter, starting form the value taken here:
https://code.woboq.org/qt5/qtbase/src/gui/painting/qpainter.cpp.html#62…
const qreal underlineOffset = fe->underlinePosition().toReal();
now, the QFontEngine
fe
is different among the different Operating Systems and the returned underlinePosition is also different.Under Windows it calls QFontEngine::underlinePosition()
https://code.woboq.org/qt5/qtbase/src/gui/text/qfontengine.cpp.html#_ZN…
which calls lineThickness() from QWindowsFontEngine
https://code.woboq.org/qt5/qtbase/src/platformsupport/fontdatabases/win…
I suspect that this lineThickness does not scale with the pixelsize, therefore resulting in the same underline distance even when the font is upscaled and thus determining basically "no space" for large pixel size (remember that now the fonts are actually upscaled in MuseScore rendering).
Under Linux it calls QFontEngineFT::underlinePosition()
https://code.woboq.org/qt5/qtbase/src/platformsupport/fontdatabases/fre…
which, on the other hand, computes the position for the underline extracting the information from the font itself via FreeType:
https://code.woboq.org/qt5/qtbase/src/platformsupport/fontdatabases/fre…
To cut a long story short, I think I found a workaround by forcing Windows to use the Freetype font rendering engine, similar to what is used under Linux. With the use of FreeType this bug is solved. However, I don't know if there could be side-effects. In principle we are already using FreeType for text rendering under Linux.
To activate freetype we can launch in the command line
Musescore.exe -platform windows:fontengine=freetype
or, alternatively, add to
bin/qt.conf
these lines:[Platforms]
WindowsArguments = fontengine=freetype
I've tried that command line and qt.conf fix and it doesn't work, has bad side effects, all fonts are becoming huge
@Jojo-Schmitz : with 2.3 or current master?
Because the huge font problem is something I already saw under Linux when experimenting with https://github.com/musescore/MuseScore/pull/3298 and applying it also to Linux.
I don't know why it happens, but the texts appears correct when you zoom in. I think it could be a problem of some sort of max font size after which the font rendering engine is different. With https://github.com/musescore/MuseScore/pull/3298 the font size is actually 100 times the size you set, and it is then downscaled by a factor 100 (under Windows).
In master the correction factor is 5 ( https://github.com/musescore/MuseScore/blob/27a6d3a4a2393a51ec273169d3f… ) so I think even large texts should not enter this huge-rendering zone (at least, no one reported it for Linux up to now, I think).
Edit: I forgot to say that I was testing with master branch. Under 2.3 I see the huge text when using FreeType font engine.
Ah, I see, I tested it with 2.3.2, seems to indeed work with master
Confirmed that "Musescore3.exe -platform windows:fontengine=freetype" fixes the issue as well as related #278520: Lyrics: default position of inter-syllable hyphens is too low. No anomalies detected but didn't test it thoroughly.
We could ship with the beta that modified qt.conf
see https://github.com/musescore/MuseScore/pull/4300
Fixed in branch master, commit 3b054902e1
fix #276566: [Windows] underline too close to (lyrics) letters
Fixed in branch master, commit 3e4ea9b832
Merge pull request #4300 from Jojo-Schmitz/windows_underline
fix #276566: [Windows] underline too close to (lyrics) letters
Automatically closed -- issue fixed for 2 weeks with no activity.
I was getting emails on the conversations of you fellows trying to figure out this underline problem. Has a solution been found? If so, i would like to know so we can go to a newer version. Otherwise we are stuck on v 2.1.
Kenneth
This issue is closed, and got closed before 3.0, got released, so it is considered fixed.
Juyt try it out, MuseScore 3 and MuseScore 2 do peacefully coexist on the same computer
In reply to This issue is closed, and… by Jojo-Schmitz
Unfortunately, the fix (i.e. using freetype font engine also under Windows) caused the appearance of another bug: #281601: Musescore 3 FreeSans bold text rendering is bad, present in MuseScore 3.0.x.
It is still not clear how to solve both problems at the same time.
In reply to Unfortunately, the fix (i.e… by ABL
We got version 3 and the underline is fixed. However, there seem to be problems with the plugin manager particularly with shapenotes. I want to try downloading a current version of the shapenotes plugin to see if that will change anything. But currently it is not possible to use the shapenotes plugin.
Kenneth
In reply to Unfortunately, the fix (i.e… by ABL
Sorry, I see what is going on now. Shape notes function is built into the program on version 3. That is a good idea!
Kenneth
And many plugins won't work with MS3 anyway becuase they haven't been ported to MS3 yet.