Skip to content

Fix Unicode symbols in chord editing and Jazz kerning - #35349

Open
0xMashiro wants to merge 2 commits into
musescore:mainfrom
0xMashiro:fix/jazz-double-accidental-kerning
Open

0xMashiro wants to merge 2 commits into
musescore:mainfrom
0xMashiro:fix/jazz-double-accidental-kerning

Conversation

@0xMashiro

@0xMashiro 0xMashiro commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Resolves: #35348

Correct Unicode literals in chord-symbol editing and Jazz kerning. The double-sharp and double-flat literals used four-digit escapes for supplementary-plane code points, so neither the Jazz kerning entries nor the end-of-edit replacements matched those symbols. The adjacent diminished-chord replacement also used U+00D0 (Latin Eth) instead of U+00B0 (degree sign).

Use the correct code points while retaining the existing kerning values and Jazz-only condition. This completes the kerning cases missed by #30362 (#30285); the editing omissions were pointed out in #35349 (comment).

The existing harmony-46 vtest covers both double accidentals before minor/major seventh suffixes, retaining the original first measure as a control. A new test in the existing TextBase suite exercises startEdit, InsertText and endEdit, comparing chord names and parsed root/bass/description information with normal text input. It covers both accidentals in roots and slash basses, the degree sign, and ordinary sharp/flat controls. No new score fixture is needed for editing.

Validation:

  • Rebased onto official main ac179663cfe2c685b720c68611dbac67c63038d8. Before correcting Harmony::endEdit, the unchanged editing regression fails for the four double-accidental inputs and C°7; the two ordinary-accidental controls pass.
  • With the correction, all 14 TextBase and FretDiagram tests pass, including all seven inputs in the regression. Independent compilation of harmony.cpp and textbase_tests.cpp, upstream Uncrustify and diff checks pass.
  • The earlier matched native visual evidence below was generated on 26fb3eb5. All four added kerning cases receive the adjustment; the original first-measure text positions and full DrawData for harmony-40, harmony-41 and a Standard-style control remain unchanged. The existing harmony-6 double-sharp case changes as expected. These images and the visual fixture are unchanged by the editing follow-up.
  • Native tests/renders use ASAN_OPTIONS=detect_leaks=0. No full-suite, GUI editing, or leak-free result is claimed.
Before After
Before After

Compare the gap after the double accidentals in the second system. The first system is unchanged.

  • I signed the CLA.
  • The title of the PR describes the problem it addresses.
  • The code in the PR follows the coding rules.
  • There are no unnecessary changes.
  • Each commit's message describes its purpose and effects, and references the issue it resolves. If changes are extensive, there is a sequence of easily reviewable commits.
  • The code compiles and runs on my machine, preferably after each commit individually. I have manually tested and verified that my changes fulfil their intended purpose.
  • No prior attempts to resolve this problem exist, or if they do, I listed them in my PR description and described how I avoided repeating past mistakes.

Complete only if applicable:

  • I created a unit test or vtest to verify the changes I made.
  • This PR was created using AI assistance; I have read, understood and complied following the guidelines for AI-assisted contributions. The AI tool(s) I used are listed below.

OpenAI Codex was used to improve efficiency during development.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: musescore/MuseScore/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79a94a90-c940-4cb1-9bf8-84d2fa2018d9
📥 Commits

Reviewing files that changed from the base of the PR and between 26fb3eb and 4678bb8.

📒 Files selected for processing: 2
  • src/engraving/rendering/score/harmonylayout.cpp
  • vtest/scores/harmony-46.mscz

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The Jazz kerning keys for double-sharp and double-flat now use eight-digit Unicode escapes for U+1D12A and U+1D12B. The existing kerning adjustment values are unchanged.

Priority: Low

Severity of issue fixed: Low

Merge Risk: Minimal · up to 4678b

The corrected keys match the symbols emitted by Jazz chord rendering, and the updated fixture covers both accidentals with both suffix types. No actionable merge risk remains.

Pre-merge checks: Passed 4
Check name Status Explanation
Linked Issues check Passed The PR satisfies the coding requirements in [#35348]. It replaces the malformed four-digit escapes with \\U0001D12A and \\U0001D12B. The existing -0.15 values remain unchanged. The PR changes only…
Out of Scope Changes check Passed The changes stay within [#35348]. The source change fixes double-sharp and double-flat Jazz kerning. The harmony-46.mscz change provides the related regression coverage. No unrelated source or test …
Title check Passed The title clearly summarizes the two related fixes: correcting Unicode symbols in chord editing and Jazz kerning.
Description check Passed The description is complete and directly addresses the template. It includes the resolved issue, motivation, implementation details, testing evidence, limitations, visual evidence, and completed check…
Full details: Linked Issues check

Explanation

The PR satisfies the coding requirements in [#35348]. It replaces the malformed four-digit escapes with \U0001D12A and \U0001D12B. The existing -0.15 values remain unchanged. The PR changes only the Jazz kerning entries and retains the existing Jazz-only behavior. The harmony-46.mscz vtest fixture also changes for the reported double-accidental cases.

Full details: Out of Scope Changes check

Explanation

The changes stay within [#35348]. The source change fixes double-sharp and double-flat Jazz kerning. The harmony-46.mscz change provides the related regression coverage. No unrelated source or test changes appear in the whole-PR diff.

Full details: Description check

Explanation

The description is complete and directly addresses the template. It includes the resolved issue, motivation, implementation details, testing evidence, limitations, visual evidence, and completed checklist items.

✨ Finishing Touches: 💡 1
🧪 Generate unit tests (beta)
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/muse_framework.git.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@avvvvve
avvvvve requested a review from miiizen October 23, 2026 14:03
@mercuree

Copy link
Copy Markdown
Contributor

s.replace(u"\u1d12b", u"bb"); // double-flat

s.replace(u"\u1d12a", u"x"); // double-sharp

Do these lines also need to be fixed?

Use the full supplementary-plane code points so the existing Jazz
kerning entries match double-sharp and double-flat symbols.

Extend harmony-46 with both accidentals before minor/major seventh
suffixes. Native before/after renders exercise all four cases; the
original ordinary-accidental cases and Standard-style controls remain
unchanged. Standalone compilation and codestyle checks pass.

Fixes musescore#35348

Assisted-by: OpenAI Codex
Use full Unicode escapes for double accidentals and the degree sign rather than Latin Eth for diminished chords. Exercise startEdit, InsertText and endEdit against normal text equivalents, including double accidentals in roots and slash basses and ordinary accidental controls.

The unchanged regression fails in five input cases before correction. All 14 TextBase and FretDiagram tests pass after correction, and both changed translation units compile independently.

Refs: musescore#35348

Assisted-by: OpenAI Codex
@0xMashiro
0xMashiro force-pushed the fix/jazz-double-accidental-kerning branch from 4678bb8 to cd88b7e Compare October 29, 2026 13:42
@0xMashiro 0xMashiro changed the title Fix Jazz chord-symbol kerning after double accidentals Fix Unicode symbols in chord editing and Jazz kerning Oct 29, 2026
@0xMashiro

Copy link
Copy Markdown
Contributor Author

Yes, thanks for catching those. Fixed both in cd88b7e and added a regression that exercises ending an actual chord-symbol edit, including double accidentals in roots and slash basses.

I also checked the adjacent replacements: the degree-sign case used U+00D0 (Ð) rather than U+00B0 (°). C°7 failed the same editing test, so I corrected that line too. Ordinary sharp/flat inputs are passing controls. All 14 TextBase and FretDiagram tests pass after the changes.

The broader escape search found no further instances of this mistake in the scanned source; the OVE matches are valid natural signs followed by 7.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jazz chord-symbol kerning skips double-sharp and double-flat accidentals

2 participants