[Lilypond] Font sizes

Recommendations concerning notation and publishing software in a non-partisan environment.
User avatar
OCTO
Posts: 1742
Joined: 05 Oct 2015, 06:52
Location: Sweden

[Lilypond] Font sizes

Post by OCTO »

I have question regarding font sizes in LP:
Why do we have in Lilypond different font sizes? Can't be just one, as it is with the standard music fonts, as Sonata?
Freelance Composer. Self-Publisher.
Finale 27.3 • Sibelius 2023.5• MuseScore 4+ • Logic Pro X+ • Ableton Live 11+ • Digital Performer 10+ /// MacOS Monterey (secondary in use systems: Fedora 35, Windows 10)
User avatar
tisimst
Posts: 416
Joined: 08 Oct 2015, 17:57
Location: UT, USA
Contact:

Re: [Lilypond] Font sizes

Post by tisimst »

Of course you *can* have just one font, but it takes a little hacking. Not much, but it's not terribly obvious how (yes, I know how).

The real reason LP doesn't use a single font is because of the lack of cohesion when you have multiple staff sizes on the same page, or just smaller staves. If a font was designed for 20pt staff-size, then it looks too thin when scaled down, and if you aren't careful, some glyphs can become too thin to even see or print effectively. The built-in Emmentaler font has a range of font weights designed to combat this very issue. If a smaller staff size is used, in order for the glyphs to work well, LP uses a "heavier" font so it is more legible. There are similar fonts for large staff sizes.
Music Typeface Designer & Engraver - LilyPond | Sibelius | Finale | MuseScore | Dorico | SMuFL | Inkscape | FontForge
Knut
Posts: 867
Joined: 05 Oct 2015, 18:07
Location: Oslo, Norway

Re: [Lilypond] Font sizes

Post by Knut »

To me, this is one of Lilypond's strongest points. I wonder, however, if 8 different weights is strictly necessary, and which staff sizes each weight represents. Since Lilypond now supports Bravura, how does this font's 'double-weight scheme compare to Lilypond's standard weights?
User avatar
tisimst
Posts: 416
Joined: 08 Oct 2015, 17:57
Location: UT, USA
Contact:

Re: [Lilypond] Font sizes

Post by tisimst »

Knut wrote:To me, this is one of Lilypond's strongest points. I wonder, however, if 8 different weights is strictly necessary, and which staff sizes each weight represents.
They are designed for 11, 13, 14, 16, 18, 20, 23, and 26pt staff-sizes, and other sizes get the closest font size. Whether they are all necessary is certainly debatable.
Knut wrote:Since Lilypond now supports Bravura, how does this font's 'double-weight scheme compare to Lilypond's standard weights?
Well, it does and it doesn't support Bravura. LilyPond doesn't support SMuFL. Since Bravura's font encoding is completely different from Emmentaler's, you have to use some clever hacks to even use it as it is. I've copied over quite a few of the glyphs to Emmentaler's font encoding (called Profondo), but it doesn't have all the glyphs from Bravura. I have plans to finish porting over ALL the glyphs, but we'll see when I get to it. That being said, I think Daniel S. might could comment on the *intended* sizes for for the double-weight scheme?
Music Typeface Designer & Engraver - LilyPond | Sibelius | Finale | MuseScore | Dorico | SMuFL | Inkscape | FontForge
Knut
Posts: 867
Joined: 05 Oct 2015, 18:07
Location: Oslo, Norway

Re: [Lilypond] Font sizes

Post by Knut »

tisimst wrote: Since Bravura's font encoding is completely different from Emmentaler's, you have to use some clever hacks to even use it as it is. I've copied over quite a few of the glyphs to Emmentaler's font encoding (called Profondo), but it doesn't have all the glyphs from Bravura.
I'm mainly asking because I'm currently developing a SMuFL compliant music font, and I plan to support as many applications as possible, including Lilypond, so I'll be interested to know the nature of all these 'hacks' when the design is ready. Anyway, it sounds like the easiest thing to do would be to make a dedicated font file available if SMuFL isn't supported by Lilypond at the time of release. As far as I remember, though, you still need a hack for Lilypond to handle the use of just one single font for all staff sizes, correct?
tisimst wrote:That being said, I think Daniel S. might could comment on the *intended* sizes for for the double-weight scheme?
I'm familiar with the intended size of the stylistic alternates for small staff in SMuFL and Bravura. They are dedicated to a staff size around 75% of that used for the main glyph set. I was under the impression that Lilypond already could make use of Bravura's entire range of glyphs, so I was asking to hear your impression of the usability compared to the Lilypond fonts with regard to staff sizes.

My impression is that eight different weights is a bit much for most situations, but that three should be a minimum to cover the bases from instrumental parts to study scores. Unfortunately there isn't room in SMuFL for any extensive glyph collection in two alternate weights, but, at least in time, I plan to support the same one Bravura does for as many glyphs as possible.
User avatar
tisimst
Posts: 416
Joined: 08 Oct 2015, 17:57
Location: UT, USA
Contact:

Re: [Lilypond] Font sizes

Post by tisimst »

Knut wrote: I'm mainly asking because I'm currently developing a SMuFL compliant music font, and I plan to support as many applications as possible, including Lilypond, so I'll be interested to know the nature of all these 'hacks' when the design is ready. Anyway, it sounds like the easiest thing to do would be to make a dedicated font file available if SMuFL isn't supported by Lilypond at the time of release. As far as I remember, though, you still need a hack for Lilypond to handle the use of just one single font for all staff sizes, correct?
I knew you were, as I also follow the SMuFL mailing list :-).

