ssb22 / jianpu-ly

Jianpu in Lilypond
http://ssb22.user.srcf.net/mwrhome/jianpu-ly.html
Apache License 2.0
77 stars 19 forks source link

[End case] The numbers... #36

Closed suntong closed 1 year ago

suntong commented 1 year ago

Don't know how exactly to describe the issue in English about the number problem, but take a look at the screenshot:

the number 10 is still OK, but number 15 is placed below the two dots: image

which I believe should be the reverse.

Here is how to replicate the issue:

KeepOctave
KeepLength

2/4

<1 <1
 c1 2 3 4 5. s6 7
>c1 2 3 4 5. s6 7
>c1 2 3 4 >5. <s6 7
>c1 2 3 4 5. s6 7
>c1 2 3 4 5. s6 7
ssb22 commented 1 year ago

Reproduced on Lilypond 2.24.1: Lilypond puts ^\markup{ above the bar number if it's : but not if it's . (this is Lilypond's new text-collision avoidance logic not doing what we want).

The "lazy" workaround would be to change override Score.BarNumber #'Y-offset = -1 into override Score.BarNumber #'Y-offset = 3 to raise all the bar numbers up a bit so they are clear of the octave marks, but that will not work when it's a chord (replace that last >c1 2 3 with >c1 2 357 and it makes more of a mess).

We might be able to use the :dir-column code (normally used for chords) for the octave marks as well, which could also have the benefit of making sure that octave marks are inside the beams (instead of outside like now). But that means we have to solve the problem of accidentals in chords (because right now it just says "not implemented" if you try to put an accidental in a chord, which is OK if chords are not so common, but less good if every single note that's not in the home octave gets handled as a chord). Fixing accidentals in chords raises lots of awkward issues about horizontal and vertical alignment, plus we'd need to get the correct alignment overrides for the lower octave dots, so it's a big work item (and would need re-testing on all the Lilypond versions).

The other possibility is to add \override Score.BarNumber.outside-staff-priority = 475 to specify that bar numbers should be further out than TextScript (which defaults to 450). But then that will also put bar numbers outside of any TextSpanner objects (rare in jianpu but could still happen), so maybe it's better to do \override Score.TextScript.outside-staff-priority = 75 instead. In fact no: why should it be further out than TrillSpanner, let's set it to 45. Oh but do we want this to apply to all text? Probably not. Let's put it as a \once \override before the \applyOutput