]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' into beaming
authorJoe Neeman <joeneeman@gmail.com>
Thu, 5 Jun 2008 00:56:11 +0000 (10:56 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Thu, 5 Jun 2008 00:56:11 +0000 (10:56 +1000)
21 files changed:
Documentation/user/fundamental.itely
Documentation/user/repeats.itely
THANKS
flower/file-name.cc
flower/getopt-long.cc
flower/include/std-string.hh
flower/std-string.cc
input/lsr/piano-template-with-centered-dynamics.ly
input/new/changing-text-and-spanner-styles-for-text-dynamics.ly [new file with mode: 0644]
input/simple.ly
lily/accidental.cc
lily/break-substitution.cc
lily/easy-notation.cc
lily/font-metric.cc
lily/general-scheme.cc
lily/lily-guile.cc
lily/misc.cc
lily/program-option-scheme.cc
lily/translator.cc
scm/define-markup-commands.scm
scm/paper.scm

index 71cb6c751466790b787073f120531e4a12b36697..9d402b8e70886b1c2f9ee4181ff9c62fa23bd49a 100644 (file)
@@ -710,7 +710,11 @@ blue triangle voice.
 }
 @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
@@ -718,8 +722,10 @@ of the note head, the stem and the beams, and the style of the
 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}.
 
@@ -900,6 +906,7 @@ notation} )
 @funindex \voiceTwo
 @funindex \voiceThree
 @funindex \voiceFour
+@funindex \oneVoice
 @funindex \new Voice
 @cindex Voice contexts, creating
 
@@ -1360,7 +1367,7 @@ refrainwordsB = \lyricmode {
 \score {
   \new ChoirStaff {
     \new Staff <<
-      \context Voice = "verse" {
+      \new Voice = "verse" {
         \versenotes \break
         <<
           \refrainnotesA
index 0bb23654a4d16ef1c5ac94323d8a4d629c4a1fd8..b448e1ddc45164c5ea726afca537303d3d2effc2 100644 (file)
@@ -228,24 +228,63 @@ Print a @code{|:} bar line.
 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
@@ -456,4 +495,5 @@ into the MIDI output.
 
 @seealso
 
-@c Notation Reference: @re
+Snippets: @rlsr{Repeats}.
+
diff --git a/THANKS b/THANKS
index cc163569fd7aa9c2e86329d498e3062bf0ff41b1..b87177b6a2b4b35d5ab4f1b5cdda3ff7ee7489e6 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -81,6 +81,7 @@ Georg Dummer
 Georg Romstorfer
 Gilles Thibault
 Hernán J. González 
+Hu Haipeng
 Jay Anderson
 James Kilfinger
 Jean-Marie Mouchel
index bf645df23d78ecdd3fccb67d90978214765477f7..1eff46be5245226db967269c945aa8e0a92c96bf 100644 (file)
@@ -61,8 +61,8 @@ static /* avoid warning */
 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;
 }
 
@@ -185,7 +185,7 @@ File_name::canonicalized () const
 {
   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;
index 2cb537c67b39724afa5d06e57f8697e3e7115277..37a964219dbecc5929968e497d7c5297b8dcafbe 100644 (file)
@@ -310,7 +310,7 @@ Long_option_init::table_string (Long_option_init *l)
       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";
     }
index 57805bbe21d95206d55d65ea8fc820062a5e43fe..d5933d8f99985075de4908f475dc5bd9cebb3363 100644 (file)
@@ -38,8 +38,8 @@ string to_string (bool b);
 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 (stringstr, char find, char replace);
 char *string_copy (string s);
 
 int string_compare (string const &, string const &);
index 1221609c6c0ce4bc2e76a140d4fcbb1ed35f3d11..5232574366c79c950c4e99101b09e5c88535764d 100644 (file)
@@ -71,20 +71,20 @@ to_string (char const *format, ...)
   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 *
index 175f29d45dfe350d23874b846e3f0cd67de21d82..316cb4da94c03e387c0b6c664af47a185b7d438f 100644 (file)
@@ -7,7 +7,9 @@
   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
@@ -16,7 +18,7 @@ upper = \relative c'' {
   \clef treble
   \key c \major
   \time 4/4
-  
+
   a4 b c d
 }
 
@@ -24,7 +26,7 @@ lower = \relative c {
   \clef bass
   \key c \major
   \time 4/4
-  
+
   a2 c
 }
 
@@ -53,22 +55,22 @@ pedal = {
       % 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 {
@@ -78,9 +80,11 @@ pedal = {
   }
 }
 \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 {}
 }
diff --git a/input/new/changing-text-and-spanner-styles-for-text-dynamics.ly b/input/new/changing-text-and-spanner-styles-for-text-dynamics.ly
new file mode 100644 (file)
index 0000000..e7b91b3
--- /dev/null
@@ -0,0 +1,26 @@
+\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
+}
index a532db76637fdd46412d7e50f9e66d4966dedf75..fc78b35e34a1141dc56f48829fb3412c7d4c69c1 100644 (file)
@@ -1,6 +1,6 @@
 %% 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.
index c91152522846c48284b9b9cf9cb55ff5c758e40a..7f3a97b4f77153882a5639396f091af9f7fcc498 100644 (file)
@@ -189,7 +189,7 @@ Accidental_interface::get_stencil (Grob *me)
       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")))
     {
       /*
index f283010303ae2be12956e40229d51d96661bcff1..67697136d2e36bd5d7ce714ace8c460ee06502ec 100644 (file)
@@ -263,6 +263,8 @@ grob_system_range (Grob *g)
 struct Substitution_entry
 {
   Grob *grob_;
+
+  /* Assumption: we have less than 32k paper columns. */
   short left_;
   short right_;
 
index 34c0a97f781823f9936ae4e625f68ad7e7c3f2d0..c5d886147b59b5c5c3de32a12cf3fe6b0dde8e9e 100644 (file)
@@ -45,8 +45,8 @@ Note_head::brew_ez_stencil (SCM smob)
   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);
     }
 
index 655d992123f4859cbc4d73cbdf430d22fbaafc4e..215bf679812bee9da7f56682e67dd41cfd9b9bb9 100644 (file)
@@ -31,7 +31,7 @@ Font_metric::design_size () const
 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;
 
index 7d4b5c1c30999361db6d9ccfb58e360e61480d1c..fd27481938d232f69edcfa5388d5a4c7e6b40597 100644 (file)
@@ -180,8 +180,9 @@ LY_DEFINE (ly_string_substitute, "ly:string-substitute",
   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);
 }
   
@@ -245,11 +246,11 @@ LY_DEFINE (ly_protects, "ly:protects",
 }
 
 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",
index 9da6823f194e89e91ab15a13c4ab751ed3b4d03e..9f62fbb670096940e457dda8c8c79bfda6544e61 100644 (file)
@@ -111,8 +111,13 @@ string
 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
@@ -126,30 +131,16 @@ ly_string2scm (string const &str)
 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);
 }
@@ -178,7 +169,6 @@ ly_scm_hash (SCM s)
   return scm_ihashv (s, ~1u);
 }
 
-
 bool
 is_axis (SCM s)
 {
@@ -634,10 +624,10 @@ mangle_cxx_identifier (string cxx_id)
   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;
@@ -661,9 +651,9 @@ parse_symbol_list (char const *symbols)
   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, ' '));
 }
 
index 6837df0d744838c4eff0978318902ff3d6324e6c..3b9d87da162859c339b6a5a66548bd6a17e4d572 100644 (file)
@@ -71,17 +71,17 @@ camel_case_to_lisp_identifier (string in)
   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;
 }
index 4ec898092e09af3933cbe951c291624cfc920c14..f47abed2cc53fd1ac2448db7b41fab85ac8ee5cf 100644 (file)
@@ -149,7 +149,7 @@ get_help_string ()
       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));
index e4cb27d3b716c230a2af889ef55d25b83f7cd71b..dc70c155ce97058e9491a598360ceb7f3d19012c 100644 (file)
@@ -171,7 +171,7 @@ Translator::add_translator_listener (translator_listener_record **listener_list,
 {
   /* 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 ());
@@ -275,7 +275,7 @@ add_acknowledger (Engraver_void_function_engraver_grob_info ptr,
 
   string interface_name (func_name);
 
-  interface_name = replace_all (interface_name, '_', '-');
+  interface_name = replace_all (&interface_name, '_', '-');
   interface_name += "-interface";
 
   /*
@@ -342,7 +342,7 @@ internal_event_assignment (Stream_event **old_ev, Stream_event *new_ev, const ch
 
       /* "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 ()));
index 3c8d151b4f3150036089b6d29a5e460707713c27..36d981b06eb28b0f800c51e61f6b6dd927fb050d 100644 (file)
@@ -52,7 +52,7 @@ A simple line."
 
 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"
@@ -68,9 +68,9 @@ optionally filled.
 @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
@@ -110,10 +110,11 @@ thickness and padding around the markup."
 
 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"
@@ -203,7 +204,16 @@ Draw a box with rounded corners of dimensions @var{xext} and
 @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))
 
@@ -349,7 +359,16 @@ Use a stencil as markup."
 @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)
@@ -384,7 +403,36 @@ For the postscript backend, use the following
 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
@@ -404,7 +452,47 @@ grestore
   "
 @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)
@@ -763,7 +851,14 @@ the line width, where @var{X} is the number of staff spaces."
   "
 @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)))
@@ -1012,7 +1107,11 @@ any sort of property supported by @rinternals{font-interface} and
   (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"
@@ -1050,7 +1149,10 @@ any sort of property supported by @rinternals{font-interface} and
   (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))
@@ -1109,7 +1211,11 @@ Use @code{\\fontsize} otherwise."
   ()
   "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)
@@ -1224,7 +1330,10 @@ Note: @code{\\smallCaps} does not support accented characters."
   "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))
 
@@ -1242,7 +1351,11 @@ done in a different font.  The recommended font for this is bold and italic."
   (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)
@@ -1291,7 +1404,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a double sharp symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\doublesharp }
 @end lilypond"
@@ -1302,7 +1415,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a 3/2 sharp symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\sesquisharp }
 @end lilypond"
@@ -1313,7 +1426,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a sharp symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\sharp }
 @end lilypond"
@@ -1324,7 +1437,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a semi sharp symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\semisharp }
 @end lilypond"
@@ -1335,7 +1448,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a natural symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\natural }
 @end lilypond"
@@ -1346,7 +1459,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a semiflat symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\semiflat }
 @end lilypond"
@@ -1357,7 +1470,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a flat symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\flat }
 @end lilypond"
@@ -1368,7 +1481,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a 3/2 flat symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\sesquiflat }
 @end lilypond"
@@ -1379,7 +1492,7 @@ normal text font, no matter what font was used earlier."
   music
   ()
   "Draw a double flat symbol.
-@c
+
 @lilypond[verbatim,quote]
 \\markup { \\doubleflat }
 @end lilypond"
@@ -1407,7 +1520,19 @@ Draw @var{arg} in color specified by @var{color}."
   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
@@ -1427,7 +1552,15 @@ Use the filled head if @var{filled} is specified."
   "@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))
@@ -1476,7 +1609,11 @@ letter @q{A}."
   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)))
 
@@ -1485,7 +1622,11 @@ letter @q{A}."
   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)))
 
@@ -1498,7 +1639,15 @@ and continue with double letters."
 @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)
@@ -1709,9 +1858,9 @@ If the text object itself is positioned above or below the staff, then
 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))
 
@@ -1722,7 +1871,10 @@ and/or @code{extra-offset} properties.
   "
 @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))
@@ -1767,9 +1919,9 @@ Set @var{arg} in superscript with a normal 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
@@ -1840,7 +1992,7 @@ Set @var{arg} in subscript, in a normal font size."
   "
 @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)))
index 8acf4e8d1049f391e88203219d34be54065c8fd1..04784c11f11ae97fdc68fc9b697a959e19e85bd2 100644 (file)
@@ -93,16 +93,106 @@ size. SZ is in points"
 
   ;; 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.