| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section discusses score layout options for the \layout
block.
4.2.1 The \layout block | ||
| 4.2.2 Setting the staff size |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
\layout blockWhile the \paper block contains settings that relate to the
page formatting of the whole document, the \layout block
contains settings for score-specific layout. To set score layout
options globally, enter them in a toplevel \layout block.
To set layout options for an individual score, enter them in a
\layout block inside the \score block, after the
music. Settings that can appear in a \layout block
include:
layout-set-staff-size scheme function,
\context blocks, and
\paper variables that affect score layout.
The layout-set-staff-size function is discussed in the next
section, Setting the staff size. Context modifications are
discussed in a separate chapter; see
Modifying context plug-ins and
Changing context default settings.
The \paper variables that can appear in a \layout
block, with default values taken from the \paper block are:
line-width, ragged-right and ragged-last
(see \paper variables for widths and margins)
indent and short-indent
(see \paper variables for shifts and indents)
system-count
(see \paper variables for line breaking)
Here is an example \layout block:
\layout {
indent = 2\cm
\context {
\StaffGroup
\override StaffGrouper.staff-staff-spacing.basic-distance = #8
}
\context {
\Voice
\override TextScript.padding = #1
\override Glissando.thickness = #3
}
}
|
Multiple \layout blocks can be entered as toplevel expressions.
This can, for example, be useful if different settings are stored in
separate files and included optionally. Internally, when
a \layout block is evaluated, a copy of the current
\layout configuration is made, then any changes defined within
the block are applied and the result is saved as the new current
configuration. From the user’s perspective the \layout blocks
are combined, but in conflicting situations (when the same property
is changed in different blocks) the later definitions take precedence.
For example, if this block:
\layout {
\context {
\Voice
\override TextScript.color = #magenta
\override Glissando.thickness = #1.5
}
}
|
is placed after the one from the preceding example the 'padding
and 'color overrides for TextScript are combined, but
the later 'thickness override for Glissando replaces
(or hides) the earlier one.
\layout blocks may be assigned to variables for reuse later,
but the way this works is slightly but significantly different from
writing them literally.
If a variable is defined like this:
layoutVariable = \layout {
\context {
\Voice
\override NoteHead.font-size = #4
}
}
|
it will hold the current \layout configuration with the
NoteHead.font-size override added, but this combination
is not saved as the new current configuration. Be aware
that the ‘current configuration’ is read when the variable is
defined and not when it is used, so the content of the variable
is dependent on its position in the source.
The variable can then be used inside another \layout block,
for example:
\layout {
\layoutVariable
\context {
\Voice
\override NoteHead.color = #red
}
}
|
A \layout block containing a variable, as in the example above,
does not copy the current configuration but instead uses the
content of \layoutVariable as the base configuration for the
further additions. This means that any changes defined between the
definition and the use of the variable are lost.
If layoutVariable is defined (or \included) immediately
before being used, its content is just the current configuration plus
the overrides defined within it. So in the example above showing the
use of \layoutVariable the final \layout block would
consist of:
TextScript.padding = #1 TextScript.color = #magenta Glissando.thickness = #1.5 NoteHead.font-size = #4 NoteHead.color = #red |
plus the indent and the StaffGrouper overrides.
But if the variable had already been defined before the first
\layout block the current configuration would now contain
only
NoteHead.font-size = #4 % (written in the variable definition) NoteHead.color = #red % (added after the use of the variable) |
If carefully planned, \layout variables can be a valuable tool
to structure the layout design of sources, and also to reset the
\layout configuration to a known state.
Notation Reference: Changing context default settings.
Snippets: (snippets)Spacing section ‘Spacing’ in Snippets.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The default staff size is 20 points, which corresponds to a staff height of 7.03mm (one point is equal to 100/7227 of an inch, or 2540/7227 mm). The staff size may be changed in three ways:
\book block, to be precise), use
set-global-staff-size:
#(set-global-staff-size 14) |
The above example sets the global default staff size to 14pt (4.92mm) and scales all fonts accordingly.
layout-set-staff-size inside that score’s \layout
block:
\score {
…
\layout {
#(layout-set-staff-size 14)
}
}
|
\magnifyStaff command. For example, traditionally engraved
chamber music scores with piano often used 7mm piano staves while
the other staves were typically between 3/5 and 5/7 as large
(between 60% and 71%). To achieve the 5/7 proportion, use:
\score {
<<
\new Staff \with {
\magnifyStaff #5/7
} { … }
\new PianoStaff { … }
>>
}
|
If you happen to know which fontSize you wish to use, you
could use the following form:
\score {
<<
\new Staff \with {
\magnifyStaff #(magstep -3)
} { … }
\new PianoStaff { … }
>>
}
|
To emulate the look of traditional engraving, it is best to avoid reducing the thickness of the staff lines.
The Emmentaler font provides the set of Feta musical glyphs in eight different sizes; each one tuned for a different staff size. The smaller the glyph size, the “heavier” it becomes, so as to match the relatively thicker staff lines. Recommended glyphs sizes are listed in the following table:
| font name | staff height (pt) | staff height (mm) | use |
| feta11 | 11.22 | 3.9 | pocket scores |
| feta13 | 12.60 | 4.4 | |
| feta14 | 14.14 | 5.0 | |
| feta16 | 15.87 | 5.6 | |
| feta18 | 17.82 | 6.3 | song books |
| feta20 | 20 | 7.0 | standard parts |
| feta23 | 22.45 | 7.9 | |
| feta26 | 25.2 | 8.9 |
Notation Reference: Selecting notation font size, The Emmentaler font.
Snippets: (snippets)Spacing section ‘Spacing’ in Snippets.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by gub on July 13, 2020 using texi2html 1.82.
Andere talen: català, deutsch, español, français, italiano, 日本語.
Gebruik van automatische taalkeuze.