[MusicXML import] justify="right" on direction words is ignored, so right-aligned text runs off the page

Aperta
#35,844 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
56/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp, xml
Ambito
desktop

Direzione di ricerca

Start by opening the supplied right-justified-words.musicxml in MuseScore and trace how MusicXML direction words are imported, focusing on how justify="right" is handled when halign is absent. Compare the imported alignment and anchor behavior with the left-justified example; done means right-justified text ends at its anchor and the measure 2 example stays on the page.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

community MusicXML
Issue type

Import/export issue

Description with steps to reproduce

<words justify="right"> in a <direction> is imported as left-aligned text that starts at the anchor and extends to the right. Text that the exporting program right-aligned at the end of a measure therefore starts at the barline and runs past the right edge of the page.

  1. Open right-justified-words.musicxml.
  2. Compare the three texts.

Actual:

  • "LEFT-justified text at beat 1" starts at beat 1, as expected;
  • "RIGHT-justified text at beat 3" also starts at beat 3 and extends to the right;
  • in measure 2, the right-justified text with default-x="300" and <offset>4</offset> (end of the measure) starts at the final barline and runs off the page.

Expected: with justify="right" (and so halign="right", which the MusicXML specification derives from justify when halign is absent) the text should end at its anchor, extending to the left.

This matters for Finale exports: Finale writes right-aligned text, such as composer credits for later sections of a piece, this way. In a collection of 981 hymns exported from Finale v27, 188 files contain 915 such texts; the ones we opened in MuseScore all ran off the right edge.

Supporting files, videos and screenshots

Minimal test file, made up for this report. Save it as right-justified-words.musicxml and open it in MuseScore Studio.

right-justified-words.musicxml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 4.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
<score-partwise version="4.0">
  <part-list>
    <score-part id="P1"><part-name>Voice</part-name></score-part>
  </part-list>
  <part id="P1">
    <measure number="1">
      <attributes><divisions>1</divisions><key><fifths>0</fifths></key><time><beats>4</beats><beat-type>4</beat-type></time><clef><sign>G</sign><line>2</line></clef></attributes>
      <direction placement="above">
        <direction-type><words justify="left">LEFT-justified text at beat 1</words></direction-type>
      </direction>
      <note><pitch><step>C</step><octave>5</octave></pitch><duration>2</duration><type>half</type></note>
      <direction placement="below">
        <direction-type><words justify="right">RIGHT-justified text at beat 3</words></direction-type>
      </direction>
      <note><pitch><step>D</step><octave>5</octave></pitch><duration>2</duration><type>half</type></note>
    </measure>
    <measure number="2">
      <direction placement="above">
        <direction-type><words justify="right" default-x="300">RIGHT-justified, default-x 300, offset to the end of the measure</words></direction-type>
        <offset>4</offset>
      </direction>
      <note><pitch><step>E</step><octave>5</octave></pitch><duration>4</duration><type>whole</type></note>
      <barline location="right"><bar-style>light-heavy</bar-style></barline>
    </measure>
  </part>
</score-partwise>
In which versions of MuseScore Studio is this issue present?

4.7.7

Regression

I was unable to check

Operating system

Windows 11 Pro

Additional context

Workaround: remove the <offset> and default-x, set the text left-aligned and move it to the start of the section it labels.

Lingua principale
C++
Stelle
15.5k
Fork
3.5k
Merge medio
2g 19h
PR unite (30g)
124

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di musescore/MuseScore

Tutte le issue di musescore/MuseScore

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.