Hallo there

I was looking to revamp my DIY fingering functions in the light of features available when moving from 2.18 to 2.20, e.g. I can get tighter positioning via TextScript.parent-alignment-X.

There is a 'ringed' function for fingerings which need highlighting. Its bulbous \circle now seems rather wasteful of width, so I thought I could try \rounded-box instead. Well, it could certainly made be narrower and still readable, but it has spurious padding which wastes width too.

This padding bug was found a year ago
http://lists.gnu.org/archive/html/bug-lilypond/2018-03/msg00022.html
and it should be gone by 2.21.0.
https://sourceforge.net/p/testlilyissues/issues/5307/



My workaround involved using \with-dimensions-from to apply the extents of a throwaway corner-radius_0 version to the wanted rounded version.
This was ugly but effective.
Today I inadvertently changed that 0 to 1 and it still worked!


So here is a compact workaround - attached, as \rounded-boxx.


It uses the rounded version to correctly crop itself.
This is beyond the extent of my explanatory powers.
Note that \pad-x 0 is ineffective, presumably because it sets the extents in a different way.


Cheers,
Robin
\version "2.18.2"

#(ly:set-option 'debug-skylines)

% needed before 2_19_37
#(define-markup-command (with-dimensions-from layout props arg1 arg2)
  (markup? markup?)
  (let* ((stil1 (interpret-markup layout props arg1))
    (x (ly:stencil-extent stil1 0))
    (y (ly:stencil-extent stil1 1)))
    (interpret-markup layout props (markup #:with-dimensions x y arg2))))

% workaround
#(define-markup-command (rounded-boxx layout props args) (markup?)
  (let * ((m (make-rounded-box-markup (markup args))))
   (interpret-markup layout props (markup #:with-dimensions-from m m))))


{
%  \override TextScript.stencil =
%  #(make-stencil-boxer 0.03 0 ly:text-interface::print)
  \textLengthOn
  s1
  s1_\markup \rounded-box "-box"
  s1_\markup \rounded-boxx "-boxx"
%  s1_\markup \pad-x #0 \rounded-box "pad-x"
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to