musescore / musescore/MuseScore

Allow a tighter gap between system header time signature and start repeat barline

Open
#34,938 0 comments 0 reactions 1 assignee View on GitHub

@davidstephengrant is already working on this.

Since Sep 16, 2026.

engraving P2
Dominant language
C++
Stars
15.1k
Forks
3.3k
Avg merge
2d 2h
Merged PRs (30d)
91

Description

At the start of a system, a time signature followed by a start-repeat barline always keeps a minimum gap of at least 1.5 sp, and no style setting can reduce it.

The cause is in HorizontalSpacing::minHorizontalDistance(), which applies to system headers only:

  1. The "Time signature to barline" (0.5 sp) is maxed with the "Time signature to first note" (2.0 sp), and therefore overridden (with the default values).
  2. For a start repeat, endBarWidth + endBarDistance (0.92 sp by default) is subtracted, to align the repeat's thin line to where the header ends.
  3. A hardcoded minimum of 1.5 * spatium (absoluteMinHeaderDist) is then applied to the clearance measured to the barline's left edge.

With the default values, this is 2.0 − 0.92 = 1.08 < 1.5, so the minimum 1.5 is applied and both gap style settings appear useless. "Time signature to barline" only starts to have any visible effect once it surpasses 1.5 + 0.92 = 2.42 sp. The alignment from step 2 is also defeated by this minimum: the thin line ends up 2.42 sp from the time signature rather than the requested 2.0 sp.

https://github.com/user-attachments/assets/f7868d0c-9401-4353-a43c-f54963de1b82

The same affects clef/key signature headers via the systemHeaderDistance style.

This minimum is a too wide by default, we should allow the user to tighten this gap.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.