[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get text width in Scheme?
From: |
Han-Wen Nienhuys |
Subject: |
Re: How to get text width in Scheme? |
Date: |
Sun, 21 Sep 2008 17:54:24 -0300 |
On Fri, Sep 19, 2008 at 9:29 AM, Risto Vääräniemi <address@hidden> wrote:
> 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.
This is sort-of a bug. The 'font is only set in C++, from
Font_interface::get_default_font (Grob *me)
we should change this so it uses the standard property calculation
scheme. Then your sample code works correctly.
--
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen