[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using ly:get-glyph, ly:font-get-glyph
From: |
Han-Wen Nienhuys |
Subject: |
Re: using ly:get-glyph, ly:font-get-glyph |
Date: |
Mon, 19 Jan 2009 11:37:43 -0200 |
On Mon, Jan 19, 2009 at 6:10 AM, Werner LEMBERG <address@hidden> wrote:
>
>> It says that each can "Retrieve a stencil", which strikes me as
>> useful. I was actually looking for a scheme-way of accessing
>> stencils, but the function description is bewildering to me.
>
> Well, improvements are welcome :-)
>
>> Can I somehow use it like this...
>> \once \override NoteHead #'stencil = #(ly:get-glyph font index)
You can't do it this easily. The font elements within stencils must
constructed correctly to correspond with scaling factors: LilyPond
sets up the font sizes such that 1.0 unit of distance corresponds with
a staff-space. Since this depends on \paper and \layout settings, you
have to have a font as returned by (for example) ly:grob-default-font.
Typically, this happens from within a grob callback.
Grep for ly:font-get-glyph in the scm directory for examples.
ly:get-glyph should probably be removed as it presupposes some kind of
unspecified encoding.
--
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen