Skip to content

Commit eb9c1ef

Browse files
authored
Merge pull request #32455 from rettinghaus/xml/style
[MusicXML] Fix unwanted text style setting
2 parents 21b366a + 77ea783 commit eb9c1ef

File tree

73 files changed

+14
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+14
-82
lines changed

src/importexport/musicxml/internal/import/importmusicxmlpass1.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,14 +1837,17 @@ static void updateStyles(Score* score,
18371837
// Roman numeral analysis and harp pedal diagrams (special case, leave untouched)
18381838
// and text types used in the title frame
18391839
// Some further tweaking may still be required.
1840+
if (wordFamily.empty()) {
1841+
break; // If no font is specified, use default styles
1842+
}
18401843

18411844
if (tid == TextStyleType::LYRICS_ODD || tid == TextStyleType::LYRICS_EVEN
18421845
|| tid == TextStyleType::FRET_DIAGRAM_FINGERING || tid == TextStyleType::FRET_DIAGRAM_FRET_NUMBER
1843-
|| tid == TextStyleType::TAB_FRET_NUMBER) {
1846+
|| tid == TextStyleType::HARMONY_ROMAN || tid == TextStyleType::TAB_FRET_NUMBER) {
18441847
continue;
18451848
}
18461849

1847-
bool needUseDefaultSize = configuration()->needUseDefaultFont() || tid == TextStyleType::HARMONY_ROMAN
1850+
bool needUseDefaultSize = configuration()->needUseDefaultFont()
18481851
|| tid == TextStyleType::HAMMER_ON_PULL_OFF
18491852
|| isTitleFrameStyle(tid)
18501853
|| isHarpPedalStyle(tid);
@@ -1860,13 +1863,15 @@ static void updateStyles(Score* score,
18601863
}
18611864

18621865
// handle lyrics odd and even lines separately
1863-
if (!needUseDefaultFont) {
1864-
score->style().set(Sid::lyricsOddFontFace, lyricFamily);
1865-
score->style().set(Sid::lyricsEvenFontFace, lyricFamily);
1866-
}
1867-
if (dblLyricSize > epsilon) {
1868-
score->style().set(Sid::lyricsOddFontSize, dblLyricSize);
1869-
score->style().set(Sid::lyricsEvenFontSize, dblLyricSize);
1866+
if (!lyricFamily.empty()) {
1867+
if (!needUseDefaultFont) {
1868+
score->style().set(Sid::lyricsOddFontFace, lyricFamily);
1869+
score->style().set(Sid::lyricsEvenFontFace, lyricFamily);
1870+
}
1871+
if (dblLyricSize > epsilon) {
1872+
score->style().set(Sid::lyricsOddFontSize, dblLyricSize);
1873+
score->style().set(Sid::lyricsEvenFontSize, dblLyricSize);
1874+
}
18701875
}
18711876
}
18721877

@@ -2081,7 +2086,6 @@ void MusicXmlParserPass1::defaults()
20812086
muPrintable(wordFontFamily), muPrintable(wordFontSize),
20822087
muPrintable(lyricFontFamily), muPrintable(lyricFontSize));
20832088
*/
2084-
wordFontFamily = wordFontFamily.empty() ? u"Edwin" : wordFontFamily;
20852089
lyricFontFamily = lyricFontFamily.empty() ? wordFontFamily : lyricFontFamily;
20862090
updateStyles(m_score, wordFontFamily, wordFontSize, lyricFontFamily, lyricFontSize);
20872091

src/importexport/musicxml/tests/data/importTie2_ref.mscx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<chordSymbolAFontSize>10.25</chordSymbolAFontSize>
2929
<chordSymbolBFontFace>Times New Roman</chordSymbolBFontFace>
3030
<chordSymbolBFontSize>10.25</chordSymbolBFontSize>
31-
<romanNumeralFontFace>Times New Roman</romanNumeralFontFace>
3231
<nashvilleNumberFontFace>Times New Roman</nashvilleNumberFontFace>
3332
<nashvilleNumberFontSize>10.25</nashvilleNumberFontSize>
3433
<smallNoteMag>0.6</smallNoteMag>

src/importexport/musicxml/tests/data/importTie3_ref.mscx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
<ledgerLineWidth>0.15625</ledgerLineWidth>
2626
<chordSymbolAFontFace>Times New Roman</chordSymbolAFontFace>
2727
<chordSymbolBFontFace>Times New Roman</chordSymbolBFontFace>
28-
<romanNumeralFontFace>Times New Roman</romanNumeralFontFace>
2928
<nashvilleNumberFontFace>Times New Roman</nashvilleNumberFontFace>
3029
<smallNoteMag>0.75</smallNoteMag>
3130
<graceNoteMag>0.6</graceNoteMag>

