Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some style names are duplicated in MSS files #23461

Closed
shoogle opened this issue Jul 4, 2024 · 0 comments · Fixed by #23469
Closed

Some style names are duplicated in MSS files #23461

shoogle opened this issue Jul 4, 2024 · 0 comments · Fixed by #23469
Assignees

Comments

@shoogle
Copy link
Contributor

shoogle commented Jul 4, 2024

Issue type

Engraving bug (incorrect score rendering)

Bug description

These XML tag names are duplicated in src/engraving/style/styledef.cpp:

As a result, MuseScore cannot tell the difference between these style settings when reading and writing score files.

This problem would manifest as an engraving bug for end users.

Steps to reproduce

Run this command in MuseScore's source folder to see duplicated XML tags:

sed -En 's|.*Sid::([a-zA-Z0-9]+) *, *"([a-zA-Z0-9]+)".*|\2|p' src/engraving/style/styledef.cpp | sort | uniq -d

Screenshots/Screen recordings

No response

MuseScore Version

master

Regression

No.

Operating system

All

Additional context

This command shows XML tags that don't match the Sid name:

sed -En 's|.*Sid::([a-zA-Z0-9]+) *, *"([a-zA-Z0-9]+)".*|\1 \2|p' src/engraving/style/styledef.cpp | awk '$1!=$2' | column -t
Command output (click to show/hide)

Sid name on the left, XML tag on the right

minStaffSpread                  minSpreadSpread
maxStaffSpread                  maxSpreadSpread
hairpinLineWidth                hairpinWidth
chordSymbolAPosAbove            chordSymbolPosAbove
chordSymbolAPosBelow            chordSymbolPosBelow
measureNumberAllStaves          measureNumberAllStaffs
firstSystemInstNameVisibility   firstSystemInsNameVisibility
SlurEndWidth                    slurEndWidth
SlurMidWidth                    slurMidWidth
SlurDottedWidth                 slurDottedWidth
TieEndWidth                     tieEndWidth
TieMidWidth                     tieMidWidth
TieDottedWidth                  tieDottedWidth
MinTieLength                    minTieLength
MinStraightGlissandoLength      minStraightGlissandoLength
MinWigglyGlissandoLength        minWigglyGlissandoLength
SlurMinDistance                 slurMinDistance
TieMinDistance                  tieMinDistance
HeaderToLineStartDistance       headerSlurTieDistance
SectionPause                    sectionPause
MusicalSymbolFont               musicalSymbolFont
MusicalTextFont                 musicalTextFont
tremoloStrokeWidth              tremoloLineWidth
tremoloStyle                    tremoloStrokeStyle
skylineMinHorizontalClearance   minVerticalDistance
spatium                         Spatium
measureNumberPosAbove           measureNumberOffset
mmRestRangePosAbove             measureNumberPosAbove
mmRestRangePosBelow             measureNumberPosBelow
systemTextFontFace              systemFontFace
systemTextFontSize              systemFontSize
systemTextFontSpatiumDependent  systemFontSpatiumDependent
systemTextFontStyle             systemFontStyle
systemTextAlign                 systemAlign
systemTextOffsetType            systemOffsetType
systemTextPlacement             systemPlacement
systemTextPosAbove              systemPosAbove
systemTextPosBelow              systemPosBelow
systemTextMinDistance           systemMinDistance
systemTextFrameType             systemFrameType
systemTextFramePadding          systemFramePadding
systemTextFrameWidth            systemFrameWidth
systemTextFrameRound            systemFrameRound
systemTextFrameFgColor          systemFrameFgColor
systemTextFrameBgColor          systemFrameBgColor
staffTextFontFace               staffFontFace
staffTextFontSize               staffFontSize
staffTextFontSpatiumDependent   staffFontSpatiumDependent
staffTextFontStyle              staffFontStyle
staffTextAlign                  staffAlign
staffTextOffsetType             systemOffsetType
staffTextPlacement              staffPlacement
staffTextPosAbove               staffPosAbove
staffTextPosBelow               staffPosBelow
staffTextMinDistance            staffMinDistance
staffTextFrameType              staffFrameType
staffTextFramePadding           staffFramePadding
staffTextFrameWidth             staffFrameWidth
staffTextFrameRound             staffFrameRound
staffTextFrameFgColor           staffFrameFgColor
staffTextFrameBgColor           staffFrameBgColor

The mismatch is annoying for developers but doesn't cause problems for end users. If we want to fix it, the Sid should be renamed to match the XML tag rather than the other way around, because changing the XML would cause compatibility problems. (However, for the duplicates mentioned above, we have no choice but to change the XML tag.)

Possibly the XML tags should be generated by a pre-processor macro to ensure they match the Sid names.

In cases where the mismatch is intentional, the macro could take an extra argument, or those cases could be written out explicitly like they are now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants