[Top][All Lists]

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

Re: centering of instrument names

From: Joe Neeman
Subject: Re: centering of instrument names
Date: Fri, 29 May 2009 17:40:53 -0700

On Wed, 2009-05-27 at 21:35 +0100, Neil Puttock wrote:
> 2009/5/24 Joe Neeman <address@hidden>:
> > Fair enough, but I don't think 'padding has the right meaning here.
> > Ideally, 'padding should be the smallest distance between an
> > InstrumentName and the SystemStartXXX to its right. Here, it's the
> > distance between the rightmost InstrumentName and the leftmost
> > SystemStartXXX.
> Yes, it's definitely an abuse of 'padding, as was my original approach
> of applying the global shift using a 'padding callback.
> How about a slightly different approach whereby the correction is
> applied inside System_start_text::get_stencil (), but can be switched
> off if a user wants to revert to the existing behaviour using
> side-support-elements?

I wouldn't worry about preserving the existing behaviour. Anyway, with
your patch, individual instrument names can be adjusted by tweaking
their alignments. Also, I think the code that positions the stencil
should be kept outside System_start_text::get_stencil.

The sanest behaviour IMO is the behaviour of your current patch, but
with a different meaning for 'padding. I can see two ways to do this:
the quick&dirty way to get this is to replace
instrument-name::calc-combined-delimiters-offset with
instrument-name::calc-min-distance-to-support, which goes through all
the instrument names and finds the minimum distance necessary between
any instrument name and any grob in its support. The nicer way to get
the same effect would be to create an InstrumentNameColumn grob that is
the X-parent of all the InstrumentNames and do the instrument name
positioning in ly:instrument-name-column::calc-positioning-done.

Unless you're planning to do either of these (or something with the same
effect) soon, I'd say to go ahead and commit what you have now. Given
that you basically solved the bug a week ago, it seems silly to hold up
the fix over some minor quibbles about 'padding.

> I was hoping to be able to make use of the option in
> Side_position_interface::general_side_position () to ignore support
> extents when a user wants the global instrument name shift (instead of
> removing the instrument name acknowledger from
> System_start_delimiter_engraver), but it doesn't seem to work as I
> expected: though braces and squares are ignored completely, bars and
> brackets still count.

The reason is probably found at When
use_extents is false, the positioning still takes the support into
account, it just pretends that each grob in the support has an extent of
'(0 . 0). That is, they're still there, they're just infinitely thin
around their refpoints. So the effect depends on where the refpoint
normally lies within the extent of that grob.


reply via email to

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