Re: Bug in \offset with Fingering.font-size?

2014-11-01 Thread David Nalesnik
On Sat, Nov 1, 2014 at 4:34 PM, Trevor Daniels t.dani...@treda.co.uk
wrote:

 Should \offset work with the font-size of fingering?  It doesn't seem to.
 The default value is -5, so offsetting by -2 should give -7, with a size as
 shown by the \override and \tweak, but both forms of \offset give 0.

 {
   \set fingeringOrientations = #'(left)
   a'-24
   \override Fingering.font-size = #-7
   a'-2
   \once \offset font-size #-2 Fingering
   a'-2
   a'-\tweak font-size #-7 -2
   a'-\offset font-size #-2 -2
 }


You're seeing this behavior with \offset because 'font-size can't be set to
a callback, which \offset does. You can see the same behavior here:

 {
  \set fingeringOrientations = #'(left)
  a'-24
  \override Fingering.font-size = #(lambda (grob) -7)
  a'-2
}

You get the same result setting font-size to ##f or 0.

Enhancing 'font-size to process callbacks would be a useful feature, I
think.

--David
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Bug in \offset with Fingering.font-size?

2014-11-01 Thread Trevor Daniels

David Nalesnik wrote Saturday, November 01, 2014 9:46 PM

 On Sat, Nov 1, 2014 at 4:34 PM, Trevor Daniels t.dani...@treda.co.uk wrote:

 Should \offset work with the font-size of fingering?  It doesn't seem to.  
 The default value is -5, so offsetting by -2 should give -7, with a size as 
 shown by the \override and \tweak, but both forms of \offset give 0.

 You're seeing this behavior with \offset because 'font-size can't be set to a 
 callback, which \offset does.

 Enhancing 'font-size to process callbacks would be a useful feature, I think.

Thanks, I see.  I agree, although a warning might be a pro tem stand-in.

