2006-03-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * input/test/instrument-name-align.ly: new file.
+
+ * scm/define-markup-commands.scm (hcenter-in): add hcenter-in.
+
+ * input/test/instrument-name-align.ly: new file. Document how to
+ align instrument names.
+
* lily/mark-engraver.cc: remove properties.
* scm/define-context-properties.scm
--- /dev/null
+
+\header {
+
+
+ texidoc = "instrument names may be aligned manually by putting the
+names in padded boxes with @code{\markup}."
+
+
+}
+
+\version "2.7.39"
+
+\paper {
+ line-width = 15\cm
+}
+
+
+\new StaffGroup \relative
+<<
+ \new Staff {
+ \set Staff. instrument
+ = \markup { \hcenter-in #10 "blabla" }
+ c1 c1
+ }
+ \new Staff {
+ \set Staff. instrument
+ = \markup { \hcenter-in #10 "blo" }
+ c1 c1
+ }
+
+>>
x y)))
-(define-markup-command (pad-to-box layout props x-ext y-ext arg) (number-pair? number-pair? markup?)
+(define-markup-command (pad-to-box layout props x-ext y-ext arg)
+ (number-pair? number-pair? markup?)
"Make @var{arg} take at least @var{x-ext}, @var{y-ext} space"
(let*
(interval-union y-ext y))))
+(define-markup-command (hcenter-in layout props length arg)
+ (number? markup?)
+ "Center @var{arg} horizontally within a box of extending
+@var{length}/2 to the left and right."
+
+ (interpret-markup layout props
+ (make-pad-to-box-markup
+ (cons (/ length -2) (/ length 2))
+ '(0 . 0)
+ (make-hcenter-markup arg))))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; property