Hi Valentin, 2008/9/19 Valentin Villenave <[EMAIL PROTECTED]>: > 2008/9/19 Risto Vääräniemi <[EMAIL PROTECTED]>: > >> Can someone tell me how I can get the text width inside scheme? > > I think you might be interested in using ly:stencil-extent > (not sure though)
Yes, that might be another option. However, I've got a egg-hen problem here. Trevor's code creates the "X bis" text/stencil and I would like to move the whole schmeer to the right by the width of the " bis". I can get the width of the BarNumber #'stencil but that's not enough because the width already contains the width of the " bis". The X-offset is taken into account after the stencil has been formed. It seems that there is a way to change a piece of text into a stencil (fontify-text), however that uses the same ly:text-dimension font-metric text function. :-) Is there another way? I was hoping for something like this: #(define (bar-number-X BarNumber) "Move the text right by the width of bis" (let* ( (textBis " bis") (extentOrig (ly:stencil-extent (ly:grob-property BarNumber 'stencil) 0)) (widthOrig (- (cdr extentOrig) (car extentOrig))) (widthBis (ly:some-magical-function-to-get-width textBis))) (- widthBis widthOrig))) I could use it like this BarNumber #'X-offset = #bar-number-X This might be usable only for bar numbers that are positioned at the beginning of the staff. It would be a nice feature, anyway. -Risto _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user