Next: , Previous: Overview of text markup commands, Up: Text


8.1.8 Font selection

By setting the object properties described below, you can select a font from the preconfigured font families. LilyPond has default support for the feta music fonts. Text fonts are selected through Pango/FontConfig. The serif font defaults to New Century Schoolbook, the sans and typewriter to whatever the Pango installation defaults to.

Fonts selected in the way sketched above come from a predefined style sheet. If you want to use a font from outside the style sheet, then set the font-name property,

{
  \override Staff.TimeSignature #'font-name = #"Times"
  \override Staff.TimeSignature #'font-size = #2
  \time 3/4
  c'1_\markup {
    \override #'(font-name . "Vera Bold")
      { This text is in Vera Bold }
  }
}

[image of music]

Any font can be used, as long as it is available to Pango/FontConfig.

The size of the font may be set with the font-size property. The resulting size is taken relative to the text-font-size as defined in the \paper block.

See also

Init files: ly/declarations-init.ly contains hints how new fonts may be added to LilyPond.

This page is for LilyPond-2.6.3 (stable-branch).

Report errors to <bug-lilypond@gnu.org>.

Other languages: English.
Using automatic language selection.