Menu

#5312 Key cancellation glyph position inconsistent

Fixed
Enhancement
2018-05-03
2018-04-23
No

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 "|."
}
1 Attachments

Discussion

  • Torsten Hämmerle

    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

     
  • Torsten Hämmerle

    • status: New --> Started
    • assigned_to: Torsten Hämmerle
     
  • Anonymous

    Anonymous - 2018-04-24

    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:

    \version "2.19.81"
    
    foo = \override Staff.KeyCancellation.padding-pairs = #(lambda (grob)
    (let* ((alteration-alist (ly:grob-property grob 'alteration-alist)))
    ;; limited to flat-cancellation
    (if (every negative? (map cdr alteration-alist))
    '((("accidentals.natural" . "accidentals.natural") . 0.2))
    '())))
    
    \layout {
    \foo
    }
    
    <<
    { \key aes \major s1 \key c \major s }
    { \key e \major s1 \key c \major s }
    >>
    

    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

     
  • Torsten Hämmerle

    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

     
  • Torsten Hämmerle

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,5 @@
    +http://codereview.appspot.com/343020043
    +
     From:  foxfanfare
    
    • Needs: -->
    • Type: -->
     
  • Torsten Hämmerle

    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.

     
  • Anonymous

    Anonymous - 2018-04-25

    Passes make, make check and a full make doc.

    Reg test diffs can be downloaded from here:

    https://cloud.indie.host/s/48HekyfYcZexSXG

     
  • Anonymous

    Anonymous - 2018-04-25
    • Patch: new --> review
    • Type: --> Enhancement
     
  • Anonymous

    Anonymous - 2018-04-27
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2018-04-27

    Patch on countdown for April 30th.

     
  • Anonymous

    Anonymous - 2018-04-30
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2018-04-30

    Patch counted down; please push.

     
  • Anonymous

    Anonymous - 2018-05-03
    • labels: --> Fixed_2_21_0
    • status: Started --> Fixed
    • Patch: push -->
     
  • Anonymous

    Anonymous - 2018-05-03
    issue 5312: Key cancellation glyph position inconsistent staging
    author  Torsten Hämmerle <torsten.haemmerle@web.de> 
        Tue, 24 Apr 2018 17:54:17 +0100 (18:54 +0200)
    committer   James Lowe <pkx166h@runbox.com> 
        Thu, 3 May 2018 13:09:55 +0100 (13:09 +0100)
    commit  25947481eac954d146eae49910ea66bb0106d403
    
     
    • Torsten Hämmerle

      Thank you, James!

       
MongoDB Logo MongoDB