The most common thing to change about the appearance of fonts is their
size. The font size of any context can be easily changed by setting
the fontSize
property for that context. Its value is an
integer: negative numbers make the font smaller, positive numbers
larger. An example is given below:
c4 c4 \property Voice.fontSize = #-1 f4 g4
This command will set
font-relative-size
(see below), and does
not change the size of variable symbols, such as beams or slurs.
One of the uses of fontSize
is to get smaller symbol for cue
notes. An elaborate example of those is in
input/test/cue-notes.ly
.
The size of the font may be scaled with the object property
font-magnification
. For example, 2.0
blows up all
letters by a factor 2 in both directions.
The font used for printing a object can be selected by setting
font-name
, e.g.
\property Staff.TimeSignature \set #'font-name = #"cmr17"
Any font can be used, as long as it is available to TeX. Possible fonts include foreign fonts or fonts that do not belong to the Computer Modern font family.
Font selection for the standard fonts, TeX's Computer Modern fonts,
can also be adjusted with a more fine-grained mechanism. By setting
the object properties described below, you can select a different font;
all three mechanisms work for every object that supports
font-interface
:
font-family
roman
(Computer Modern), braces
(for piano staff
braces), music
(the standard music font, including ancient
glyphs), dynamic
(for dynamic signs) and typewriter
.
font-shape
italic
,
caps
and upright
.
font-series
medium
and bold
.
font-relative-size
There are small differences in design between fonts designed for
different sizes, hence font-relative-size
is preferred over
font-magnification
for changing font sizes.
font-design-size
This is a feature of the Computer Modern Font: each point size has a slightly different design. Smaller design sizes are relatively wider, which enhances readability.
For any of these properties, the value *
(i.e. the symbol
*
, entered as #'*
), acts as a wildcard. This can be used
to override default setting, which are always present. For example:
\property Lyrics . LyricText \override #'font-series = #'bold \property Lyrics . LyricText \override #'font-family = #'typewriter \property Lyrics . LyricText \override #'font-shape = #'*
The following commands set fontSize
for the current voice.
\tiny
,
\small
,
\normalsize
,
Relative size is not linked to any real size.
There is no style sheet provided for other fonts besides the TeX family, and the style sheet cannot be modified easily.
This page is for LilyPond-2.0.1 (stable-branch).