lilypond-devel
[Top][All Lists]
Advanced

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

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


From: David Kastrup
Subject: Re: Set indent based on instrument name (issue 6457049)
Date: Mon, 30 Jul 2012 00:25:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

David Kastrup <address@hidden> writes:

> "Phil Holmes" <address@hidden> writes:
>
>> ----- Original Message ----- 
>> From: <address@hidden>
>> To: <address@hidden>; <address@hidden>
>> Cc: <address@hidden>; <address@hidden>
>> Sent: Sunday, July 29, 2012 9:16 PM
>> Subject: Re: Set indent based on instrument name (issue 6457049)
>>
>>
>>> On 2012/07/29 18:20:16, PhilEHolmes wrote:
>>>> My first attempt at coding in LilyPond.  Treat me gently...
>>>
>>> I think we should be able to do better than just counting characters in
>>> a string.  It should be possible calculating physical string width,
>>> shouldn't it?
>>>
>>> http://codereview.appspot.com/6457049/
>>
>> Absolutely.  Count this as phase 1.  FWIW, this very simple approach
>> works surprisingly well.
>>
>> How would I calculate the string size?
>
> Is there a proctologist in this room?
>
> I mean, someone with experience doctoring the backend?  That's not
> really my specialty.

Just remembered a few things: you would likely use interpret-markup to
turn your markup (this does not need to be a string, though that's the
simplest case) into a stencil, and then use
(ly:stencil-extent sten X) to get the X extent of the stencil (likely an
interval).  There are probably C++ interfaces for that as well.

-- 
David Kastrup




reply via email to

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