Tablature note heads horizontal position (on Windows only?)

• Feb 12, 2019 - 16:08
Reported version
3.0
Type
Graphical (UI)
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project

For the first two attached files: The .mscz file is the original v2 file. The .mscx file is file created by opening the .mscz in the latest master and saving as a new .mscx file. It does not matter if you click Yes or No to repositioning the elements when you open the v2 file in v3 MuseScore. It does not affect this positioning.

tabtest5.mscx is a newly created file using the latest master. It exhibits the same misalignment in MuseScore on Windows 10. The stems are not properly centered on the notes (or vice versa), and it is irregular, not every note, not by the glyph/char or font. It is as if it is a rounding error of some sort, but it looks like more than a 1 pixel error.

This is an issue carried over from v2 into v3. On Ubuntu Linux, I do not see this issue in v3 - the alignment looks pretty good. I am unable to test on Mac OS at this time.

Attachment Size
auber_on_yonder_rock_.mscz 26.31 KB
On_Yonder_Rock.mscx 93.57 KB
tabtest5.mscx 23.66 KB

Comments

On Windows the background rectangle behind each tab numbers (to white-out the staff line) is 28 wide. On Ubuntu it's 27.5 wide. The Note's bbox() is 23 vs 22.5. Is it because the font is sized differently by OS? Kerning? What causes this?

I'm also seeing that the note and stem draw order on Linux is by measure by staff. Within a measure, across staves, the order is consistent. Across measures it is irregular. On Windows the order appears to be less orderly, not by measure at all.

I am programming a novel solution for this in my own SVG exports. I don't know if it is appropriate for MuseScore layout in general.
Horizontally, I am center-aligning the tablature text to the stem.
Vertically, I am center-aligning the the tablature text to the staff line for the specified string.
Those are the conceptually correct alignments, and they are available in Qt and SVG as text alignment attributes/properties.

Because of this implementation, I can use any tablature font in a range of sizes, without modifying the positioning of anything. I can use any font at all, within a range of sizes.

This SVG solution also leads me to care less about this MuseScore screen rendering issue, and thus abandon pursuing its solution. I am lost when it comes to OS-specific issues like this anyway. There are ways my SVG code could be adapted to MuseScore screen layout, but it won't fix this Windows-specific issue. Using text alignment to center the tablature notes is a conceptually clean mechanism, but adapting it for the MuseScore master might be some work. I already tried it, and Qt is funky about how it passes the text coordinates from Note::draw() into the SVG export code in svggenerator.cpp. It will probably be the same for PDF and maybe elsewhere. This may or may not affect MuseScore's standard SVG exports, which do not draw text: no fonts = no font dependencies, so everything is drawn as a path, even text. I use fonts in my personal version of MuseScore SVG exports.