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

fix #315897: unreadable chord symbols with custom description file #7370

Merged
merged 1 commit into from
Feb 3, 2021

Conversation

MarcSabatella
Copy link
Contributor

Resolves: https://musescore.org/en/node/315897

There is a style setting to allow custom chord description files,
which is an advanced feautr eused by few today
but was the the standard/supported way of getting "jazz" chords
in older versions.
Scores using this option will have chord symbols rendering info
embedded within the score, in a ChordList tag.
Thus far, at the point where this tag was encountered,
the score's chord list was empty, and reading the chord list
worked as expected.
Now, however, the reading of the style defaults file for the score
results in the chord list having three "font" entries
before the actual chord list is read.
This results in the font references all being off,
meaning that the various special symbols used in chord symbols
get rendered as nonsense characters because they are in fonts
that do not support these special symbols.

Solution is simply to unlaod the existing chord list
when we encounter a ChordList tag, before reading the list.
Previously there was a clear() call, but that's not enough,
we need to clear the fonts and other settings too.

But also, to be safe, I changed the initiation of of the font index
in ChordList::read() so that if there are any fonts
already present in the list, they are accounted for,
at least partially.

Resolves: https://musescore.org/en/node/315897

There is a style setting to allow custom chord description files,
which is an advanced feautr eused by few today
but was the the standard/supported way of getting "jazz" chords
in older versions.
Scores using this option will have chord symbols rendering info
embedded within the score, in a ChordList tag.
Thus far, at the point where this tag was encountered,
the score's chord list was empty, and reading the chord list
worked as expected.
Now, however, the reading of the style defaults file for the score
results int he chord list having three "font" entries
before the actual chord list is read.
This results in the font references all being off,
meaning that the various special symbols used in chord symbols
get rendered as nonsense characters because they are in fonts
that do not support these special symbols.

Solution is unload the existing chord list
when we encounter a ChordList tag, before reading the list.
Previously there was a clear() call, but that's not enough,
we need to clear the fonts and other settings too.

Also, to be safe, I changed the initiation of of the font index
in ChordList::read() so that if there *are* any fonts
already present in the list, they are accounted for,
at least partially.

I also set the customChordList flag to make sure
we always write the chord lsit when it is custom,
and don't write it when not.
This was previously not being set when changing style
via the dialog - only on read.
As a result, a custom chord list didn't get written
until after save / load / save,
and was being written inappropriately after changing
back to a built-in (standard or jazz) style.
@vpereverzev vpereverzev merged commit 68badd8 into musescore:3.x Feb 3, 2021
@igorkorsukov
Copy link
Contributor

@MarcSabatella Could you please port the changes to the master

MarcSabatella added a commit to MarcSabatella/MuseScore that referenced this pull request Feb 17, 2021
@MarcSabatella MarcSabatella mentioned this pull request Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants