The correct way to do this, which incidentally lily uses, is to use
binary search over the glyphs, until you've found the closest one.

On Sat, Nov 29, 2008 at 6:19 PM, Mats Bengtsson
<[EMAIL PROTECTED]> wrote:
> Quoting Neil Puttock <[EMAIL PROTECTED]>:
>
>> 2008/11/28 Mats Bengtsson <[EMAIL PROTECTED]>:
>>>
>>>
>>> Mats Bengtsson wrote:
>>>
>>> Now that I've looked a bit more careful, I see that the total height of
>>> braceN is given by
>>> 10.5*(1+1/150)^N
>>> so in other words, if the desired height is H, you can get the number of
>>> the
>>> corresponding
>>> brace glyph by
>>> (round (/ (log (/ H 10.5)) (log (+ 1 (/ 1 150)))))
>>
>> Thanks for working this out, Mats.
>>
>> How about a middle way, where we have a function to convert from
>> points -> brace number?  Then it's up to the user whether they want
>> direct access to a specific glyph, or conversion from points.
>
> I don't see the point. If a user had the possibility to specify the height
> in points (or any other sensible unit) as the argument, he'd never use the
> weird numbering that's used internally in LilyPond.
>
>   /Mats
>
>
>
> _______________________________________________
> lilypond-devel mailing list
> lilypond-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/lilypond-devel
>



-- 
Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to