src/importexport/musicxml/tests/data/importTie4_ref.mscx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<chordSymbolAFontSize>22</chordSymbolAFontSize>
2828
<chordSymbolBFontFace>Palatino,serif</chordSymbolBFontFace>
2929
<chordSymbolBFontSize>22</chordSymbolBFontSize>
30-
<romanNumeralFontFace>Palatino,serif</romanNumeralFontFace>
3130
<nashvilleNumberFontFace>Palatino,serif</nashvilleNumberFontFace>
3231
<nashvilleNumberFontSize>22</nashvilleNumberFontSize>
3332
<smallNoteMag>0.75</smallNoteMag>

src/importexport/musicxml/tests/data/testArpCrossVoice_ref.mscx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<pageEvenBottomMargin>0.590551</pageEvenBottomMargin>
1414
<pageOddTopMargin>0.590551</pageOddTopMargin>
1515
<pageOddBottomMargin>0.590551</pageOddBottomMargin>
16-
<romanNumeralFontFace>Edwin</romanNumeralFontFace>
1716
<nashvilleNumberFontSize>10</nashvilleNumberFontSize>
1817
<hideInstrumentNameIfOneInstrument>0</hideInstrumentNameIfOneInstrument>
1918
<tupletFontSize>10</tupletFontSize>

src/importexport/musicxml/tests/data/testArpOnRest_ref.mscx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<pageEvenBottomMargin>0.590551</pageEvenBottomMargin>
1414
<pageOddTopMargin>0.590551</pageOddTopMargin>
1515
<pageOddBottomMargin>0.590551</pageOddBottomMargin>
16-
<romanNumeralFontFace>Edwin</romanNumeralFontFace>
1716
<nashvilleNumberFontSize>10</nashvilleNumberFontSize>
1817
<hideInstrumentNameIfOneInstrument>0</hideInstrumentNameIfOneInstrument>
1918
<tupletFontSize>10</tupletFontSize>

src/importexport/musicxml/tests/data/testBarlineLoc_ref.mscx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<pageEvenBottomMargin>0.590551</pageEvenBottomMargin>
1414
<pageOddTopMargin>0.590551</pageOddTopMargin>
1515
<pageOddBottomMargin>0.590551</pageOddBottomMargin>
16-
<romanNumeralFontFace>Edwin</romanNumeralFontFace>
1716
<nashvilleNumberFontSize>10</nashvilleNumberFontSize>
1817
<hideInstrumentNameIfOneInstrument>0</hideInstrumentNameIfOneInstrument>
1918
<tupletFontSize>10</tupletFontSize>

src/importexport/musicxml/tests/data/testBeamModes_ref.mscx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<pageEvenBottomMargin>0.590551</pageEvenBottomMargin>
1313
<pageOddTopMargin>0.590551</pageOddTopMargin>
1414
<pageOddBottomMargin>0.590551</pageOddBottomMargin>
15-
<romanNumeralFontFace>Edwin</romanNumeralFontFace>
1615
<nashvilleNumberFontSize>10</nashvilleNumberFontSize>
1716
<hideInstrumentNameIfOneInstrument>0</hideInstrumentNameIfOneInstrument>
1817
<tupletFontSize>10</tupletFontSize>

src/importexport/musicxml/tests/data/testBracketTypes_ref.mscx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<pageEvenBottomMargin>0.590551</pageEvenBottomMargin>
1313
<pageOddTopMargin>0.590551</pageOddTopMargin>
1414
<pageOddBottomMargin>0.590551</pageOddBottomMargin>
15-
<romanNumeralFontFace>Edwin</romanNumeralFontFace>
1615
<nashvilleNumberFontSize>10</nashvilleNumberFontSize>
1716
<hideInstrumentNameIfOneInstrument>0</hideInstrumentNameIfOneInstrument>
1817
<tupletFontSize>10</tupletFontSize>

src/importexport/musicxml/tests/data/testBuzzRoll_ref.mscx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<stemWidth>0.125</stemWidth>
2121
<staffLineWidth>0.09375</staffLineWidth>
2222
<ledgerLineWidth>0.15625</ledgerLineWidth>
23-
<romanNumeralFontFace>Edwin</romanNumeralFontFace>
2423
<smallNoteMag>0.75</smallNoteMag>
2524
<graceNoteMag>0.6</graceNoteMag>
2625
<concertPitch>1</concertPitch>

0 commit comments

Comments
 (0)