http://codereview.appspot.com/343020043
From: foxfanfare
Hi everyone,Just noticed a bug in the default placement of the naturals when
key is changed.As you can see, the naturals aren't spaced correctly when
using the bass clef.I tried \Staff.override KeyCancellation.padding = #0.2,
but even with a larger padding, naturals aren't spaced uniformly
e.g
\version "2.19.81"
\new Staff {
\key cis\major
s1
\key ces\major
s
\clef bass
\key ces\major
s^"problem"
\key cis\major
s \bar "|."
}
As already stated in the thread, this has nothing to do with clefs at all.
This occurs when cancelling flat key signature while sharp key signature cancelling looks OK.
In fact, it's the vertical distance of adjacent natural signs that make the gap look OK or too close when they touch:
The reason for the unsatisfactory spacing is that we use the exact same horiontal distance between naturals.
When cancelling flat keys, the colliding naturals are a fourth apart, when cancelling shapr keys, these naturals are a fifth apart, and this makes the difference.
All the best,
Torsten
Adding possible 'workaround' (at least for flats) from Harm in casse someone else needs it.
Hi,
I played a little with 'padding-pairs.
Obviously the execption to add 0.3 padding in
key-signature-interface.cc only applies if 'padding-pairs is unset.
Below is limited to flat-cancellation:
For flat-cancellation:
The result is an even spacing of every natural. I'd call it a slight
improvement, but far from optimal.
The gap between first/second natural feels too wide and between
second/third too tight.
Sharp-cancellation is unchanged.
Nothing else in my black-box.
Cheers,
Harm
issue 5312: Key cancellation glyph position inconsistent
file lily/key-signature-interface.cc
Using two intervals representing the "vertical skylines" of two
adjacent natural glyphs. This makes a better model of the actual
glyph shape than the original single point within an inverval.
Now we can distiguish between all three cases:
(1) no overlap -> no additional kerning needed
(2) just touching (overlap, but intesection length 0) -> kerning 0.15
(3) overlapping -> kerning 0.3
Case (2) is the new one that couldn't be handled before:
Just touching at the corners made the glyphs cling together.
Basically same interval technique as before, but I
renamed the Slices from
pos and overlap_pos
to
ht_right and last_ht_left.
Using quarter stave-spaces as to get a better (integer) resolution.
http://codereview.appspot.com/343020043
Diff:
Patch submitted.
In order to be able to distinguish between two natural glyphs just touching at the corners or a real at-length overlap, I'm now using two intervals representing the actual glyph shapes:
They either just touch or overlap.
See attached PNG comparing the old and new kerning model.
Passes make, make check and a full make doc.
Reg test diffs can be downloaded from here:
https://cloud.indie.host/s/48HekyfYcZexSXG
Patch on countdown for April 30th.
Patch counted down; please push.
Patch file against current master attached.
Please push it for me.
Thanks,
Torsten
Thank you, James!