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

let dynamic/tempo symbols auto-resize to surrounding text #9395

Merged
merged 1 commit into from
Oct 11, 2021

Conversation

Nick-Mazuk
Copy link
Contributor

Follow up to resolve some of the comments brought up in #9359 after it was merged.

Instead of having separate font sizes for dynamic/tempo symbols, the symbols will automatically resize given the surrounding context text sizes.

One other change: default dynamics font size is now 10pt instead of 11pt.

add comments to explain magic numbers
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 8, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 8, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 8, 2021
@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Oct 8, 2021

The backport (#9387) also shows a failing mtest (due to the changed default for dynamics size, easily fixed) and as such reveals that this particular mtest is missing from master, although the test file does exist (https://github.com/musescore/MuseScore/tree/master/src/importexport/musicxml/tests/data/testMeasureStyleSlash_ref.mscx).

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 8, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 8, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 8, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 8, 2021
@@ -962,10 +962,12 @@ mu::draw::Font TextFragment::font(const TextBase* t) const
if (format.fontFamily() == "ScoreText") {
if (t->parent() && t->isDynamic()) {
family = t->score()->scoreFont()->fontByName(t->score()->styleSt(Sid::MusicalSymbolFont))->family();
m = t->score()->styleV(Sid::dynamicsSymbolFontSize).toReal() * t->mag();
// to keep desired size ratio (based on 20pt symbol size to 10pt text size)
m *= 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you want it twice as big as the (new) default for dynamicsFontSize.
Why not twice as big as the actual dynamicsFontSize?
Wouzldn't that render this setting (in the EditStyle dialog) completyle useless?

} else if (t->parent() && t->isTempoText()) {
family = t->score()->styleSt(Sid::MusicalTextFont);
m = t->score()->styleV(Sid::tempoSymbolFontSize).toReal();
// to keep desired size ratio (based on 20pt symbol size to 12pt text size)
m *= 5.0 / 3.0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar question here.

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Oct 8, 2021

I got the 2.x import to work properly (finally):

diff --git a/src/engraving/libmscore/textbase.cpp b/src/engraving/libmscore/textbase.cpp
index 800189f797..6f52fba576 100644
--- a/src/engraving/libmscore/textbase.cpp
+++ b/src/engraving/libmscore/textbase.cpp
@@ -961,11 +961,13 @@ mu::draw::Font TextFragment::font(const TextBase* t) const
     QString family;
     if (format.fontFamily() == "ScoreText") {
         if (t->parent() && t->isDynamic()) {
-            family = t->score()->scoreFont()->fontByName(t->score()->styleSt(Sid::MusicalSymbolFont))->family();
-            m = t->score()->styleV(Sid::dynamicsSymbolFontSize).toReal() * t->mag();
+            family = t->score()->scoreFont()->fontByName(t->score()->styleSt(Sid::MusicalTextFont).replace(" Text", ""))->family();
+            // to keep desired size ratio (based on 20pt symbol size to 10pt text size)
+            m *= 2;
         } else if (t->parent() && t->isTempoText()) {
             family = t->score()->styleSt(Sid::MusicalTextFont);
-            m = t->score()->styleV(Sid::tempoSymbolFontSize).toReal();
+            // to keep desired size ratio (based on 20pt symbol size to 12pt text size)
+            m *= 5.0 / 3.0;
         } else {
             family = t->score()->styleSt(Sid::MusicalTextFont);
         }

I.e. by using the MusicalTextFont setting, and converting that into the corresponding MusyicalSymbolFont!

family = t->score()->scoreFont()->fontByName(t->score()->styleSt(Sid::MusicalTextFont).replace(" Text", ""))->family();

As the MusicalTextFont deterimines the look of Dynamics in MuseScore 1, 2 and 3, this to me is the way to go.

See #9427

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 8, 2021
Backport of musescore#9395, plus fixing mtests and use the `MusicalTextFont`
setting, converted into the corresponding `MusicalSymbolFont`
@oktophonie oktophonie added this to In progress in [MU4.0 - ENGRAVING] via automation Oct 8, 2021
[MU4.0 - ENGRAVING] automation moved this from In progress to Reviewer approved Oct 8, 2021
@vpereverzev vpereverzev merged commit 3bda156 into musescore:master Oct 11, 2021
[MU4.0 - ENGRAVING] automation moved this from Reviewer approved to Done Oct 11, 2021
@Nick-Mazuk Nick-Mazuk deleted the dynamic-font-sizing branch October 11, 2021 16:23
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 11, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 27, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 30, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 15, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 15, 2021
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 3, 2022
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request May 10, 2022
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Aug 1, 2022
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 9, 2022
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 9, 2022
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 9, 2022
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 30, 2022
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Nov 30, 2022
Jojo-Schmitz added a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 2, 2022
@musescore musescore deleted a comment from Jojo-Schmitz Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants