[MusicXML import] justify="right" on direction words is ignored, so right-aligned text runs off the page
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 56/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Open
right-justified-words.musicxml. - 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.
- Dominant language
- C++
- Stars
- 15.5k
- Forks
- 3.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 124
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from musescore/MuseScore
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Edit string data dialog opens empty, with no strings and 0 frets, from "Instrument/Staff properties"Possibly taken @igorkorsukov claimed this 3 days ago. OpenP2 regression nightly UX/interaction
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
musescore/MuseScore#35829 · 1 assignee ·
Maintainers usually reply within 1 day
-
MusicXML export: overlapping dashed text lines (<dashes>) are all exported with duplicate number="1"Opencommunity MusicXML
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
MusicXML import loses explicit slur direction when the stop precedes the start in document orderOpenneeds review
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
needs review
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
All issues in musescore/MuseScore
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
bug low priority
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
eclipse-score/logging#531 ·
Maintainers usually reply within 2 days
-
scope:docs status:needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PX4/PX4-Autopilot#30166 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day