Skip to content

Commit b63abe1

Browse files
committed
Fix chord symbol compatibility
1 parent 6725ed0 commit b63abe1

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/engraving/rw/compat/compatutils.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,10 @@ double CompatUtils::convertChordExtModUnits(double val)
583583
// After 4.6 this is in % of root cap height
584584
// The best we can do for conversion of old files is to assume a default spatium of 1.75mm and a default font size of 10pt
585585
// The height value is calculated from Edwin at 10pt using FontMetrics::capHeight
586-
constexpr double DEFAULT_STAVE_SPACE_MM = 1.75;
587-
constexpr double DEFAULT_SPATIUM = DEFAULT_STAVE_SPACE_MM * DPMM;
588-
constexpr double DEFAULT_FONT_CAP_HEIGHT = 35.3795;
586+
const double DEFAULT_SPATIUM = StyleDef::styleValues[static_cast<size_t>(Sid::spatium)].defaultValue().toDouble();
587+
muse::draw::Font f(u"Edwin", muse::draw::Font::Type::Text);
588+
f.setPointSizeF(10);
589+
const double DEFAULT_FONT_CAP_HEIGHT = muse::draw::FontMetrics::capHeight(f); // 121
589590

590591
return ((val / 5) * DEFAULT_SPATIUM) / DEFAULT_FONT_CAP_HEIGHT;
591592
}

vtest/scores/harmony-23.mscz

490 Bytes
Binary file not shown.

vtest/scores/harmony-24.mscz

667 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)