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: Wed, 19 Apr 2017 21:42:07 -0600



On Wed, Apr 19, 2017 at 9:16 PM, Abraham Lee <address@hidden> wrote:

On Wed, Apr 19, 2017 at 8:03 PM Kieren MacMillan <address@hidden> wrote:
Hello all,

In the snippet, below, the font-name override kills the \italic as set in the \header.
Is there any way to avoid that [without having to hack the title into two separate functions/parameters]?

Thanks,
Kieren.

%%%  SNIPPET BEGINS
\version "2.19.59"

\paper {
  bookTitleMarkup = ##f
  scoreTitleMarkup = \markup {
    \override #'(font-name . "Minion Pro")
    \fromproperty #'header:title
  }
}

\header {
  title = \markup { "SATB chorus" \italic "a cappella" }
}

\new Devnull s1
%%%  SNIPPET ENDS

The reason it breaks the \italic is because you don't tell LilyPond that there _is_ an italic variant when all you do is override the font-name like that. 

The better way would be to add a text font to the "fonts" tree because it looks for the four standard family members (regular, italic, bold, and bold-italic). I think the scheme function is "add-text-fonts". You can find how it's used in the file [LILYDIR]/scm/font.scm.

With the font family added (let's say it's the 'minion family), you the change to it with

\markup {
  \override #'(font-family . 'minion)
  ...
}

And if Pangolin found the italic variant, you shouldn't need to do anything else other than \italic like normal.

Oh, boy. My phone's auto-correct... That should read "Pango".

Anyway, I realized I didn't give you a very complete (or correct) solution. So, let's try again. 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.

HTH,
Abraham

reply via email to

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