On Wed, Apr 19, 2017 at 9:16 PM, Abraham Lee <tisimst.lilyp...@gmail.com>
wrote:

>
> On Wed, Apr 19, 2017 at 8:03 PM Kieren MacMillan <
> kieren_macmil...@sympatico.ca> 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
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to