lilypond-user
[Top][All Lists]
Advanced

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

Re: Lyrics.LyricText.font-size in layout block


From: tisimst
Subject: Re: Lyrics.LyricText.font-size in layout block
Date: Tue, 19 Jul 2016 13:54:17 -0700 (MST)

Colin,

On Tue, Jul 19, 2016 at 1:55 PM, Colin Tennyson [via Lilypond] <[hidden email]> wrote:
I was looking for a way to change the font size of the lyrics in choir music

Looking around I came across a page describing a command 'fontsize' for use in markup sections
http://lilypond.org/doc/v2.18/Documentation/notation/font

On this page it is described that many font properties can be accessed via \override followed by dot notation
http://lilypond.org/doc/v2.18/Documentation/learning/using-variables-for-layout-adjustments
Example:
\override Lyrics.LyricText.font-shape = #'italic


Hmmmm, I figured it would be worth a shot to try a font size override in the layout block
first I tried:
\layout { Lyrics.LyricText.fontsize = #-1 }
that gave an error, so I tried the other one:
\layout { Lyrics.LyricText.font-size = #-1 }
Bingo!

My question is:
Is there documentation of what number I should give to get a particular decrease or increase in font size?

There is this page:
http://lilypond.org/doc/v2.18/Documentation/internals/lyrictext

From the above page:
The font size, compared to the ‘normal’ size. 0 is style-sheet’s normal size, -1 is smaller, +1 is bigger. Each step of 1 is approximately 12% larger; 6 steps are exactly a factor 2 larger. Fractional values are allowed.


But that is not what I'm getting.
I tried this:
\layout { Lyrics.LyricText.font-size = #-1 }
That reduced the lyrics font size to less than half of the default size, by the looks of it.

Next I tried this:
\layout { Lyrics.LyricText.font-size = #-0.2 }
I estimate that gave me about 3/4 of the default font size.


So I can sort of dial it in by trial and error, but of course it would be great to know the exact formula.

The formula isn't obvious beyond the "each step of 1 is approximately 12% larger", but it's not too complicated either. There are two other things, though. The "normal" size of 0 is 12pt when the staff size is 20pt (as defined in the add-pango-fonts function in scm/font.scm). However, the default font-size for LyricText is NOT 0, it's 1, as explained in the respective Internals Reference page you pointed to. So, the real default size of LyricText is 14pt. Here would be the "exact formula":

Given
- standard staff-height (20pt)
- normal text size (12pt)
- real staff-height (x)
- chosen font-size (y)

Then the final pt size is calculated to be:

real-lyric-font-size = x*(1+y/6)*(12/20)

Thus, at a real staff-height of 20 and font-size of 0, we get 11pt. At a font-size of 1, we get 14pt. At a staff-height of 18pt and a font-size of 1 we get 12.6pt.

HTH,
Abraham

P.S. Here is a recent thread that has code for allowing you to specify an absolute pt size (e.g., regardless of staff-height) instead of the relative 12% increments: 
http://lilypond.1069038.n5.nabble.com/can-baseline-skip-be-absolute-tp177131p177134.html


View this message in context: Re: Lyrics.LyricText.font-size in layout block
Sent from the User mailing list archive at Nabble.com.

reply via email to

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