[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Alignment of instrument names
From: |
Alexander Kobel |
Subject: |
Re: Alignment of instrument names |
Date: |
Thu, 10 Nov 2016 17:15:58 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 |
On 2016-11-10 16:34, Simon Albrecht wrote:
On 10.11.2016 15:28, Francesco Napoleoni wrote:
(how) can I get instrument names at the start of staves
automatically aligned to the internal page margin?
Unfortunately you can’t. There already is a request for that feature in
our issue tracker, but it hasn’t been implemented yet.
Hm. Shouldn't it be possible to work around this restriction with
something in the line of:
\version "2.19.49"
\paper {
indent =
#(let* ((layout '()) ;; <=== How to get the default layout here?!
(text-props (ly:output-def-lookup layout 'text-font-defaults))
(stil (ly:text-interface::interpret-markup layout text-props
(markup "Supercalifragilisticexpialidocious")))
(xext (ly:stencil-extent stil X))
(width (- (cdr xext) (car xext))))
width)
}
\new Staff \with {
instrumentName = "Supercalifragilisticexpialidocious"
} { c'1 \break c'1 }
The goal being to adjust the indent to fit the largest instrumentName
(manually selected and entered before any content is inserted). The
above code will not work, though, because I don't know how to get some
layout object at this point...
Any hints?
Cheers,
Alexander