Well, thanks to the effort of LilyPond user Torsten Hämmerle, and with a follow-up by Nathan Ho, SMuFL fonts can *mostly* be used just as they are. Their code basically goes through the majority of the western notation glyphs and substitutes in those from the SMuFL font at run-time. It actually works pretty nicely, but it also means that in some instances a glyph cannot be substituted (like with the trill wiggle "~") since they are hard-coded deep within LilyPond and don't have the top-level access like the others. I've tried to figure out a way around it as I helped Robert Piéchaud get November 2.0 working with LilyPond, but without success. One nice thing, though, is that all SMuFL glyphs can be accessed via markup functions so that the user can grab specific ones and do things with them if they want (this is how all the other hacks do it). So, the best thing I can tell you is that your font will work *mostly* without much effort, but not perfectly if left in pure SMuFL format. I don't see LilyPond internally supporting SMuFL anytime soon. I've thought about taking the task on, but have no time for it at the moment. If you were interested in making your font work natively like Emmentaler, send me a PM to discuss. And, yes, it does take a small hack to make a single font work, but we can deal with that later.
Knut wrote: I'm familiar with the intended size of the stylistic alternates for small staff in SMuFL and Bravura. They are dedicated to a staff size around 75% of that used for the main glyph set.
Sorry, that's not what I meant. I knew that, too. I guess my question comes from my use of LilyPond, which doesn't scale the staff-line thickness when staves change size. This means that as the staff-height gets smaller, the relative size of the staff-lines becomes larger, which suits Bravura better, IMHO. But what is the optimal staff-line thickness for Bravura? I don't know that.
Knut wrote:I was under the impression that Lilypond already could make use of Bravura's entire range of glyphs, so I was asking to hear your impression of the usability compared to the Lilypond fonts with regard to staff sizes.
"Can/Could" is the right word here. Can, but doesn't, as I explained above. The thing to remember is that LilyPond fonts are designed to work at ALL the common staff sizes without compromising legibility. For example, take a large orchestral score and you'll notice that LilyPond's rendition will be heavier than from other programs. If you change the staff-height to accommodate more systems on the page, you aren't just scaling the font (most likely), but choosing a better font designed for that size of staves. At the moment, the LilyPond -> SMuFL hacks haven't been coded in such a way that can utilize both weights. The heavier glyphs are ignored. Seems like that would be a great new feature if someone wanted to implement it. I have some ideas, but no time at the moment to do so. Actually, I have a LOT of ideas for improving LilyPond's SMuFL support. Perhaps in the future.
Knut wrote:My impression is that eight different weights is a bit much for most situations, but that three should be a minimum to cover the bases from instrumental parts to study scores. Unfortunately there isn't room in SMuFL for any extensive glyph collection in two alternate weights, but, at least in time, I plan to support the same one Bravura does for as many glyphs as possible.
You're probably right, especially if the user mostly works with standard staff-sizes. I would think there aren't too many composers out there that would insist on many different staff-sizes in the same score.
Music Typeface Designer & Engraver - LilyPond | Sibelius | Finale | MuseScore | Dorico | SMuFL | Inkscape | FontForge
User avatar
tisimst
Posts: 416
Joined: 08 Oct 2015, 17:57
Location: UT, USA
Contact:

Re: [Lilypond] Font sizes

Post by tisimst »

Cross-post to a discussion about staff-line thickness since I brought it up above: viewtopic.php?f=2&t=51
Music Typeface Designer & Engraver - LilyPond | Sibelius | Finale | MuseScore | Dorico | SMuFL | Inkscape | FontForge
Knut
Posts: 867
Joined: 05 Oct 2015, 18:07
Location: Oslo, Norway

Re: [Lilypond] Font sizes

Post by Knut »

tisimst wrote:If you were interested in making your font work natively like Emmentaler, send me a PM to discuss. And, yes, it does take a small hack to make a single font work, but we can deal with that later.
Thank you! I might take you up on that offer when the designs are ready. I'll definitely PM you then.
tisimst wrote:Sorry, that's not what I meant. I knew that, too. I guess my question comes from my use of LilyPond, which doesn't scale the staff-line thickness when staves change size. This means that as the staff-height gets smaller, the relative size of the staff-lines becomes larger, which suits Bravura better, IMHO. But what is the optimal staff-line thickness for Bravura? I don't know that.
According to the Bravura metadata file, the default staff line thickness is 1.13 spaces. Since scaling the line thickness would basically defeat the purpose of alternate glyphs for smaller sizes, my understanding is that the stylistic alternates for small staff in bravura are designed for this line thickness as well.
User avatar
tisimst
Posts: 416
Joined: 08 Oct 2015, 17:57
Location: UT, USA
Contact:

Re: [Lilypond] Font sizes

Post by tisimst »

Perfect. Thanks for pointing that out. I think you mean 0.13 spaces. LilyPond's default (20pt font size) is 0.1 spaces, but ranges from 0.1514 spaces @ 11pt to 0.0864 spaces @ 26pt.
Music Typeface Designer & Engraver - LilyPond | Sibelius | Finale | MuseScore | Dorico | SMuFL | Inkscape | FontForge
User avatar
OCTO
Posts: 1742
Joined: 05 Oct 2015, 06:52
Location: Sweden

Re: [Lilypond] Font sizes

Post by OCTO »

Dear Knut and tisimst, thank you for describing that in details!
I am amazed how Lilypond treats fonts. I think it is close to what SCORE did.
There is another thread about the resized staff, and the font abilities in Lilypond is something astonishing, which interests me quite a lot.

I hope that new Sib/Fin/*Steinberg will be able to implement it in the future versions.
Freelance Composer. Self-Publisher.
Finale 27.3 • Sibelius 2023.5• MuseScore 4+ • Logic Pro X+ • Ableton Live 11+ • Digital Performer 10+ /// MacOS Monterey (secondary in use systems: Fedora 35, Windows 10)
Post Reply