lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TextScript.outside-staff-padding and text's baseline


From: Urs Liska
Subject: Re: TextScript.outside-staff-padding and text's baseline
Date: Sun, 21 Oct 2018 11:37:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1



Am 21.10.2018 um 11:03 schrieb David Kastrup:
Torsten Hämmerle <address@hidden> 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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]