Jump to content

Changing the default text font family: Difference between revisions

From LilyPond wiki
Update to 2.26
mNo edit summary
 
Line 2: Line 2:


<div class="nodoc">
<div class="nodoc">
Note: Starting with LilyPond 2.25.4, font selection works differently; the most usual cases can be handled by {{Convert-ly-devel}}.  See the [{{LILYDEVELDOC}}/notation/fonts ‘Notation’ manual] for more information.
Note: Starting with LilyPond 2.25.4, font selection works differently; the most usual cases can be handled by {{Convert-ly-stable}}.  See the [{{LILYSTABLEDOC}}/notation/fonts ‘Notation’ manual] for more information.
</div>
</div>



Latest revision as of 04:36, 6 August 2026

Here is how to override the default font families for text.

Note: Starting with LilyPond 2.25.4, font selection works differently; the most usual cases can be handled by convert-ly. See the ‘Notation’ manual for more information.

\version "2.26"

%{
You may have to install additional fonts.

Red Hat Fedora: dejavu-fonts-all

Debian GNU/Linux, Ubuntu: fonts-dejavu-core
                          fonts-dejavu-extra
%}

\paper {
  property-defaults.fonts.serif = "DejaVu Serif"
  property-defaults.fonts.sans = "DejaVu Sans"
  property-defaults.fonts.typewriter = "DejaVu Sans Mono"
}

{
  g'''4^\markup {
    DejaVu Serif: \bold bold
                  \italic italic
                  \italic \bold { bold italic }
  }
  g4_\markup {
    \sans {
      DejaVu Sans: \bold bold
                   \italic italic
                   \italic \bold { bold italic }
    }
  }
  g''2^\markup {
    \typewriter {
      DejaVu Sans Mono: \bold bold
                        \italic italic
                        \italic \bold { bold italic }
    }
  }
}