David Kastrup <d...@gnu.org> writes: > "Phil Holmes" <em...@philholmes.net> writes: > >> ----- Original Message ----- >> From: <d...@gnu.org> >> To: <philehol...@googlemail.com>; <gra...@percival-music.ca> >> Cc: <lilypond-devel@gnu.org>; <re...@codereview-hr.appspotmail.com> >> 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 _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel