lilypond-user
[Top][All Lists]
Advanced

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

Re: Marking up titles - font-name and italics


From: tisimst
Subject: Re: Marking up titles - font-name and italics
Date: Thu, 24 Aug 2017 22:07:18 -0700 (MST)

Hi, Daniel!

On Thu, Aug 24, 2017 at 9:17 PM, Daniel Cory [via Lilypond] <[hidden email]> wrote:
Hello,

I have what seems to be a rather simple problem. I am trying to format the font of my piece title. I can change it to italics, and I can change the font name, but I just can't seem to do both. Please keep in mind that I am extremely new to lilypond, so I may be missing something simple, but here is my code.

\header {

   title = \markup {
      \override #'(font-name . "Arial")
      \italic
      {This is a test}

   }
}

I thought that maybe it was the braces around my text so I took them out, I've tried putting quotes around, I've tried changing the order of my markup. I just can't seem to do both font-name and another markup. Could someone please tell me what I'm doing wrong?

Here's what's going on. When you override 'font-name, you are very specifically changing the font to the one file who's internal name is "Arial". In other words, it doesn't tell LilyPond that there are other variants (like Italic, Bold, and Bold-Italic), just the exact one you specify. That is why nothing seems to happen when you use \italic here. If LilyPond doesn't think a italic/bold/whatever font variant is there, it falls back to the regular variant. 

So, what is to be done? In order for \italic, \bold, etc. to work in a markup, what you need to do as add Arial as a font-family. The easiest way is to set it as one of the main global text fonts, like 'sans. If you are using 2.18, then use make-pango-font-tree, as described here: 

http://lilypond.org/doc/v2.18/Documentation/notation/fonts#entire-document-fonts

make-pango-font-tree takes three inputs in this order: a roman (or serif) font, a sans-serif font, and typewriter (or monospace) font. So, all you need to do is make sure that you put "Arial" as the second input. Then, in the markup you can do

title = \markup { \sans \italic "This is a test" }

and it will display in the correct form you expected.

Hope that helps,
Abraham


View this message in context: Re: Marking up titles - font-name and italics
Sent from the User mailing list archive at Nabble.com.

reply via email to

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