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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/engraving/libmscore/textbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

@Jojo-Schmitz Jojo-Schmitz Oct 8, 2021

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.

} else {
family = t->score()->styleSt(Sid::MusicalTextFont);
}
Expand Down
4 changes: 1 addition & 3 deletions src/engraving/style/styledef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,7 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue
{ Sid::partInstrumentFrameBgColor, "partInstrumentFrameBgColor", QVariant::fromValue(draw::Color::transparent) },

{ Sid::dynamicsFontFace, "dynamicsFontFace", "Edwin" },
{ Sid::dynamicsFontSize, "dynamicsFontSize", 11.0 },
{ Sid::dynamicsSymbolFontSize, "dynamicsSymbolFontSize", 20.0 },
{ Sid::dynamicsFontSize, "dynamicsFontSize", 10.0 },
{ Sid::dynamicsLineSpacing, "dynamicsLineSpacing", 1.0 },
{ Sid::dynamicsFontSpatiumDependent, "dynamicsFontSpatiumDependent", true },
{ Sid::dynamicsFontStyle, "dynamicsFontStyle", int(FontStyle::Italic) },
Expand Down Expand Up @@ -855,7 +854,6 @@ const std::array<StyleDef::StyleValue, size_t(Sid::STYLES)> StyleDef::styleValue

{ Sid::tempoFontFace, "tempoFontFace", "Edwin" },
{ Sid::tempoFontSize, "tempoFontSize", 12.0 },
{ Sid::tempoSymbolFontSize, "tempoSymbolFontSize", 20.0 },
{ Sid::tempoLineSpacing, "tempoLineSpacing", 1.0 },
{ Sid::tempoFontSpatiumDependent, "tempoFontSpatiumDependent", true },
{ Sid::tempoFontStyle, "tempoFontStyle", int(FontStyle::Bold) },
Expand Down
2 changes: 0 additions & 2 deletions src/engraving/style/styledef.h
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,6 @@ enum class Sid {

dynamicsFontFace,
dynamicsFontSize,
dynamicsSymbolFontSize,
dynamicsLineSpacing,
dynamicsFontSpatiumDependent,
dynamicsFontStyle,
Expand Down Expand Up @@ -866,7 +865,6 @@ enum class Sid {

tempoFontFace,
tempoFontSize,
tempoSymbolFontSize,
tempoLineSpacing,
tempoFontSpatiumDependent,
tempoFontStyle,
Expand Down