[Top][All Lists]

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

Re: Set indent based on instrument name (issue 6457049)

From: Phil Holmes
Subject: Re: Set indent based on instrument name (issue 6457049)
Date: Tue, 31 Jul 2012 16:13:20 +0100

----- Original Message ----- From: "David Kastrup" <address@hidden>
To: "Phil Holmes" <address@hidden>
Cc: <address@hidden>
Sent: Tuesday, July 31, 2012 3:40 PM
Subject: Re: Set indent based on instrument name (issue 6457049)

"Phil Holmes" <address@hidden> writes:

I can't actually help here since either problem description or what the
patch is trying to achieve is utterly absent from the issue.


"Set indent based on instrument name" is all that is described
anywhere.  _How_ the indent is supposed to be based on instrument names,
_when_ it is supposed to be based on instrument names, _what_ instrument
names it is supposed to be base on, _which_ indent is supposed to be
based on instrument names, _what_ problem this is trying to solve:

I draw a blank.  I can't even suggest what variables and organization to
use here since I have no clue what the problem is, and what the solution
tries to achieve.

Apologies - I intended to link to but clearly
omitted to do so.

The problem is that the left indent of staves is fixed with no
consideration of whether there is an instrument name to fit into that
indent.  So we can just about get away with "Violin", but any name
like "Baroque violin with horse hair strings" simply falls off the
left of the paper unless indent is manually adjusted.  The same is
true of short indent/short instrument name. In the same way that
lilypond moves music to avoid clashes and overlaps, it should
automatically adjust indent to accommodate the instrument names
used. IMHO it's the current worst example of poor typesetting that
lilypond provides.

So _how_ are you trying to accommodate?  Increase indent until the
instrument name fits wholly in the text width?  Let it stick out
somewhat?  How much?

Increase the indent until it accommodates the instrument name. That's the _only_ sensible option (and it's what Sibelius does, FWIW). If the user then discovers they have only one note per line because of a stupidly long name, they have the option of changing the name, putting it in a column, changing the font, etc. But they don't need to keep experimenting with indents.

What's worse is that the images used in the documentation _do_ shift
right to accommodate instrument names, with the result that the image
pushes off the left of the page, and black bars result.

They probably also shift left, basically ignoring indent completely.
Cropping images based on contents rather than extent is always asking
for problems.

It's how our documentation system works.

I'm not trying to take a shortcut - I'm wandering down the only road I
can find.  I first asked for some pointers as to how to do this a week
ago, and since then I've been trying to work out a solution.  It took
me all day on Sunday to get the version that counted letters, and all
day yesterday to work out how to go from
markup->SCM->stencil->interval->length.  I actually think that's a
fair improvement and I'm pretty pleased with progress so far.

I now understand I need to either store the indent length in something
to do with a score context, or re-initialise it whenever a new score
is created. I'll have a go at working out how to do that, but I don't
even understand how to access contexts from c++, so it seems like it
would be a continuing number of days of poring over the code to find

Any pointers (pun not intended) you could give to help me on my way
would be appreciated.

Where do indent and shortindent end up being used?  That's where the
results of your calculations likely need to be available.  And what kind
of variables you need to use depends on how the results from your
calculation are supposed to travel to the site of use.

There are 2 activities at work here. The first is lilypond detecting and acting upon instrumentName/shortInstrumentName (I'll call this name in future) changes. It does this with the Instrument_name_engraver and processes all the name changes before the indent is used to set the music. line_dimensions_int is then called by and to calculate where the music will be placed and then to place it on the stave.

Phil Holmes

reply via email to

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