Am 21.10.2018 um 11:03 schrieb David Kastrup:
Torsten Hämmerle <torsten.haemme...@web.de> writes:
David Kastrup wrote
Anything wrong with using a callback?
No, not at all, callbacks are fine and do solve the problem..
But given the fact that "aligning to the baseline" is specific to text so
that different up/down staff-padding values are rather the rule than the
exception, I thought it'd be nicer to simply say something like
\override TextScript.staff-padding = #'(3 . 4)
instead of having to define a custom callback function for a standard
situation.
Given how often this occurs, maybe we should create some function for
that purpose rather than putting pairs everywhere in peacemeal?
That sounds reasonable. Is there *any* chance that LilyPond actually
accesses the font metrics to *calculate* the difference?
What I would expect a proper "staff-padding" behaviour for texts would be:
* Define a property value in staff spaces, say "3"
* Then I would want the actual whitespace between the staff and the
innermost edge of the text to be three staff spaces.
* So for a text above the staff the distance to the text's baseline
should be 3 plus the (largest) lower extender's height, and
* for a text below the staff the distance to the text's baseline
should be 3 plus the (largest) capital's head (usually the X-height,
isn't it?)
Providing a pair would actually be doing that calculation by
trial-and-error.
One could probably calculate the difference "manually" by comparing the
extents of (transparent) "T", "j", and "Tj" markups, but it would
probably be more reliable if it could be retrieved from the font itself.
Urs
The principal question is what to do when the event does not have an
explicit direction. Then one would have to refer to the grob callback
instead, maybe?
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user