]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-markup-commands.scm
Merge branch 'lilypond/translation' of ssh://jomand@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / scm / define-markup-commands.scm
index 34541d55487bdf464eae8292de553299c8adc21b..53d71aa91651945e998379871719411092b2cf9d 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c) 2000--2007  Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; (c) 2000--2009  Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;                  Jan Nieuwenhuizen <janneke@gnu.org>
 
 
@@ -42,22 +42,16 @@ A simple line.
                thickness))
         (x (car dest))
         (y (cdr dest)))
-    (ly:make-stencil
-     `(draw-line
-       ,th
-       0 0
-       ,x ,y)
-     (cons (min x 0) (max x 0))
-     (cons (min y 0) (max y 0)))))
-
-(define-builtin-markup-command (draw-circle layout props radius thickness fill)
+    (make-line-stencil th 0 0 x y)))
+
+(define-builtin-markup-command (draw-circle layout props radius thickness filled)
   (number? number? boolean?)
   graphic
   ()
   "
 @cindex drawing circles within text
 
-A circle of radius @var{radius}, thickness @var{thickness} and
+A circle of radius @var{radius} and thickness @var{thickness},
 optionally filled.
 
 @lilypond[verbatim,quote]
@@ -67,7 +61,7 @@ optionally filled.
   \\draw-circle #2 #0 ##t
 }
 @end lilypond"
-  (make-circle-stencil radius thickness fill))
+  (make-circle-stencil radius thickness filled))
 
 (define-builtin-markup-command (triangle layout props filled)
   (boolean?)
@@ -188,7 +182,7 @@ Create a beam with the specified parameters.
 @cindex underlining text
 
 Underline @var{arg}.  Looks at @code{thickness} to determine line
-thickness and y offset.
+thickness and y-offset.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -206,10 +200,7 @@ thickness and y offset.
          (x1 (car (ly:stencil-extent markup X)))
          (x2 (cdr (ly:stencil-extent markup X)))
          (y (* thick -2))
-         (line (ly:make-stencil
-                `(draw-line ,thick ,x1 ,y ,x2 ,y)
-                (cons (min x1 0) (max x2 0))
-                (cons thick thick))))
+         (line (make-line-stencil thick x1 y x2 y)))
     (ly:stencil-add markup line)))
 
 (define-builtin-markup-command (box layout props arg)
@@ -253,7 +244,7 @@ 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 {
@@ -274,14 +265,14 @@ circle of diameter@tie{}0 (i.e. sharp corners).
    (corner-radius 1)
    (font-size 0)
    (box-padding 0.5))
-  "@cindex enclosing text in a bow with rounded corners
+  "@cindex enclosing text in a box with rounded corners
    @cindex drawing boxes with rounded corners around text
 Draw a box with rounded corners around @var{arg}.  Looks at @code{thickness},
 @code{box-padding} and @code{font-size} properties to determine line
 thickness and padding around the markup; the @code{corner-radius} property
-makes possible to define another shape for the corners (default is 1).
+makes it possible to define another shape for the corners (default is 1).
 
-@lilypond[quote,verbatim,fragment,relative=2]
+@lilypond[quote,verbatim,relative=2]
 c4^\\markup {
   \\rounded-box {
     Overtura
@@ -336,7 +327,7 @@ Provide a white background for @var{arg}.
 @end lilypond"
   (stencil-whiteout (interpret-markup layout props arg)))
 
-(define-builtin-markup-command (pad-markup layout props padding arg)
+(define-builtin-markup-command (pad-markup layout props amount arg)
   (number? markup?)
   align
   ()
@@ -344,7 +335,21 @@ Provide a white background for @var{arg}.
 @cindex padding text
 @cindex putting space around text
 
-Add space around a markup object."
+Add space around a markup object.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\box {
+    default
+  }
+  \\hspace #2
+  \\box {
+    \\pad-markup #1 {
+      padded
+    }
+  }
+}
+@end lilypond"
   (let*
       ((stil (interpret-markup layout props arg))
        (xext (ly:stencil-extent stil X))
@@ -352,8 +357,8 @@ Add space around a markup object."
 
     (ly:make-stencil
      (ly:stencil-expr stil)
-     (interval-widen xext padding)
-     (interval-widen yext padding))))
+     (interval-widen xext amount)
+     (interval-widen yext amount))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; space
@@ -381,15 +386,7 @@ Create a box of the same height as the space in the current font."
   "
 @cindex creating horizontal spaces in text
 
-This produces an invisible object taking horizontal space.  For example,
-
-@example 
-\\markup @{ A \\hspace #2.0 B @}
-@end example
-
-@noindent
-puts extra space between A and@tie{}B, on top of the space that is
-normally inserted before elements on a line.
+Create an invisible object taking up horizontal space @var{amount}.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -418,10 +415,9 @@ normally inserted before elements on a line.
 
 Use a stencil as markup.
 
-@c FIXME works in .ly file, produces empty stencil in docs
 @lilypond[verbatim,quote]
 \\markup {
-  \\stencil #(dimension-arrows '(15 . 0))
+  \\stencil #(make-circle-stencil 2 0 #t)
 }
 @end lilypond"
   stil)
@@ -470,60 +466,27 @@ Inline an EPS image.  The image is scaled along @var{axis} to
   ()
   "
 @cindex inserting PostScript directly into text
-
 This inserts @var{str} directly into the output as a PostScript
-command string.  Due to technicalities of the output backends,
-different scales should be used for the @TeX{} and PostScript backend,
-selected with @code{-f}. 
-
-For the @TeX{} backend, the following string prints a rotated text
-
-@example
-0 0 moveto /ecrm10 findfont 
-1.75 scalefont setfont 90 rotate (hello) show
-@end example
-
-@noindent
-The magical constant 1.75 scales from LilyPond units (staff spaces) to
-@TeX{} dimensions.
-
-For the postscript backend, use the following
-
-@example
-gsave /ecrm10 findfont 
- 10.0 output-scale div 
- scalefont setfont 90 rotate (hello) show grestore 
-@end example
+command string.
 
 @lilypond[verbatim,quote]
-eyeglassesps = #\"
+ringsps = #\"
   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
+  0.9 0.6 moveto
+  0.4 0.6 0.5 0 361 arc
   stroke
-  1.45 0.85 0.30 0 180 arc
+  1.0 0.6 0.5 0 361 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
+rings = \\markup {
+  \\with-dimensions #'(-0.2 . 1.6) #'(0 . 1.2)
+  \\postscript #ringsps
 }
 
 \\relative c'' {
-  c2^\\eyeglasses
-  a2_\\eyeglasses
+  c2^\\rings
+  a2_\\rings
 }
 @end lilypond"
   ;; FIXME
@@ -699,7 +662,7 @@ Like simple-markup, but use tie characters for @q{~} tilde symbols.
        (/ (+ (car text-widths) (car (cdr text-widths))) 2))
      (get-fill-space word-count line-width (cdr text-widths))))))
 
-(define-builtin-markup-command (fill-line layout props markups)
+(define-builtin-markup-command (fill-line layout props args)
   (markup-list?)
   align
   ((text-direction RIGHT)
@@ -726,7 +689,7 @@ If there are no arguments, return an empty stencil.
   }
 }
 @end lilypond"
-  (let* ((orig-stencils (interpret-markup-list layout props markups))
+  (let* ((orig-stencils (interpret-markup-list layout props args))
         (stencils
          (map (lambda (stc)
                 (if (ly:stencil-empty? stc)
@@ -781,12 +744,12 @@ If there are no arguments, return an empty stencil.
   ((word-space)
    (text-direction RIGHT))
   "Put @var{args} in a horizontal line.  The property @code{word-space}
-determines the space between each markup in @var{args}.
+determines the space between markups in @var{args}.
 
 @lilypond[verbatim,quote]
 \\markup {
   \\line {
-    A simple line of text
+    one two three
   }
 }
 @end lilypond"
@@ -805,20 +768,17 @@ determines the space between each markup in @var{args}.
 @cindex concatenating text
 @cindex ligatures in text
 
-Concatenate @var{args} in a horizontal line, without spaces inbetween.
+Concatenate @var{args} in a horizontal line, without spaces in between.
 Strings and simple markups are concatenated on the input level, allowing
 ligatures.  For example, @code{\\concat @{ \"f\" \\simple #\"i\" @}} is
 equivalent to @code{\"fi\"}.
 
 @lilypond[verbatim,quote]
 \\markup {
-  \\bold {
-    au
-    \\concat {
-      Mouv
-      \\super
-      t
-    }
+  \\concat {
+    one
+    two
+    three
   }
 }
 @end lilypond"
@@ -917,7 +877,7 @@ equivalent to @code{\"fi\"}.
   "
 @cindex justifying text
 
-Like wordwrap, but with lines stretched to justify the margins.
+Like @code{\\wordwrap}, but with lines stretched to justify the margins.
 Use @code{\\override #'(line-width . @var{X})} to set the line width;
 @var{X}@tie{}is the number of staff spaces.
 
@@ -993,16 +953,16 @@ the line width, where @var{X} is the number of staff spaces.
 \\markup {
   \\override #'(line-width . 40)
   \\wordwrap-string #\"Lorem ipsum dolor sit amet, consectetur
-    adipisicing elit, sed do eiusmod tempor incididunt ut labore
-    et dolore magna aliqua.
-    
-    
-    Ut enim ad minim veniam, quis nostrud exercitation ullamco
-    laboris nisi ut aliquip ex ea commodo consequat.
-    
-    
-    Excepteur sint occaecat cupidatat non proident, sunt in culpa
-    qui officia deserunt mollit anim id est laborum\"
+      adipisicing elit, sed do eiusmod tempor incididunt ut labore
+      et dolore magna aliqua.
+
+
+      Ut enim ad minim veniam, quis nostrud exercitation ullamco
+      laboris nisi ut aliquip ex ea commodo consequat.
+
+
+      Excepteur sint occaecat cupidatat non proident, sunt in culpa
+      qui officia deserunt mollit anim id est laborum\"
 }
 @end lilypond"
   (stack-lines DOWN 0.0 baseline-skip
@@ -1019,16 +979,16 @@ the line width, where @var{X} is the number of staff spaces.
 \\markup {
   \\override #'(line-width . 40)
   \\justify-string #\"Lorem ipsum dolor sit amet, consectetur
-    adipisicing elit, sed do eiusmod tempor incididunt ut labore
-    et dolore magna aliqua.
-    
-    
-    Ut enim ad minim veniam, quis nostrud exercitation ullamco
-    laboris nisi ut aliquip ex ea commodo consequat.
-    
-    
-    Excepteur sint occaecat cupidatat non proident, sunt in culpa
-    qui officia deserunt mollit anim id est laborum\"
+      adipisicing elit, sed do eiusmod tempor incididunt ut labore
+      et dolore magna aliqua.
+
+
+      Ut enim ad minim veniam, quis nostrud exercitation ullamco
+      laboris nisi ut aliquip ex ea commodo consequat.
+
+
+      Excepteur sint occaecat cupidatat non proident, sunt in culpa
+      qui officia deserunt mollit anim id est laborum\"
 }
 @end lilypond"
   (stack-lines DOWN 0.0 baseline-skip
@@ -1043,10 +1003,10 @@ the line width, where @var{X} is the number of staff spaces.
 @lilypond[verbatim,quote]
 \\header {
   title = \"My title\"
-  descr = \"Lorem ipsum dolor sit amet, consectetur adipisicing elit,
-  sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
-  Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
-  nisi ut aliquip ex ea commodo consequat.\"
+  myText = \"Lorem ipsum dolor sit amet, consectetur adipisicing
+    elit, sed do eiusmod tempor incididunt ut labore et dolore magna
+    aliqua.  Ut enim ad minim veniam, quis nostrud exercitation ullamco
+    laboris nisi ut aliquip ex ea commodo consequat.\"
 }
 
 \\paper {
@@ -1054,7 +1014,7 @@ the line width, where @var{X} is the number of staff spaces.
     \\column {
       \\fill-line { \\fromproperty #'header:title }
       \\null
-      \\wordwrap-field #'header:descr
+      \\wordwrap-field #'header:myText
     }
   }
 }
@@ -1077,10 +1037,10 @@ the line width, where @var{X} is the number of staff spaces.
 @lilypond[verbatim,quote]
 \\header {
   title = \"My title\"
-  descr = \"Lorem ipsum dolor sit amet, consectetur adipisicing elit,
-  sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
-  Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
-  nisi ut aliquip ex ea commodo consequat.\"
+  myText = \"Lorem ipsum dolor sit amet, consectetur adipisicing
+    elit, sed do eiusmod tempor incididunt ut labore et dolore magna
+    aliqua.  Ut enim ad minim veniam, quis nostrud exercitation ullamco
+    laboris nisi ut aliquip ex ea commodo consequat.\"
 }
 
 \\paper {
@@ -1088,7 +1048,7 @@ the line width, where @var{X} is the number of staff spaces.
     \\column {
       \\fill-line { \\fromproperty #'header:title }
       \\null
-      \\justify-field #'header:descr
+      \\justify-field #'header:myText
     }
   }
 }
@@ -1102,7 +1062,7 @@ the line width, where @var{X} is the number of staff spaces.
         (justify-string-markup layout props m)
         empty-stencil)))
 
-(define-builtin-markup-command (combine layout props m1 m2)
+(define-builtin-markup-command (combine layout props arg1 arg2)
   (markup? markup?)
   align
   ()
@@ -1127,8 +1087,8 @@ curly braces as an argument; the follow example will not compile:
     \\arrow-head #Y #DOWN ##f
 }
 @end lilypond"
-  (let* ((s1 (interpret-markup layout props m1))
-        (s2 (interpret-markup layout props m2)))
+  (let* ((s1 (interpret-markup layout props arg1))
+        (s2 (interpret-markup layout props arg2)))
     (ly:stencil-add s1 s2)))
 
 ;;
@@ -1142,8 +1102,8 @@ curly braces as an argument; the follow example will not compile:
 @cindex stacking text in a column
 
 Stack the markups in @var{args} vertically.  The property
-@code{baseline-skip} determines the space between each
-markup in @var{args}.
+@code{baseline-skip} determines the space between markups
+in @var{args}.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -1166,19 +1126,26 @@ markup in @var{args}.
   "
 @cindex changing direction of text columns
 
-Make a column of args, going up or down, depending on the setting
-of the @code{#'direction} layout property.
+Make a column of @var{args}, going up or down, depending on the
+setting of the @code{direction} layout property.
 
 @lilypond[verbatim,quote]
 \\markup {
-  \\override #'(direction . 1) {
+  \\override #`(direction . ,UP) {
     \\dir-column {
       going up
     }
   }
+  \\hspace #1
   \\dir-column {
     going down
   }
+  \\hspace #1
+  \\override #'(direction . 1) {
+    \\dir-column {
+      going up
+    }
+  }
 }
 @end lilypond"
   (stack-lines (if (number? direction) direction -1)
@@ -1186,7 +1153,13 @@ of the @code{#'direction} layout property.
                baseline-skip
                (interpret-markup-list layout props args)))
 
-(define-builtin-markup-command (center-align layout props args)
+(define (general-column align-dir baseline mols)
+  "Stack @var{mols} vertically, aligned to  @var{align-dir} horizontally."
+  
+  (let* ((aligned-mols (map (lambda (x) (ly:stencil-aligned-to x X align-dir)) mols)))
+    (stack-lines -1 0.0 baseline aligned-mols)))
+
+(define-builtin-markup-command (center-column layout props args)
   (markup-list?)
   align
   ((baseline-skip))
@@ -1197,16 +1170,54 @@ Put @code{args} in a centered column.
 
 @lilypond[verbatim,quote]
 \\markup {
-  \\center-align {
+  \\center-column {
+    one
+    two
+    three
+  }
+}
+@end lilypond"
+  (general-column CENTER baseline-skip (interpret-markup-list layout props args)))
+
+(define-builtin-markup-command (left-column layout props args)
+  (markup-list?)
+  align
+  ((baseline-skip))
+ "
+@cindex text columns, left-aligned 
+
+Put @code{args} in a left-aligned column.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\left-column {
     one
     two
     three
   }
 }
 @end lilypond"
-  (let* ((mols (interpret-markup-list layout props args))
-         (cmols (map (lambda (x) (ly:stencil-aligned-to x X CENTER)) mols)))
-    (stack-lines -1 0.0 baseline-skip cmols)))
+  (general-column LEFT baseline-skip (interpret-markup-list layout props args)))
+
+(define-builtin-markup-command (right-column layout props args)
+  (markup-list?)
+  align
+  ((baseline-skip))
+ "
+@cindex text columns, right-aligned
+
+Put @code{args} in a right-aligned column.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\right-column {
+    one
+    two
+    three
+  }
+}
+@end lilypond"
+  (general-column RIGHT baseline-skip (interpret-markup-list layout props args)))
 
 (define-builtin-markup-command (vcenter layout props arg)
   (markup?)
@@ -1219,16 +1230,16 @@ Align @code{arg} to its Y@tie{}center.
 
 @lilypond[verbatim,quote]
 \\markup {
-  \\arrow-head #X #RIGHT ##f
+  one
   \\vcenter
-  Centered
-  \\arrow-head #X #LEFT ##f
+  two
+  three
 }
 @end lilypond"
   (let* ((mol (interpret-markup layout props arg)))
     (ly:stencil-aligned-to mol Y CENTER)))
 
-(define-builtin-markup-command (hcenter layout props arg)
+(define-builtin-markup-command (center-align layout props arg)
   (markup?)
   align
   ()
@@ -1240,9 +1251,10 @@ Align @code{arg} to its X@tie{}center.
 @lilypond[verbatim,quote]
 \\markup {
   \\column {
-    â†“
-    \\hcenter
-    centered
+    one
+    \\center-align
+    two
+    three
   }
 }
 @end lilypond"
@@ -1261,9 +1273,10 @@ Align @var{arg} on its right edge.
 @lilypond[verbatim,quote]
 \\markup {
   \\column {
-    â†“
+    one
     \\right-align
-    right-aligned
+    two
+    three
   }
 }
 @end lilypond"
@@ -1282,9 +1295,10 @@ Align @var{arg} on its left edge.
 @lilypond[verbatim,quote]
 \\markup {
   \\column {
-    â†“
+    one
     \\left-align
-    left-aligned
+    two
+    three
   }
 }
 @end lilypond"
@@ -1303,26 +1317,28 @@ Align @var{arg} in @var{axis} direction to the @var{dir} side.
 @lilypond[verbatim,quote]
 \\markup {
   \\column {
-    â†“
+    one
     \\general-align #X #LEFT
-    \\line { X, Left }
-    â†“
+    two
+    three
+    \\null
+    one
     \\general-align #X #CENTER
-    \\line { X, Center }
+    two
+    three
     \\null
     \\line {
-      \\arrow-head #X #RIGHT ##f
-      \\general-align #Y #DOWN
-      \\line { Y, Down }
-      \\arrow-head #X #LEFT ##f
+      one
+      \\general-align #Y #UP
+      two
+      three
     }
+    \\null
     \\line {
-      \\arrow-head #X #RIGHT ##f
+      one
       \\general-align #Y #3.2
-      \\line {
-        \\line { Y, Arbitrary alignment }
-      }
-      \\arrow-head #X #LEFT ##f
+      two
+      three
     }
   }
 }
@@ -1344,20 +1360,25 @@ alignment accordingly.
 @lilypond[verbatim,quote]
 \\markup {
   \\column {
-    â†“
+    one
     \\halign #LEFT
-    Left
-    â†“
+    two
+    three
+    \\null
+    one
     \\halign #CENTER
-    Center
-    â†“
+    two
+    three
+    \\null
+    one
     \\halign #RIGHT
-    Right
-    â†“
-    \\halign #1.2
-    \\line {
-      Arbitrary alignment
-    }
+    two
+    three
+    \\null
+    one
+    \\halign #-5
+    two
+    three
   }
 }
 @end lilypond"
@@ -1379,7 +1400,21 @@ Set the dimensions of @var{arg} to @var{x} and@tie{}@var{y}."
   (number? markup?)
   align
   ()
-  "Add padding @var{amount} all around @var{arg}."  
+  "Add padding @var{amount} all around @var{arg}.
+  
+@lilypond[verbatim,quote]
+\\markup {
+  \\box {
+    default
+  }
+  \\hspace #2
+  \\box {
+    \\pad-around #0.5 {
+      padded
+    }
+  }
+}
+@end lilypond"
   (let* ((m (interpret-markup layout props arg))
          (x (ly:stencil-extent m X))
          (y (ly:stencil-extent m Y)))
@@ -1394,7 +1429,21 @@ Set the dimensions of @var{arg} to @var{x} and@tie{}@var{y}."
   "
 @cindex padding text horizontally
 
-Add padding @var{amount} around @var{arg} in the X@tie{}direction."
+Add padding @var{amount} around @var{arg} in the X@tie{}direction.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\box {
+    default
+  }
+  \\hspace #4
+  \\box {
+    \\pad-x #2 {
+      padded
+    }
+  }
+}
+@end lilypond"
   (let* ((m (interpret-markup layout props arg))
          (x (ly:stencil-extent m X))
          (y (ly:stencil-extent m Y)))
@@ -1402,8 +1451,8 @@ Add padding @var{amount} around @var{arg} in the X@tie{}direction."
                      (interval-widen x amount)
                      y)))
 
-(define-builtin-markup-command (put-adjacent layout props arg1 axis dir arg2)
-  (markup? integer? ly:dir? markup?)
+(define-builtin-markup-command (put-adjacent layout props axis dir arg1 arg2)
+  (integer? ly:dir? markup? markup?)
   align
   ()
   "Put @var{arg2} next to @var{arg1}, without moving @var{arg1}."
@@ -1415,7 +1464,7 @@ Add padding @var{amount} around @var{arg} in the X@tie{}direction."
   (markup?)
   other
   ()
-  "Make the argument transparent.
+  "Make @var{arg} transparent.
   
 @lilypond[verbatim,quote]
 \\markup {
@@ -1433,7 +1482,21 @@ Add padding @var{amount} around @var{arg} in the X@tie{}direction."
   (number-pair? number-pair? markup?)
   align
   ()
-  "Make @var{arg} take at least @var{x-ext}, @var{y-ext} space."
+  "Make @var{arg} take at least @var{x-ext}, @var{y-ext} space.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\box {
+    default
+  }
+  \\hspace #4
+  \\box {
+    \\pad-to-box #'(0 . 10) #'(0 . 3) {
+      padded
+    }
+  }
+}
+@end lilypond"
   (let* ((m (interpret-markup layout props arg))
          (x (ly:stencil-extent m X))
          (y (ly:stencil-extent m Y)))
@@ -1446,12 +1509,32 @@ Add padding @var{amount} around @var{arg} in the X@tie{}direction."
   align
   ()
   "Center @var{arg} horizontally within a box of extending
-@var{length}/2 to the left and right."
+@var{length}/2 to the left and right.
+
+@lilypond[quote,verbatim]
+\\new StaffGroup <<
+  \\new Staff {
+    \\set Staff.instrumentName = \\markup {
+      \\hcenter-in #12
+      Oboe
+    }
+    c''1
+  }
+  \\new Staff {
+    \\set Staff.instrumentName = \\markup {
+      \\hcenter-in #12
+      Bassoon
+    }
+    \\clef tenor
+    c'1
+  }
+>>
+@end lilypond"
   (interpret-markup layout props
                     (make-pad-to-box-markup
                      (cons (/ length -2) (/ length 2))
                      '(0 . 0)
-                     (make-hcenter-markup arg))))
+                     (make-center-align-markup arg))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; property
@@ -1502,13 +1585,10 @@ returns an empty markup.
   "
 @cindex overriding properties within text markup
 
-Add the first argument in to the property list.  Properties may be
-any sort of property supported by @rinternals{font-interface} and
-@rinternals{text-interface}, for example
-
-@example
-\\override #'(font-family . married) \"bla\"
-@end example
+Add the argument @var{new-prop} to the property list.  Properties
+may be any property supported by @rinternals{font-interface},
+@rinternals{text-interface} and
+@rinternals{instrument-specific-markup-interface}.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -1537,7 +1617,7 @@ 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 file @var{name}, and include it verbatim.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -1556,33 +1636,12 @@ any sort of property supported by @rinternals{font-interface} and
 ;; fonts.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(define-builtin-markup-command (bigger layout props arg)
-  (markup?)
-  font
-  ()
-  "Increase the font size relative to current setting.
-
-@lilypond[verbatim,quote]
-\\markup {
-  \\huge {
-    huge
-    \\hspace #2
-    \\bigger {
-      bigger
-    }
-    \\hspace #2
-    huge
-  }
-}
-@end lilypond"
-  (interpret-markup layout props
-   `(,fontsize-markup 1 ,arg)))
 
 (define-builtin-markup-command (smaller layout props arg)
   (markup?)
   font
   ()
-  "Decrease the font size relative to current setting.
+  "Decrease the font size relative to the current setting.
   
 @lilypond[verbatim,quote]
 \\markup {
@@ -1604,7 +1663,7 @@ any sort of property supported by @rinternals{font-interface} and
   (markup?)
   font
   ()
-  "Copy of the @code{\\bigger} command.
+  "Increase the font size relative to the current setting.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -1614,13 +1673,15 @@ any sort of property supported by @rinternals{font-interface} and
   larger
 }
 @end lilypond"
-  (interpret-markup layout props (make-bigger-markup arg)))
+  (interpret-markup layout props
+   `(,fontsize-markup 1 ,arg)))
 
 (define-builtin-markup-command (finger layout props arg)
   (markup?)
   font
   ()
-  "Set the argument as small numbers.
+  "Set @var{arg} as small numbers.
+
 @lilypond[verbatim,quote]
 \\markup {
   \\finger {
@@ -1637,7 +1698,8 @@ any sort of property supported by @rinternals{font-interface} and
   font
   ()
   "Use @var{size} as the absolute font size to display @var{arg}.
-Adjust baseline skip and word space accordingly.
+Adjusts @code{baseline-skip} and @code{word-space} accordingly.
+
 @lilypond[verbatim,quote]
 \\markup {
   default text font size
@@ -1665,7 +1727,9 @@ Adjust baseline skip and word space accordingly.
   ((font-size 0)
    (word-space 1)
    (baseline-skip 2))
-  "Add @var{increment} to the font-size.  Adjust baseline skip accordingly.
+  "Add @var{increment} to the font-size.  Adjusts @code{baseline-skip}
+accordingly.
+
 @lilypond[verbatim,quote]
 \\markup {
   default
@@ -1731,7 +1795,7 @@ Use @code{\\fontsize} otherwise.
   (markup?)
   font
   ()
-  "Switch to the sans serif family.
+  "Switch to the sans serif font family.
   
 @lilypond[verbatim,quote]
 \\markup {
@@ -1749,8 +1813,8 @@ Use @code{\\fontsize} otherwise.
   font
   ()
   "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.
+time signatures and fingerings.  This font contains numbers and
+some punctuation; it has no letters.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -1894,7 +1958,7 @@ fonts which support the @code{caps} font shape."
   (interpret-markup layout (prepend-alist-chain 'font-shape 'caps props) arg))
 
 ;; Poor man's caps
-(define-builtin-markup-command (smallCaps layout props text)
+(define-builtin-markup-command (smallCaps layout props arg)
   (markup?)
   font
   ()
@@ -1938,9 +2002,9 @@ Note: @code{\\smallCaps} does not support accented characters.
                                            currents current-is-lower)
                                         prev-result)))))))
   (interpret-markup layout props
-    (if (string? text)
-       (make-small-caps (string->list text) (list) #f (list))
-       text)))
+    (if (string? arg)
+       (make-small-caps (string->list arg) (list) #f (list))
+       arg)))
 
 (define-builtin-markup-command (caps layout props arg)
   (markup?)
@@ -2036,7 +2100,8 @@ done in a different font.  The recommended font for this is bold and italic.
   (markup?)
   font
   ()
-  "Set font shape to @code{upright}.  This is the opposite of @code{italic}.
+  "Set @code{font-shape} to @code{upright}.  This is the opposite
+of @code{italic}.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -2058,7 +2123,7 @@ done in a different font.  The recommended font for this is bold and italic.
   (markup?)
   font
   ()
-  "Switch to medium font series (in contrast to bold).
+  "Switch to medium font-series (in contrast to bold).
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -2150,7 +2215,7 @@ normal text font, no matter what font was used earlier.
   ()
   music
   ()
-  "Draw a semi sharp symbol.
+  "Draw a semisharp symbol.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -2249,12 +2314,12 @@ Draw @var{arg} in color specified by @var{color}.
     (ly:make-stencil (list 'color color (ly:stencil-expr stil))
                     (ly:stencil-extent stil X)
                     (ly:stencil-extent stil Y))))
-\f
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; glyphs
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(define-builtin-markup-command (arrow-head layout props axis direction filled)
+(define-builtin-markup-command (arrow-head layout props axis dir filled)
   (integer? ly:dir? boolean?)
   graphic
   ()
@@ -2279,7 +2344,7 @@ Use the filled head if @var{filled} is specified.
                         "close"
                         "open")
                     axis
-                    direction)))
+                    dir)))
     (ly:font-get-glyph
      (ly:paper-get-font layout (cons '((font-encoding . fetaMusic))
                                     props))
@@ -2336,12 +2401,12 @@ the possible glyphs.
   (integer?)
   other
   ()
-  "Produce a single character.  For example, @code{\\char #65} produces the 
-letter @q{A}.
+  "Produce a single character.  Characters encoded in hexadecimal
+format require the prefix @code{#x}.
 
 @lilypond[verbatim,quote]
 \\markup {
-  \\char #65
+  \\char #65 \\char ##x00a9
 }
 @end lilypond"
   (ly:text-interface::interpret-markup layout props (ly:wide-char->utf-8 num)))
@@ -2403,7 +2468,6 @@ and continue with double letters.
      (number->markletter-string number->mark-alphabet-vector num)))
 
 (define-public (horizontal-slash-interval num forward number-interval mag)
-  (ly:message "Mag step: ~a" mag)
   (if forward
     (cond ;((= num 6) (interval-widen number-interval (* mag 0.5)))
           ;((= num 5) (interval-widen number-interval (* mag 0.5)))
@@ -2449,13 +2513,10 @@ and continue with double letters.
          (num-y (interval-widen (cons center center) (abs dy)))
          (is-sane (and (interval-sane? num-x) (interval-sane? num-y)))
          (slash-stencil (if is-sane
-                            (ly:make-stencil
-                             `(draw-line ,thickness
-                                         ,(car num-x) ,(- (interval-center num-y) dy)
-                                         ,(cdr num-x) ,(+ (interval-center num-y) dy))
-                             num-x num-y)
+                            (make-line-stencil thickness 
+                                         (car num-x) (- (interval-center num-y) dy)
+                                         (cdr num-x) (+ (interval-center num-y) dy))
                             #f)))
-(ly:message "Num: ~a, X-interval: ~a" num num-x)
     (if (ly:stencil? slash-stencil)
       (begin
         ; for some numbers we need to shift the slash/backslash up or down to make
@@ -2507,6 +2568,94 @@ figured bass notation.
 @end lilypond"
   (slashed-digit-internal layout props num #f font-size thickness))
 
+;; eyeglasses
+(define 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")
+
+(define-builtin-markup-command (eyeglasses layout props) () other ()
+  "Prints out eyeglasses, indicating strongly to look at the conductor.
+@lilypond[verbatim,quote]
+\\markup { \\eyeglasses }
+@end lilypond"
+  (interpret-markup layout props
+    (make-with-dimensions-markup '(-0.61 . 3.22) '(0.2 . 2.41)
+      (make-postscript-markup eyeglassesps))))
+
+(define-builtin-markup-command (left-brace layout props size)
+  (number?)
+  other
+  ()
+  "
+A feta brace in point size @var{size}.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\left-brace #35
+  \\hspace #2
+  \\left-brace #45
+}
+@end lilypond"
+  (let* ((font (ly:paper-get-font layout
+                                  (cons '((font-encoding . fetaBraces)
+                                          (font-name . #f))
+                                        props)))
+        (glyph-count (1- (ly:otf-glyph-count font)))
+         (scale (ly:output-def-lookup layout 'output-scale))
+         (scaled-size (/ (ly:pt size) scale))
+         (glyph (lambda (n)
+                  (ly:font-get-glyph font (string-append "brace"
+                                                        (number->string n)))))
+        (get-y-from-brace (lambda (brace)
+                            (interval-length
+                             (ly:stencil-extent (glyph brace) Y))))
+         (find-brace (binary-search 0 glyph-count get-y-from-brace scaled-size))
+         (glyph-found (glyph find-brace)))
+
+    (if (or (null? (ly:stencil-expr glyph-found))
+           (< scaled-size (interval-length (ly:stencil-extent (glyph 0) Y)))
+           (> scaled-size (interval-length
+                           (ly:stencil-extent (glyph glyph-count) Y))))
+        (begin
+          (ly:warning (_ "no brace found for point size ~S ") size)
+          (ly:warning (_ "defaulting to ~S pt")
+                     (/ (* scale (interval-length
+                                  (ly:stencil-extent glyph-found Y)))
+                        (ly:pt 1)))))
+    glyph-found))
+
+(define-builtin-markup-command (right-brace layout props size)
+  (number?)
+  other
+  ()
+  "
+A feta brace in point size @var{size}, rotated 180 degrees.
+
+@lilypond[verbatim,quote]
+\\markup {
+  \\right-brace #45
+  \\hspace #2
+  \\right-brace #35
+}
+@end lilypond"
+  (interpret-markup layout props (markup #:rotate 180 #:left-brace size)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; the note command.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2522,7 +2671,7 @@ figured bass notation.
 @cindex notes within text by log and dot-count
 
 Construct a note symbol, with stem.  By using fractional values for
-@var{dir}, you can obtain longer or shorter stems.
+@var{dir}, longer or shorter stems can be obtained.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -2663,10 +2812,10 @@ A negative @var{amount} indicates raising; see also @code{\\raise}.
 
 @lilypond[verbatim,quote]
 \\markup {
-  default
-  \\lower #3 {
-    three spaces lower
-  }
+  one
+  \\lower #3
+  two
+  three
 }
 @end lilypond"
   (ly:stencil-translate-axis (interpret-markup layout props arg)
@@ -2794,8 +2943,7 @@ Set @var{arg} in superscript with a normal font size.
   "  
 @cindex superscript text
 
-Raising and lowering texts can be done with @code{\\super} and
-@code{\\sub}:
+Set @var{arg} in superscript.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -2822,16 +2970,8 @@ Raising and lowering texts can be done with @code{\\super} and
   "
 @cindex translating text
   
-This translates an object.  Its first argument is a cons of numbers.
-
-@example
-A \\translate #(cons 2 -3) @{ B C @} D
-@end example
-
-This moves @q{B C} 2@tie{}spaces to the right, and 3 down, relative to its
-surroundings.  This command cannot be used to move isolated scripts
-vertically, for the same reason that @code{\\raise} cannot be used for
-that.
+Translate @var{arg} relative to its surroundings.  @var{offset}
+is a pair of numbers representing the displacement in the X and Y axis.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -2879,7 +3019,7 @@ Set @var{arg} in subscript.
   "
 @cindex setting subscript in standard font size
 
-Set @var{arg} in subscript, in a normal font size.
+Set @var{arg} in subscript with a normal font size.
 
 @lilypond[verbatim,quote]
 \\markup {
@@ -2893,7 +3033,7 @@ Set @var{arg} in subscript, in a normal font size.
    (interpret-markup layout props arg)
    (* -0.5 baseline-skip)
    Y))
-\f
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; brackets.
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2939,7 +3079,7 @@ Draw vertical brackets around @var{arg}.
   (let ((th 0.1) ;; todo: take from GROB.
         (m (interpret-markup layout props arg)))
     (bracketify-stencil m Y th (* 2.5 th) th)))
-\f
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Delayed markup evaluation
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2972,7 +3112,7 @@ when @var{label} is not found."
                                    (markup #:concat (#:hspace gap page-markup)))))))
      x-ext
      y-ext)))
-\f
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Markup list commands
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;