}
@end lilypond
-@funindex \voiceXXXStyle
+@funindex \voiceOneStyle
+@funindex \voiceTwoStyle
+@funindex \voiceThreeStyle
+@funindex \voiceFourStyle
+@funindex \voiceNeutralStyle
The commands @code{\voiceXXXStyle} are mainly intended for use in
educational documents such as this one. They modify the color
note head, so that the voices may be easily distinguished.
Voice one is set to red diamonds, voice two to blue triangles,
voice three to green crossed circles, and voice four (not used
-here) to magenta crosses. We shall see later how commands like
-these may be created by the user.
+here) to magenta crosses; @code{\voiceNeutralStyle} (also not
+used here) reverts the style back to the default.
+We shall see later how commands like these may be created by the
+user.
See @ref{Visibility and color of objects} and
@ref{Using variables for tweaks}.
@funindex \voiceTwo
@funindex \voiceThree
@funindex \voiceFour
+@funindex \oneVoice
@funindex \new Voice
@cindex Voice contexts, creating
\score {
\new ChoirStaff {
\new Staff <<
- \context Voice = "verse" {
+ \new Voice = "verse" {
\versenotes \break
<<
\refrainnotesA
Print a @code{:|} bar line.
@item @code{(volta @var{text})}
-Print a volta bracket saying @var{text}. The text can be specified as
-a text string or as a markup text, see @ref{Formatting text}. Do not
-forget to change the font, as the default number font does not contain
-alphabetic characters;
-
+Print a volta bracket saying @var{text}.
@item @code{(volta #f)}
Stop a running volta bracket.
@end table
+Printing a @code{|:} bar line:
+
+@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+c1
+\set Score.repeatCommands = #'( start-repeat )
+d4 e f g
+c1
+@end lilypond
+
+Printing a @code{:|} bar line:
+
@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
-c4
-\set Score.repeatCommands = #'((volta "93") end-repeat)
-c4 b
-\set Score.repeatCommands = #'((volta #f))
-d4 e
+c1
+d4 e f g
+\set Score.repeatCommands = #'( end-repeat )
+c1
+@end lilypond
+
+Printing a volta bracket saying @var{text}. The text can be specified
+as a text string or as a markup text, see @ref{Formatting text}. Do
+not forget to change the font, as the default number font does not
+contain alphabetic characters.
+
+
+@lilypond[verbatim,quote,relative=2]
+c1
+d4 e f g
+\override Staff.VoltaBracket #'font-name = #"sans"
+\set Score.repeatCommands = #'( ( volta "1. Repeat to CHORUS" ) )
+f4 g a b
+\set Score.repeatCommands = #'( ( volta #f ) \text ( volta "2., 3. To VERSE" ) end-repeat )
+g4 a g a
+c1
@end lilypond
+Note: unless explicitly stopped as in the next example, the volta
+bracket will continue indefinitely.
+
+Stopping a running volta bracket:
+
+@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
+c1
+d4 e f g
+\set Score.repeatCommands = #'( ( volta #f ) ( volta "2" ) end-repeat )
+g4 a g a
+f4 e f
+\set Score.repeatCommands = #'( ( volta #f ) )
+d4
+c1
+@end lilypond
+
@c FIXME: improve visibility of bar lines link?
@seealso
@seealso
-@c Notation Reference: @re
+Snippets: @rlsr{Repeats}.
+
Georg Romstorfer
Gilles Thibault
Hernán J. González
+Hu Haipeng
Jay Anderson
James Kilfinger
Jean-Marie Mouchel
string
slashify (string file_name)
{
- replace_all (file_name, '\\', '/');
- replace_all (file_name, string ("//"), "/");
+ replace_all (&file_name, '\\', '/');
+ replace_all (&file_name, string ("//"), "/");
return file_name;
}
{
File_name c = *this;
- replace_all (c.dir_, string ("//"), string ("/"));
+ replace_all (&c.dir_, string ("//"), string ("/"));
vector<string> components = string_split (c.dir_, '/');
vector<string> new_components;
s += string (wid - s.length () + EXTRA_SPACES, ' ');
string help_text (gettext (l[i].help_str0_));
- replace_all (help_text, "\n",
+ replace_all (&help_text, "\n",
"\n" + string (wid + EXTRA_SPACES + 2, ' '));
tabstr += s + help_text + "\n";
}
string to_string (char const *format, ...)
__attribute__ ((format (printf, 1, 2)));
-string &replace_all (string &str, string find, string replace);
-string &replace_all (string &str, char find, char replace);
+string &replace_all (string* str, string const &find, string const &replace);
+string &replace_all (string* str, char find, char replace);
char *string_copy (string s);
int string_compare (string const &, string const &);
TODO: this O(n^2) in #occurences of find, due to repeated copying.
*/
string &
-replace_all (string &str, string find, string replace)
+replace_all (string *str, string const &find, string const &replace)
{
ssize len = find.length ();
- for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + len))
- str = str.replace (i, len, replace);
- return str;
+ for (ssize i = str->find (find); i != NPOS; i = str->find (find, i + len))
+ *str = str->replace (i, len, replace);
+ return *str;
}
string &
-replace_all (string &str, char find, char replace)
+replace_all (string *str, char find, char replace)
{
- for (ssize i = str.find (find); i != NPOS; i = str.find (find, i + 1))
- str[i] = replace;
- return str;
+ for (ssize i = str->find (find); i != NPOS; i = str->find (find, i + 1))
+ (*str)[i] = replace;
+ return *str;
}
char *
texidoc = "
Many piano scores have the dynamics centered between the two staves.
This requires a bit of tweaking to implement, but since the template is
-right here, you don't have to do the tweaking yourself.
+right here, you don't have to do the tweaking yourself. Note that
+the two piano staves will move closer together in any system that
+does not contain at least one dynamic marking.
"
doctitle = "Piano template with centered dynamics"
} % begin verbatim
\clef treble
\key c \major
\time 4/4
-
+
a4 b c d
}
\clef bass
\key c \major
\time 4/4
-
+
a2 c
}
% So that \cresc works, for example.
\alias Voice
\consists "Output_property_engraver"
-
+
\override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
\override DynamicLineSpanner #'Y-offset = #0
pedalSustainStrings = #'("Ped." "*Ped." "*")
pedalUnaCordaStrings = #'("una corda" "" "tre corde")
-
+
\consists "Piano_pedal_engraver"
\consists "Script_engraver"
\consists "Dynamic_engraver"
\consists "Text_engraver"
-
+
\override TextScript #'font-size = #2
\override TextScript #'font-shape = #'italic
-
+
\consists "Skip_event_swallow_translator"
-
+
\consists "Axis_group_engraver"
}
\context {
}
}
\score {
- \new PianoStaff <<
- \new Staff = "upper" << \upper \dynamics \pedal >>
- \new Staff = "lower" << \lower \dynamics \pedal >>
- >>
+ \unfoldRepeats {
+ \new PianoStaff <<
+ \new Staff = "upper" << \upper \dynamics \pedal >>
+ \new Staff = "lower" << \lower \dynamics \pedal >>
+ >>
+ }
\midi {}
}
--- /dev/null
+\version "2.11.47"
+\layout { ragged-right = ##t }
+\header {
+ lsrtags = "rhythms,tweaks-and-overrides"
+ texidoc = "
+The text used for crescendos and decrescendos can be
+changed by modifying the context properties @code{crescendoText}
+and @code{decrescendoText}. The style of the spanner line can
+be changed by modifying the @code{'style} property of
+@code{DynamicTextSpanner}. The default value is
+@code{'hairpin}, and other possible values include
+@code{'line}, @code{'dashed-line}, and
+@code{'dotted-line}:
+"
+ doctitle = "Changing text and spanner styles for text dynamics"
+}
+
+\relative c'' {
+ \set crescendoText = \markup { \italic { cresc. poco } }
+ \set crescendoSpanner = #'text
+ \override DynamicTextSpanner #'style = #'dotted-line
+ a2\< a
+ a2 a
+ a2 a
+ a2 a\mf
+}
%% A simple piece in LilyPond, a scale.
-\relative {
- c d e f g a b c
+\relative c' {
+ c d e f g a b c
}
%% Optional helper for automatic updating by convert-ly. May be omitted.
return SCM_EOL;
}
- Stencil mol (fm->find_by_name (scm_i_string_chars (glyph_name)));
+ Stencil mol (fm->find_by_name (ly_scm2string (glyph_name)));
if (to_boolean (me->get_property ("restore-first")))
{
/*
struct Substitution_entry
{
Grob *grob_;
+
+ /* Assumption: we have less than 32k paper columns. */
short left_;
short right_;
else
{
char s[2] = "a";
- s[0] = (pit->get_notename () + 2) % 7 + 'a';
- s[0] = toupper (s[0]);
+ s[0] = char ((pit->get_notename () + 2) % 7 + 'a');
+ s[0] = char (toupper (s[0]));
charstr = scm_from_locale_string (s);
}
Stencil
Font_metric::find_by_name (string s) const
{
- replace_all (s, '-', 'M');
+ replace_all (&s, '-', 'M');
int idx = name_to_index (s);
Box b;
LY_ASSERT_TYPE (scm_is_string, s, 3);
string ss = ly_scm2string (s);
- replace_all (ss, string (scm_i_string_chars (a)),
- string (scm_i_string_chars (b)));
+ replace_all (&ss, ly_scm2string (a),
+ ly_scm2string (b));
+
return ly_string2scm (ss);
}
}
LY_DEFINE (ly_gettext, "ly:gettext",
- 1, 0, 0, (SCM string),
+ 1, 0, 0, (SCM original),
"A Scheme wrapper function for @code{gettext}.")
{
- LY_ASSERT_TYPE (scm_is_string, string, 1);
- return ly_string2scm (_ (scm_i_string_chars (string)));
+ LY_ASSERT_TYPE (scm_is_string, original, 1);
+ return ly_string2scm (_ (ly_scm2string (original).c_str ()));
}
LY_DEFINE (ly_output_formats, "ly:output-formats",
ly_scm2string (SCM str)
{
assert (scm_is_string (str));
- return string (scm_i_string_chars (str),
- (int) scm_i_string_length (str));
+ string result;
+ size_t len = scm_c_string_length (str);
+ if (len) {
+ result.resize(len);
+ scm_to_locale_stringbuf(str, &result.at(0), len);
+ }
+ return result;
}
SCM
char *
ly_scm2newstr (SCM str, size_t *lenp)
{
- LY_ASSERT_TYPE (scm_is_string, str, 1);
-
- size_t len = scm_i_string_length (str);
- if (char *new_str = (char *) malloc ((len + 1) * sizeof (char)))
- {
- memcpy (new_str, scm_i_string_chars (str), len);
- new_str[len] = '\0';
-
- if (lenp)
- *lenp = len;
-
- return new_str;
- }
- return 0;
+ char* p = scm_to_locale_stringn(str, lenp);
+ return p;
}
-
/*
PAIRS
*/
-SCM
+SCM
index_get_cell (SCM s, Direction d)
{
-
assert (d);
return (d == LEFT) ? scm_car (s) : scm_cdr (s);
}
return scm_ihashv (s, ~1u);
}
-
bool
is_axis (SCM s)
{
else if (cxx_id.substr (cxx_id.length () - 2) == "_x")
cxx_id = cxx_id.replace (cxx_id.length () - 2, 2, "!");
- cxx_id = replace_all (cxx_id, "_less?", "<?");
- cxx_id = replace_all (cxx_id, "_2_", "->");
- cxx_id = replace_all (cxx_id, "__", "::");
- cxx_id = replace_all (cxx_id, '_', '-');
+ replace_all (&cxx_id, "_less?", "<?");
+ replace_all (&cxx_id, "_2_", "->");
+ replace_all (&cxx_id, "__", "::");
+ replace_all (&cxx_id, '_', '-');
return cxx_id;
while (isspace (*symbols))
*symbols++;
string s = symbols;
- replace_all (s, '\n', ' ');
- replace_all (s, '\t', ' ');
- replace_all (s, " ", " ");
+ replace_all (&s, '\n', ' ');
+ replace_all (&s, '\t', ' ');
+ replace_all (&s, " ", " ");
return ly_string_array_to_scm (string_split (s, ' '));
}
vector<char> out;
/* don't add '-' before first character */
- out.push_back (tolower (in[0]));
+ out.push_back (char (tolower (in[0])));
for (size_t inpos = 1; inpos < in.size (); inpos++)
{
if (isupper (in[inpos]))
out.push_back ('-');
- out.push_back (tolower (in[inpos]));
+ out.push_back ( char(tolower (in[inpos])));
}
string result (&out[0], out.size ());
- replace_all (result, '_', '-');
+ replace_all (&result, '_', '-');
return result;
}
SCM opt_help_scm
= scm_object_property (sym, ly_symbol2scm ("program-option-documentation"));
string opt_help = ly_scm2string (opt_help_scm);
- replace_all (opt_help,
+ replace_all (&opt_help,
string ("\n"),
string ("\n")
+ String_convert::char_string (' ', HELP_INDENT));
{
/* ev_class is the C++ identifier name. Convert to scm symbol */
string name = string (ev_class);
- name = replace_all (name, '_', '-');
+ name = replace_all (&name, '_', '-');
name += "-event";
SCM class_sym = scm_str2symbol (name.c_str ());
string interface_name (func_name);
- interface_name = replace_all (interface_name, '_', '-');
+ interface_name = replace_all (&interface_name, '_', '-');
interface_name += "-interface";
/*
/* "listen_foo_bar" -> "foo-bar" */
ev_class.erase (0, strlen (prefix));
- replace_all (ev_class, '_', '-');
+ replace_all (&ev_class, '_', '-');
new_ev->origin ()->warning (_f ("Two simultaneous %s events, junking this one", ev_class.c_str ()));
(*old_ev)->origin ()->warning (_f ("Previous %s event here", ev_class.c_str ()));
A circle of radius @var{radius}, thickness @var{thickness} and
optionally filled.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\draw-circle #2 #0.5 ##f \\hspace #2 \\draw-circle #2 #0 ##t }
@end lilypond"
@cindex drawing triangles within text
A triangle, either filled or empty.
-@c
+
@lilypond[verbatim,quote]
-\\markup { \\triangle ##f \\triangle ##t }
+\\markup { \\triangle ##t \\hspace #2 \\triangle ##f }
@end lilypond"
(let ((ex (* (magstep font-size) 0.8 baseline-skip)))
(ly:make-stencil
Add a link to URL @var{url} around @var{arg}. This only works in
the PDF backend.
+
@lilypond[verbatim,quote]
\\markup {
\\with-url #\"http://lilypond.org/web/\" {
- LilyPond ... \\italic \"music notation for everyone\"
+ LilyPond ... \\italic { music notation for everyone }
}
}
@end lilypond"
@end verbatim
creates a box extending horizontally from -0.3 to 1.8 and
vertically from -0.3 up to 1.8, with corners formed from a
-circle of diameter@tie{}0 (i.e. sharp corners)."
+circle of diameter@tie{}0 (i.e. sharp corners).
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\filled-box #'(0 . 4) #'(0 . 4) #0
+ \\filled-box #'(0 . 2) #'(-4 . 2) #0.4
+ \\filled-box #'(1 . 8) #'(0 . 7) #0.2
+ \\with-color #white \\filled-box #'(-4.5 . -2.5) #'(3.5 . 5.5) #0.7
+}
+@end lilypond"
(ly:round-filled-box
xext yext blot))
@cindex inlining an Encapsulated PostScript image
Inline an EPS image. The image is scaled along @var{axis} to
-@var{size}."
+@var{size}.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\general-align #Y #DOWN {
+ \\epsfile #X #20 #\"context-example.eps\"
+ \\epsfile #Y #20 #\"context-example.eps\"
+ }
+}
+@end lilypond"
(if (ly:get-option 'safe)
(interpret-markup layout props "not allowed in safe")
(eps-file->stencil axis size file-name)
gsave /ecrm10 findfont
10.0 output-scale div
scalefont setfont 90 rotate (hello) show grestore
-@end example"
+@end example
+
+@lilypond[verbatim,quote]
+eyeglassesps = #\"
+ 0.15 setlinewidth
+ -0.9 0 translate
+ 1.1 1.1 scale
+ 1.2 0.7 moveto
+ 0.7 0.7 0.5 0 361 arc
+ stroke
+ 2.20 0.70 0.50 0 361 arc
+ stroke
+ 1.45 0.85 0.30 0 180 arc
+ stroke
+ 0.20 0.70 moveto
+ 0.80 2.00 lineto
+ 0.92 2.26 1.30 2.40 1.15 1.70 curveto
+ stroke
+ 2.70 0.70 moveto
+ 3.30 2.00 lineto
+ 3.42 2.26 3.80 2.40 3.65 1.70 curveto
+ stroke\"
+
+eyeglasses = \\markup {
+ \\with-dimensions #'(0 . 4.4) #'(0 . 2.5)
+ \\postscript #eyeglassesps
+}
+
+\\relative c'' { c2^\\eyeglasses a_\\eyeglasses }
+@end lilypond"
;; FIXME
(ly:make-stencil
(list 'embedded-ps
"
@cindex inserting music into text
-Inline an image of music."
+Inline an image of music.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\score {
+ \\new PianoStaff <<
+ \\new Staff \\relative c' {
+ \\key f \\major
+ \\time 3/4
+ \\mark \\markup { Allegro }
+ f2\\p( a4)
+ c2( a4)
+ bes2( g'4)
+ f8( e) e4 r
+ }
+ \\new Staff \\relative c {
+ \\clef bass
+ \\key f \\major
+ \\time 3/4
+ f8( a c a c a
+ f c' es c es c)
+ f,( bes d bes d bes)
+ f( g bes g bes g)
+ }
+ >>
+ \\layout {
+ indent = 0.0\\cm
+ \\context {
+ \\Score
+ \\override RehearsalMark #'break-align-symbols =
+ #'(time-signature key-signature)
+ \\override RehearsalMark #'self-alignment-X = #LEFT
+ }
+ \\context {
+ \\Staff
+ \\override TimeSignature #'break-align-anchor-alignment = #LEFT
+ }
+ }
+ }
+}
+@end lilypond"
(let* ((output (ly:score-embedded-format score layout)))
(if (ly:music-output? output)
"
@cindex merging text
-Print two markups on top of each other."
+Print two markups on top of each other.
+@lilypond[verbatim,quote]
+\\markup {
+ \\fontsize #5
+ \\override #'(thickness . 2)
+ \\combine \\draw-line #'(0 . 4) \\arrow-head #Y #DOWN ##f
+}
+@end lilypond"
(let* ((s1 (interpret-markup layout props m1))
(s2 (interpret-markup layout props m2)))
(ly:stencil-add s1 s2)))
(string?)
other
()
- "Read the contents of a file, and include it verbatim."
+ "Read the contents of a file, and include it verbatim.
+
+@lilypond[verbatim,quote]
+\\markup \\verbatim-file #\"simple.ly\"
+@end lilypond"
(interpret-markup layout props
(if (ly:get-option 'safe)
"verbatim-file disabled in safe mode"
(markup?)
font
()
- "Set the argument as small numbers."
+ "Set the argument as small numbers.
+@lilypond[verbatim,quote]
+\\markup \\finger { 1 2 3 4 5 }
+@end lilypond"
(interpret-markup layout
(cons '((font-size . -5) (font-encoding . fetaNumber)) props)
arg))
()
"Set font family to @code{number}, which yields the font used for
time signatures and fingerings. This font only contains numbers and
-some punctuation. It doesn't have any letters."
+some punctuation. It doesn't have any letters.
+
+@lilypond[verbatim,quote]
+\\markup \\number { 0 1 2 3 4 5 6 7 8 9 . , + - }
+@end lilypond"
(interpret-markup layout (prepend-alist-chain 'font-encoding 'fetaNumber props) arg))
(define-builtin-markup-command (roman layout props arg)
"Use the dynamic font. This font only contains @b{s}, @b{f}, @b{m},
@b{z}, @b{p}, and @b{r}. When producing phrases, like
@q{pi@`{u}@tie{}@b{f}}, the normal words (like @q{pi@`{u}}) should be
-done in a different font. The recommended font for this is bold and italic."
+done in a different font. The recommended font for this is bold and italic.
+@lilypond[verbatim,quote]
+\\markup { \\dynamic sfzp }
+@end lilypond"
(interpret-markup
layout (prepend-alist-chain 'font-encoding 'fetaDynamic props) arg))
(markup?)
font
()
- "Use italic @code{font-shape} for @var{arg}."
+ "Use italic @code{font-shape} for @var{arg}.
+
+@lilypond[verbatim,quote]
+\\markup \\italic { scherzando e leggiero }
+@end lilypond"
(interpret-markup layout (prepend-alist-chain 'font-shape 'italic props) arg))
(define-builtin-markup-command (typewriter layout props arg)
music
()
"Draw a double sharp symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\doublesharp }
@end lilypond"
music
()
"Draw a 3/2 sharp symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\sesquisharp }
@end lilypond"
music
()
"Draw a sharp symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\sharp }
@end lilypond"
music
()
"Draw a semi sharp symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\semisharp }
@end lilypond"
music
()
"Draw a natural symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\natural }
@end lilypond"
music
()
"Draw a semiflat symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\semiflat }
@end lilypond"
music
()
"Draw a flat symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\flat }
@end lilypond"
music
()
"Draw a 3/2 flat symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\sesquiflat }
@end lilypond"
music
()
"Draw a double flat symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\doubleflat }
@end lilypond"
graphic
()
"Produce an arrow head in specified direction and axis.
-Use the filled head if @var{filled} is specified."
+Use the filled head if @var{filled} is specified.
+@lilypond[verbatim,quote]
+\\markup {
+ \\fontsize #5
+ \\general-align #Y #DOWN {
+ \\arrow-head #Y #UP ##t
+ \\arrow-head #Y #DOWN ##f
+ \\hspace #2
+ \\arrow-head #X #RIGHT ##f
+ \\arrow-head #X #LEFT ##f
+ }
+}
+@end lilypond"
(let*
((name (format "arrowheads.~a.~a~a"
(if filled
"@var{glyph-name} is converted to a musical symbol; for example,
@code{\\musicglyph #\"accidentals.natural\"} selects the natural sign from
the music font. See @ruser{The Feta font} for a complete listing of
-the possible glyphs."
+the possible glyphs.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\musicglyph #\"f\"
+ \\musicglyph #\"rests.2\"
+ \\musicglyph #\"clefs.G_change\"
+}
+@end lilypond"
(ly:font-get-glyph
(ly:paper-get-font layout (cons '((font-encoding . fetaMusic))
props))
other
()
"Make a markup letter for @var{num}. The letters start with A to@tie{}Z
-(skipping letter@tie{}I), and continue with double letters."
+(skipping letter@tie{}I), and continue with double letters.
+
+@lilypond[verbatim,quote]
+\\markup { \\markletter #8 \\hspace #2 \\markletter #26 }
+@end lilypond"
(ly:text-interface::interpret-markup layout props
(number->markletter-string number->mark-letter-vector num)))
other
()
"Make a markup letter for @var{num}. The letters start with A to@tie{}Z
-and continue with double letters."
+and continue with double letters.
+
+@lilypond[verbatim,quote]
+\\markup { \\markalphabet #8 \\hspace #2 \\markalphabet #26 }
+@end lilypond"
(ly:text-interface::interpret-markup layout props
(number->markletter-string number->mark-alphabet-vector num)))
@cindex slashed digits
A feta number, with slash. This is for use in the context of
-figured bass notation."
+figured bass notation.
+@lilypond[verbatim,quote]
+\\markup {
+ \\slashed-digit #5
+ \\hspace #2
+ \\override #'(thickness . 3)
+ \\slashed-digit #7
+}
+@end lilypond"
(let* ((mag (magstep font-size))
(thickness (* mag
(ly:output-def-lookup layout 'line-thickness)
positions it next to the staff cancels any shift made with
@code{\\raise}. For vertical positioning, use the @code{padding}
and/or @code{extra-offset} properties.
-@c
+
@lilypond[verbatim,quote]
-\\markup { C \\small \\raise #1.0 \\bold { \"9/7+\" } }
+\\markup { C \\small \\raise #1.0 \\bold 9/7+ }
@end lilypond"
(ly:stencil-translate-axis (interpret-markup layout props arg) amount Y))
"
@cindex creating text fractions
-Make a fraction of two markups."
+Make a fraction of two markups.
+@lilypond[verbatim,quote]
+\\markup { π ≈ \\fraction 355 113 }
+@end lilypond"
(let* ((m1 (interpret-markup layout props arg1))
(m2 (interpret-markup layout props arg2))
(factor (magstep font-size))
Raising and lowering texts can be done with @code{\\super} and
@code{\\sub}:
-@c
+
@lilypond[verbatim,quote]
-\\markup { E \"=\" \\concat { \"mc\" \\super \"2\" } }
+\\markup { E = \\concat { mc \\super 2 } }
@end lilypond"
(ly:stencil-translate-axis
(interpret-markup
"
@cindex placing horizontal brackets around text
-Draw horizontal brackets around @var{arg}."
+Draw horizontal brackets around @var{arg}."
(let ((th 0.1) ;; todo: take from GROB.
(m (interpret-markup layout props arg)))
(bracketify-stencil m X th (* 2.5 th) th)))
;; don't use decimals.
;; ISO 216 has a tolerance of +- 2mm
-
- '(("a7" . (cons (* 74 mm) (* 105 mm)))
+
+ '(("a10" . (cons (* 26 mm) (* 37 mm)))
+ ("a9" . (cons (* 37 mm) (* 52 mm)))
+ ("a8" . (cons (* 52 mm) (* 74 mm)))
+ ("a7" . (cons (* 74 mm) (* 105 mm)))
("a6" . (cons (* 105 mm) (* 148 mm)))
("a5" . (cons (* 148 mm) (* 210 mm)))
("a4" . (cons (* 210 mm) (* 297 mm)))
("a3" . (cons (* 297 mm) (* 420 mm)))
+ ("a2" . (cons (* 420 mm) (* 594 mm)))
+ ("a1" . (cons (* 594 mm) (* 841 mm)))
+ ("a0" . (cons (* 841 mm) (* 1189 mm)))
+ ("b10" . (cons (* 31 mm) (* 44 mm)))
+ ("b9" . (cons (* 44 mm) (* 62 mm)))
+ ("b8" . (cons (* 62 mm) (* 88 mm)))
+ ("b7" . (cons (* 88 mm) (* 125 mm)))
+ ("b6" . (cons (* 125 mm) (* 176 mm)))
+ ("b5" . (cons (* 176 mm) (* 250 mm)))
+ ("b4" . (cons (* 250 mm) (* 353 mm)))
+ ("b3" . (cons (* 353 mm) (* 500 mm)))
+ ("b2" . (cons (* 500 mm) (* 707 mm)))
+ ("b1" . (cons (* 707 mm) (* 1000 mm)))
+ ("b0" . (cons (* 1000 mm) (* 1414 mm)))
+ ;; Below are two extended sizes defined in DIn 476
+ ("4a0" . (cons (* 1682 mm) (* 2378 mm)))
+ ("2a0" . (cons (* 1189 mm) (* 1682 mm)))
+ ;; Below are ISO 269 standard C series
+ ("c10" . (cons (* 28 mm) (* 40 mm)))
+ ("c9" . (cons (* 40 mm) (* 57 mm)))
+ ("c8" . (cons (* 57 mm) (* 81 mm)))
+ ("c7" . (cons (* 81 mm) (* 114 mm)))
+ ("c6" . (cons (* 114 mm) (* 162 mm)))
+ ("c5" . (cons (* 162 mm) (* 229 mm)))
+ ("c4" . (cons (* 229 mm) (* 324 mm)))
+ ("c3" . (cons (* 324 mm) (* 458 mm)))
+ ("c2" . (cons (* 458 mm) (* 648 mm)))
+ ("c1" . (cons (* 648 mm) (* 917 mm)))
+ ("c0" . (cons (* 917 mm) (* 1297 mm)))
+ ;; Below are North American paper sizes
("legal" . (cons (* 8.5 in) (* 14.0 in)))
("letter" . (cons (* 8.5 in) (* 11.0 in)))
+ ;; Ledger (17x11) is a 90 degree rotation of Tabloid
("11x17" . (cons (* 11.0 in) (* 17.0 in)))
- ))
+ ;; government-letter by IEEE Printer Working Group, for children's writing
+ ("government-letter" . (cons (* 8 in) (* 10.5 in)))
+ ("government-legal" . (cons (* 8.5 in) (* 13.0 in)))
+ ("philippine-legal" . (cons (* 8.5 in) (* 13.0 in)))
+ ;; ANSI sizes
+ ("ansi a" . (cons (* 8.5 in) (* 11.0 in)))
+ ("ansi b" . (cons (* 17.0 in) (* 11.0 in)))
+ ("ansi c" . (cons (* 17.0 in) (* 22.0 in)))
+ ("ansi d" . (cons (* 22.0 in) (* 34.0 in)))
+ ("ansi e" . (cons (* 34.0 in) (* 44.0 in)))
+ ("engineering f" . (cons (* 28.0 in) (* 40.0 in)))
+ ;; G and H are very rare, and the lengths are variable up to 90 inches
+ ;; North American Architectural sizes
+ ("arch a" . (cons (* 9.0 in) (* 12.0 in)))
+ ("arch b" . (cons (* 12.0 in) (* 18.0 in)))
+ ("arch c" . (cons (* 18.0 in) (* 24.0 in)))
+ ("arch d" . (cons (* 24.0 in) (* 36.0 in)))
+ ("arch e" . (cons (* 36.0 in) (* 48.0 in)))
+ ("arch e1" . (cons (* 30.0 in) (* 42.0 in)))
+ ;; Other sizes
+ ;; Some are antique sizes which are still using in UK
+ ("statement" . (cons (* 5.5 in) (* 8.5 in)))
+ ("half letter" . (cons (* 5.5 in) (* 8.5 in)))
+ ("quarto" . (cons (* 8.0 in) (* 10.0 in)))
+ ("executive" . (cons (* 7.25 in) (* 10.5 in)))
+ ("monarch" . (cons (* 7.25 in) (* 10.5 in)))
+ ("foolscap" . (cons (* 8.27 in) (* 13.0 in)))
+ ("folio" . (cons (* 8.27 in) (* 13.0 in)))
+ ("super-b" . (cons (* 13.0 in) (* 19.0 in)))
+ ("post" . (cons (* 15.5 in) (* 19.5 in)))
+ ("crown" . (cons (* 15.0 in) (* 20.0 in)))
+ ("large post" . (cons (* 16.5 in) (* 21.0 in)))
+ ("demy" . (cons (* 17.5 in) (* 22.5 in)))
+ ("medium" . (cons (* 18.0 in) (* 23.0 in)))
+ ("broadsheet" . (cons (* 18.0 in) (* 24.0 in)))
+ ("royal" . (cons (* 20.0 in) (* 25.0 in)))
+ ("elephant" . (cons (* 23.0 in) (* 28.0 in)))
+ ("double demy" . (cons (* 22.5 in) (* 35.0 in)))
+ ("quad demy" . (cons (* 35.0 in) (* 45.0 in)))
+ ("atlas" . (cons (* 26.0 in) (* 34.0 in)))
+ ("imperial" . (cons (* 22.0 in) (* 30.0 in)))
+ ("antiquarian" . (cons (* 31.0 in) (* 53.0 in)))
+ ;; PA4 based sizes
+ ("pa0" . (cons (* 840 mm) (* 1120 mm)))
+ ("pa1" . (cons (* 560 mm) (* 840 mm)))
+ ("pa2" . (cons (* 420 mm) (* 560 mm)))
+ ("pa3" . (cons (* 280 mm) (* 420 mm)))
+ ("pa4" . (cons (* 210 mm) (* 280 mm)))
+ ("pa5" . (cons (* 140 mm) (* 210 mm)))
+ ("pa6" . (cons (* 105 mm) (* 140 mm)))
+ ("pa7" . (cons (* 70 mm) (* 105 mm)))
+ ("pa8" . (cons (* 52 mm) (* 70 mm)))
+ ("pa9" . (cons (* 35 mm) (* 52 mm)))
+ ("pa10" . (cons (* 26 mm) (* 35 mm)))
+ ;; F4 used in southeast Asia and Australia
+ ("f4" . (cons (* 210 mm) (* 330 mm)))
+ ))
;; todo: take dimension arguments.