Vertical alignment of pedal text to line too low
1. Open attached score (produced in 1.3).
Expected result:
Actual result: The vertical alignment of the pedal text is too low to the line.
Using MuseScore 2.0 Nightly Build 28b5daf - Mac 10.7.5.
Comments
I'll look at this, should be simple I think.
Not *quite* so simple.
There is no separate "Pedal" text style - pedal lines use the generic "Text Line" style, which is vertically centered to the line and presumably should stay that way. So there is not a single clean way of fixing this.
One approach would be too introduce a new "Pedal" text style, set to baseline alignment. I'm not crazy about introducing a new style, and even if we did, we'd have to somehow deal with the width of the pedal line - the text should align with the *bottom*, not the top, of line. We could hard code that value into the text style, or we could alter the layout of pedal lines so the anchor point is the bottom rather than top of the line.
Another approach would be to force alignment to baseline during layout, and then we could calculate the appropriate Y offset based on line width then. But then we lose the ability to override this manually.
Another approach would be to set the alignment explicitly to baseline, and calculate an appropriate Y offset based on line width, when setting the initial text for a pedal line. This preserves the ability to override these vaues later. But it doesn't help existing scores created in previous 2.0 builds, unless we bump the version number and add special handling.
To me, this is worth fixing, but not worth introducing major changes over. I coded up the last of these; just a few lines added to TextLine::createBeginTextElement(). I think that or introducing a new text style that is explicitly set to baseline and with an explict Y offset set to the default line width is probably the way to go. The new text style, is, I suppose, best, but I kind of resist adding a new style at this point.
Here is a PR that implements the approach I favored in my comment above - forcing the text to baseline alignment, with a vertical offset equal to the line width, when creating the text. It works very well for newly placed lines with a minimum of code changes required.
https://github.com/musescore/MuseScore/pull/1798
Here is a new PR that adds a "Pedal" text style:
https://github.com/musescore/MuseScore/pull/1800
It's definitely a nicer approach. Fixes a couple of bugs with text style in TextLines along the way too (see #41081: Incorrect font in an "8ve up" line after clearing text).
Fixed in 777f30c038
Automatically closed -- issue fixed for 2 weeks with no activity.