Skip to content

Commit

Permalink
Coda and Segno symbol sizing manual override
Browse files Browse the repository at this point in the history
The sizing of REPEAT_LEFT and REPEAT_RIGHT text is inconsistent due to
the inconsistent sizing of the coda and segno symbols. This commit adds
an override on MusicXML import based on the presence of non-symbol text.

Duplicate of musescore#8583
  • Loading branch information
iveshenry18 authored and Jojo-Schmitz committed Sep 9, 2021
1 parent fc54d88 commit 0d9e6ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
9 changes: 9 additions & 0 deletions importexport/musicxml/importmxmlpass2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3698,6 +3698,15 @@ void MusicXMLParserDirection::handleRepeats(Measure* measure, const int track, c
if (!_wordsText.isEmpty()) {
tb->setXmlText(_wordsText);
_wordsText = "";

// Temporary fix for symbol sizing issues
qreal symSize = _score->style().value(Sid::repeatLeftFontSize).toReal();
qreal textSize = _score->style().value(Sid::repeatRightFontSize).toReal();
if (tb->xmlText() != "<sym>coda</sym>" && tb->xmlText() != "<sym>segno</sym>")
tb->setSize(textSize);
else
tb->setSize(symSize);
tb->setPropertyFlags(Pid::FONT_SIZE, PropertyFlags::UNSTYLED);
}
else tb->setVisible(false);

Expand Down
3 changes: 1 addition & 2 deletions mtest/musicxml/io/testDSalCoda.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
<bottom-margin>85.7143</bottom-margin>
</page-margins>
</page-layout>
<word-font font-family="Edwin" font-size="10"/>
<lyric-font font-family="Edwin" font-size="10"/>
</defaults>
<credit page="1">
<credit-type>title</credit-type>
Expand Down Expand Up @@ -311,6 +309,7 @@
</note>
</measure>
<measure number="9" width="107.29">
<print new-system="yes" />
<note default-x="13.00" default-y="-40.00">
<pitch>
<step>E</step>
Expand Down
24 changes: 3 additions & 21 deletions mtest/musicxml/io/testDSalCoda_ref.mscx
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,6 @@
<pageEvenBottomMargin>0.590551</pageEvenBottomMargin>
<pageOddTopMargin>0.590551</pageOddTopMargin>
<pageOddBottomMargin>0.590551</pageOddBottomMargin>
<chordSymbolAFontSize>10</chordSymbolAFontSize>
<chordSymbolBFontSize>10</chordSymbolBFontSize>
<nashvilleNumberFontSize>10</nashvilleNumberFontSize>
<tupletFontSize>10</tupletFontSize>
<fingeringFontSize>10</fingeringFontSize>
<lhGuitarFingeringFontSize>10</lhGuitarFingeringFontSize>
<rhGuitarFingeringFontSize>10</rhGuitarFingeringFontSize>
<stringNumberFontSize>10</stringNumberFontSize>
<partInstrumentFontSize>10</partInstrumentFontSize>
<dynamicsFontSize>10</dynamicsFontSize>
<tempoFontSize>10</tempoFontSize>
<metronomeFontSize>10</metronomeFontSize>
<measureNumberFontSize>10</measureNumberFontSize>
<mmRestRangeFontSize>10</mmRestRangeFontSize>
<rehearsalMarkFontSize>10</rehearsalMarkFontSize>
<repeatLeftFontSize>10</repeatLeftFontSize>
<repeatRightFontSize>10</repeatRightFontSize>
<glissandoFontSize>10</glissandoFontSize>
<bendFontSize>10</bendFontSize>
<headerFontSize>10</headerFontSize>
<footerFontSize>10</footerFontSize>
<Spatium>1.75</Spatium>
</Style>
<showInvisible>1</showInvisible>
Expand Down Expand Up @@ -293,6 +272,9 @@
</voice>
</Measure>
<Measure>
<LayoutBreak>
<subtype>line</subtype>
</LayoutBreak>
<voice>
<Chord>
<durationType>quarter</durationType>
Expand Down

0 comments on commit 0d9e6ac

Please sign in to comment.