lilypond-user
[Top][All Lists]
Advanced

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

How to get text width in Scheme?


From: Risto Vääräniemi
Subject: How to get text width in Scheme?
Date: Fri, 19 Sep 2008 15:29:45 +0300

Hi all,

Can someone tell me how I can get the text width inside scheme?

There's a method called ly:text-dimension that takes font metric and
the text as parameters and gives the dimensions. Alright - I should
get the font metric somehow. I tried (let ((fontMetr (ly:grob-property
BarNumber 'font))) (...)) but the fontMetr is not a font metric
(ly:font-metric? returns false) although the description in
font-interface made me think so.

In the end I'd like to have a function that could be used for
positioning the "bis'd" bar number so that the number part would be
aligned just like the normal bar numbers – right edge aligned with the
left edge of the staff. I could use extra-offset to move it but that
would not be nice. :-)

Trevor Daniels explains very well how to attach the "bis" part but the
alignment is still not optimal:
http://lists.gnu.org/archive/html/lilypond-user/2008-03/msg00195.html

I won't ask anything about ly:make-simple-closure yet. That'll come later. ;-)

-Risto




reply via email to

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