There goes my first example of its use for the docs :(

Trevor
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Bug in \offset with Fingering.font-size?

2014-11-01 Thread Trevor Daniels

 David Nalesnik wrote Saturday, November 01, 2014 9:46 PM

 On Sat, Nov 1, 2014 at 4:34 PM, Trevor Daniels t.dani...@treda.co.uk wrote:

 Should \offset work with the font-size of fingering?  It doesn't seem to.  
 The default value is -5, so offsetting by -2 should give -7, with a size as 
 shown by the \override and \tweak, but both forms of \offset give 0.

 You're seeing this behavior with \offset because 'font-size can't be set to 
 a 
 callback, which \offset does.

 Enhancing 'font-size to process callbacks would be a useful feature, I think.
 
 Thanks, I see.  I agree, although a warning might be a pro tem stand-in.
 
 There goes my first example of its use for the docs :(

It also fails to work on Script.padding, although it's fine for 
DynamicLineSpanner.padding.
{
c'4\fermata
\override Script.padding = 3
c'4\fermata
\offset padding 3 Script 
c'4\fermata
}

Is this a similar problem?

Trevor
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Bug in \offset with Fingering.font-size?

2014-11-01 Thread David Nalesnik
On Sat, Nov 1, 2014 at 4:56 PM, Trevor Daniels t.dani...@treda.co.uk
wrote:


 David Nalesnik wrote Saturday, November 01, 2014 9:46 PM
 
  On Sat, Nov 1, 2014 at 4:34 PM, Trevor Daniels t.dani...@treda.co.uk
 wrote:
 
  Should \offset work with the font-size of fingering?  It doesn't seem
 to.
  The default value is -5, so offsetting by -2 should give -7, with a
 size as
  shown by the \override and \tweak, but both forms of \offset give 0.
 
  You're seeing this behavior with \offset because 'font-size can't be set
 to a
  callback, which \offset does.
 
  Enhancing 'font-size to process callbacks would be a useful feature, I
 think.

 Thanks, I see.  I agree, although a warning might be a pro tem stand-in.


Yes, that would be good.  I believe this question has cropped up before.



 There goes my first example of its use for the docs :(


Oh!  You're tackling the documentation?  I'm so glad to hear that :) :)

I might have an example or two from when I was trying (unsuccessfully of
course) to write something up.  I think I may have been fooling with
Beam.positions.

Have you seen the regtest offsets.ly?  Maybe one of those examples is
workable.

--David
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Bug in \offset with Fingering.font-size?

2014-11-01 Thread David Nalesnik
On Sat, Nov 1, 2014 at 5:29 PM, Trevor Daniels t.dani...@treda.co.uk
wrote:


  David Nalesnik wrote Saturday, November 01, 2014 9:46 PM
 
  On Sat, Nov 1, 2014 at 4:34 PM, Trevor Daniels t.dani...@treda.co.uk
 wrote:
 
  Should \offset work with the font-size of fingering?  It doesn't seem
 to.
  The default value is -5, so offsetting by -2 should give -7, with a
 size as
  shown by the \override and \tweak, but both forms of \offset give 0.
 
  You're seeing this behavior with \offset because 'font-size can't be
 set to a
  callback, which \offset does.
 
  Enhancing 'font-size to process callbacks would be a useful feature, I
 think.
 
  Thanks, I see.  I agree, although a warning might be a pro tem stand-in.
 
  There goes my first example of its use for the docs :(

 It also fails to work on Script.padding, although it's fine for
 DynamicLineSpanner.padding.
 {
 c'4\fermata
 \override Script.padding = 3
 c'4\fermata
 \offset padding 3 Script
 c'4\fermata
 }

 Is this a similar problem?


Actually, no.  To work, \offset needs access to a default value--a number,
number-pair, or list of number-pairs--or a default procedure to calculate
these values with.  If you don't find an entry in define-grobs.scm, it will
have nothing to work with.

DynamicLineSpanner.padding works because it's set by default to 0.6.

--David
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Bug in \offset with Fingering.font-size?

2014-11-01 Thread Trevor Daniels

David Nalesnik wrote Saturday, November 01, 2014 10:40 PM

 Oh!  You're tackling the documentation?  I'm so glad to hear that :) :)

 I might have an example or two from when I was trying (unsuccessfully of 
 course) to write something up.  I think I may have been fooling with 
 Beam.positions.

 Have you seen the regtest offsets.ly?  Maybe one of those examples is 
 workable. 

Yes, I have it in front of me.  Actually, what I was doing was going through
the LM looking for existing examples where \offset might be useful.  It has
to be something where a displacement makes more sense than an absolute
value.  I found two, moving a fermata up a bit with padding and changing the
font size of fingering, but sods' law, neither of these work.  We don't cover
DynamicLineSpanners there, so that's not a possibility, and for most other
objects we have extra-offset, which is covered in the LM and does more or
less what \offset does re moving objects.

So I'm rethinking.  There are too many places where it goes wrong to 
explain in the LM - the concepts of callbacks and define-grobs.scm are
too advanced - and the inverted syntax of the \override form similarly is
potentially confusing in the LM, where users are just beginning to grasp
the \override syntax.  So maybe it is better to document it just in the NR, 
where all this complication can simply be stated, and any property can
be chosen to offset.

I'll abandon my patch to the LM and see what I can do for the NR.

Trevor
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Bug in \offset with Fingering.font-size?

2014-11-01 Thread Trevor Daniels

David Nalesnik wrote Saturday, November 01, 2014 10:53 PM

 On Sat, Nov 1, 2014 at 5:29 PM, Trevor Daniels t.dani...@treda.co.uk wrote:

 It also fails to work on Script.padding, although it's fine for 
 DynamicLineSpanner.padding.

Is this a similar problem?

 Actually, no.  To work, \offset needs access to a default value--a number, 
 number-pair, or list of number-pairs--or a default procedure to calculate 
 these values with.  If you don't find an entry in define-grobs.scm, it will 
 have nothing to work with.

 DynamicLineSpanner.padding works because it's set by default to 0.6.

Hm.  I wonder if it would go badly wrong if it simply assumed 0 in
such cases? Or #'(0 . 0) - whatever it was expecting.  You'd have to assume
the form given in the passed offset value was correct, I suppose.  In
other words, work as if it were \override or \tweak.

Trevor
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Bug in \offset with Fingering.font-size?

2014-11-01 Thread David Nalesnik
On Sat, Nov 1, 2014 at 6:21 PM, Trevor Daniels t.dani...@treda.co.uk
wrote:


 David Nalesnik wrote Saturday, November 01, 2014 10:53 PM

 To work, \offset needs access to a default value--a number,
  number-pair, or list of number-pairs--or a default procedure to calculate
  these values with.  If you don't find an entry in define-grobs.scm, it
 will
  have nothing to work with.
 
  DynamicLineSpanner.padding works because it's set by default to 0.6.

 Hm.  I wonder if it would go badly wrong if it simply assumed 0 in
 such cases? Or #'(0 . 0) - whatever it was expecting.  You'd have to assume
 the form given in the passed offset value was correct, I suppose.  In
 other words, work as if it were \override or \tweak.


That's a really interesting idea.  I'll have to try it out to see what kind
of effect it has in practice.

Wouldn't it just be duplicating the effect of an ordinary override of the
property?  Would this be a better behavior than what happens
currently--maybe give a warning no default found, using 0.0 and at least
do something nice?

Actually, it might not be hard to enhance \offset to deal with Script.  The
defaults aren't stored in define-grobs, rather they're in script.scm. I'll
look into that.

--David
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Bug in \offset with Fingering.font-size?

2014-11-01 Thread David Nalesnik
On Sat, Nov 1, 2014 at 6:53 PM, David Nalesnik david.nales...@gmail.com
wrote:



 Actually, it might not be hard to enhance \offset to deal with Script.
 The defaults aren't stored in define-grobs, rather they're in script.scm.
 I'll look into that.


The defaults are available, yes, but then we run into the same
problem--Script.padding will not work with callbacks:

{
  \override Script.padding = #(lambda (grob) 7)
  d\staccato
}

;(
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Bug in \offset with Fingering.font-size?

2014-11-01 Thread Trevor Daniels

David Nalesnik wrote Saturday, November 01, 2014 11:53 PM

 On Sat, Nov 1, 2014 at 6:21 PM, Trevor Daniels t.dani...@treda.co.uk wrote:

 David Nalesnik wrote Saturday, November 01, 2014 10:53 PM

To work, \offset needs access to a default value--a number,
 number-pair, or list of number-pairs--or a default procedure to calculate
 these values with.  If you don't find an entry in define-grobs.scm, it will
 have nothing to work with.

 DynamicLineSpanner.padding works because it's set by default to 0.6.

 Hm.  I wonder if it would go badly wrong if it simply assumed 0 in
 such cases? Or #'(0 . 0) - whatever it was expecting.  You'd have to assume
the form given in the passed offset value was correct, I suppose.  In
 other words, work as if it were \override or \tweak.

 Wouldn't it just be duplicating the effect of an ordinary override of the 
 property?

Well, yes.  But the point of \offset is that the user doesn't know and doesn't
need to know what the default value is or whether it has a default value or
not.  He or she just wants to shift it a little from where it currently is.

 Would this be a better behavior than what happens currently--maybe 
 give a warning no default found, using 0.0 and at least do something nice?

I don't think a warning would be necessary (assuming you find it works
well).  It would do exactly what the user was expecting.

 Actually, it might not be hard to enhance \offset to deal with Script.  
 The defaults aren't stored in define-grobs, rather they're in script.scm. 
 I'll look into that.

Great!  I've just found two good examples serendipitously with layout
queries from Noeck.  So I'll work with them.  Tomorrow.  It's late.

Trevor
___
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond