lilypond-user
[Top][All Lists]
Advanced

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

Re: how to get markup formatting to survive a font-name change


From: Abraham Lee
Subject: Re: how to get markup formatting to survive a font-name change
Date: Thu, 20 Apr 2017 10:10:10 -0600



On Wed, Apr 19, 2017 at 9:50 PM, Kieren MacMillan <address@hidden> wrote:
Abraham,

> The \paper block should look like this (and this should be below any #(set-global-staff-size ...) because that resets the "fonts" variable and you need to add to it):
>
> %%%%%%%%%%%%%
>
> \paper {
>   #(add-pango-fonts fonts 'minion "Minion Pro" (/ staff-height pt 20))
>   bookTitleMarkup = ##f
>   scoreTitleMarkup = \markup {
>     \override #'(font-family . 'minion)
>     \fromproperty #'header:title
>   }
> }
>
> %%%%%%%%%%%%%
>
> Now, the font choice should propagate through to the \italic command.

This is fabulous! Thanks. It also propagates through \bold, with is wonderful.
But my family (Crimson Text) has bold and semibold variants — can I have access to both?

Yes and no. By default, no. When you run add-pango-fonts, it only creates entries for the following weight-style combinations: 
1. normal-upright
2. normal-caps
3. bold-upright
4. normal-italic
5. bold-italic

If there isn't one of those variants, pango seems to fall-back to a closest relative in the family.

So, you have three options:
1. do nothing and live with the above combinations
2. create a new font family that has the desired semibold as the "normal", which would also grab the semibold italic as well
3. modify the add-pango-fonts function to create more nodes, but I'm not sure if Pango knows how to grab variants outside of those listed above. The nice thing is that you can modify font.scm without needing to re-compile everything from source. I'll try adding a couple of combinations to see what happens and report back. Otherwise, it might be a more involved re-write to get convenient access to less common font variants without specifying the exact font name.

I know that there was some work a while back by Alexander Kobel on extending this to a larger family of weights/styles/widths/etc., but I don't think it ever got finished, or did it? Perhaps Alexander can comment. This would be a great feature, IMO.

Best,
Abraham

reply via email to

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