[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Snippet: Using arbitrary markup with LyricHyphen
From: |
David F. |
Subject: |
Re: Snippet: Using arbitrary markup with LyricHyphen |
Date: |
Sat, 16 Mar 2019 13:37:17 -0600 |
On Mar 16, 2019, at 6:30 AM, Aaron Hill <address@hidden> wrote:
> This whole thing started as a way to automate setting the properties of
> LyricHyphen based on the current LyricText font. In my use case, I am
> preparing music for projection, which requires larger font sizes than typical
> for print. The default values for things like length, thickness, and height
> are not suitable and require manual tweaking.
>
> What I wanted is a way to measure the size of an actual hyphen in a font and
> have LyricHyphen's default stencil procedure draw a box accordingly.
> However, when using ly:stencil-extent against a simple glyph, the results did
> not reflect only the ink but also included spacing/kerning information for
> the glyph. Depending on the font, the effective width of a hyphen might be
> larger than it actually appears. The resulting LyricHyphen does not line up
> with nor properly mimic a real hyphen.
>
> Now, even if I could solve the detail with glyph outlines and get the right
> dimensions, there is still a problem that Lyric_hyphen::print uses a rounded
> box with a hard-coded corner radius for its stencil. In my case, the radius
> was too small compared to the actual hyphen in the font I was using, so it
> looks too "sharp".
>
> So, what I ended up doing was rewriting the LyricHyphen stencil procedure to
> use an actual hyphen glyph rather than try to draw something. And in the
> noble pursuit of generalization, the following approach supports *any*
> arbitrary markup.
I’ve been wanting this for quite a while. Thanks for sharing!!
David