* lily/output-def.cc (lookup_variable): return SCM_UNDEFINED if undefined.
* Documentation/user/global.itely (Page formatting): document
horizontalshift.
* scm/page-layout.scm (default-page-music-height):
horizontalshift: new variable, shift all systems by
horizontalshift to the right, to make space for instrument names.
* scm/paper.scm (set-paper-dimension-variables): add horizontalshift
* lily/input-scheme.cc (LY_DEFINE): take format commands.
+2005-07-21 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/output-def-scheme.cc (LY_DEFINE): take default argument.
+
+ * lily/output-def.cc (lookup_variable): return SCM_UNDEFINED if undefined.
+
+ * Documentation/user/global.itely (Page formatting): document
+ horizontalshift.
+
+ * scm/page-layout.scm (default-page-music-height):
+ horizontalshift: new variable, shift all systems by
+ horizontalshift to the right, to make space for instrument names.
+
+ * scm/paper.scm (set-paper-dimension-variables): add horizontalshift
+
+ * lily/input-scheme.cc (LY_DEFINE): take format commands.
2005-07-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
* lily/include/paper-column.hh (class Paper_column): add
non-static get_rank() member.
+ * VERSION: release 2.7.1
+
* scm/framework-null.scm: new file, used for benchmarking.
2005-07-20 Heikki Junes <hjunes@cc.hut.fi>
Increasing this will put systems whose bounding boxes almost touch
farther apart.
+
+@item horizontalshift
+All systems (including titles and system separators) are shifted by
+this amount to the right. Page markup, such as headers and footers are
+not affected by this. The purpose of this variable is to make space
+for instrument names at the left.
+
+
@item aftertitlespace
Amount of space between the title and the first system.
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=7
-PATCH_LEVEL=1
+PATCH_LEVEL=2
MY_PATCH_LEVEL=
{
SCM defaults
= g->get_layout ()->lookup_variable (ly_symbol2scm ("font-defaults"));
+ if (defaults == SCM_UNDEFINED)
+ defaults = SCM_EOL;
return g->get_property_alist_chain (defaults);
}
{
SCM defaults
= g->get_layout ()->lookup_variable (ly_symbol2scm ("text-font-defaults"));
+ if (defaults == SCM_UNDEFINED)
+ defaults = SCM_EOL;
return g->get_property_alist_chain (defaults);
}
SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
if (global == SCM_UNDEFINED)
- global
- = sc->get_layout ()->lookup_variable (ly_symbol2scm ("font-defaults"));
-
+ {
+ global = sc->get_layout ()->lookup_variable (ly_symbol2scm ("font-defaults"));
+ if (global == SCM_UNDEFINED)
+ global = SCM_EOL;
+ }
+
return sc->get_property_alist_chain (global);
}
return unsmob_input (x) ? SCM_BOOL_T : SCM_BOOL_F;
}
-LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 0, (SCM sip, SCM msg),
- "Print @var{msg} as a GNU compliant error message, pointing to the"
- "location in @var{sip}.\n")
+LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 1, (SCM sip, SCM msg, SCM rest),
+ "Print @var{msg} as a GNU compliant error message, pointing to the "
+ "location in @var{sip}. @var{msg} is interpreted similar to @code{format}'s argument\n")
{
Input *ip = unsmob_input (sip);
SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
SCM_ASSERT_TYPE (scm_is_string (msg), msg, SCM_ARG2, __FUNCTION__, "string");
+ msg = scm_simple_format (SCM_BOOL_F, msg, rest);
+
String m = ly_scm2string (msg);
ip->message (m);
#include "context-def.hh"
LY_DEFINE (ly_layout_lookup, "ly:output-def-lookup",
- 2, 0, 0, (SCM pap, SCM sym),
+ 2, 1, 0, (SCM pap, SCM sym, SCM def),
"Lookup @var{sym} in @var{pap}. "
- "Return the value or @code{'()} if undefined.")
+ "Return the value or @var{def} (which defaults to @code{'()}) if undefined.")
{
Output_def *op = unsmob_output_def (pap);
SCM_ASSERT_TYPE (op, pap, SCM_ARG1, __FUNCTION__, "Output_def");
SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
+
+ SCM answer = op->lookup_variable (sym);
+ if (answer == SCM_UNDEFINED)
+ {
+ if (def == SCM_UNDEFINED)
+ def = SCM_EOL;
+
+ answer = def;
+ }
- return op->lookup_variable (sym);
+ return answer;
}
LY_DEFINE (ly_output_def_scope, "ly:output-def-scope",
if (parent_)
return parent_->lookup_variable (sym);
- return SCM_EOL;
+ return SCM_UNDEFINED;
}
SCM
(vsize (ly:output-def-lookup layout 'vsize))
(hsize (ly:output-def-lookup layout 'hsize))
-
+
+ (system-xoffset (ly:output-def-lookup layout 'horizontalshift 0.0))
(system-separator-markup (ly:output-def-lookup layout 'systemSeparatorMarkup))
(system-separator-stencil (if (markup? system-separator-markup)
(interpret-markup layout
#f))
(lmargin (ly:output-def-lookup layout 'leftmargin))
(leftmargin (if lmargin
- lmargin
- (/ (- hsize
- (ly:output-def-lookup layout 'linewidth)) 2)))
-
- (rightmargin (ly:output-def-lookup layout 'rightmargin))
- (bottom-edge (- vsize
- (ly:output-def-lookup layout 'bottommargin)))
-
- (head (page-headfoot layout scopes number 'make-header 'headsep UP last?))
- (foot (page-headfoot layout scopes number 'make-footer 'footsep DOWN last?))
-
- (head-height (if (ly:stencil? head)
- (interval-length (ly:stencil-extent head Y))
- 0.0))
-
- (height-proc (ly:output-def-lookup layout 'page-music-height))
-
- (page-stencil (ly:make-stencil '()
- (cons leftmargin hsize)
- (cons (- topmargin) 0)))
- (last-system #f)
- (last-y 0.0)
- (add-to-page (lambda (stencil y)
- (set! page-stencil
- (ly:stencil-add page-stencil
- (ly:stencil-translate-axis stencil
- (- 0 head-height y topmargin) Y)))))
- (add-system
- (lambda (stencil-position)
- (let* ((system (car stencil-position))
- (stencil (ly:paper-system-stencil system))
- (y (cadr stencil-position))
- (is-title (ly:paper-system-title?
- (car stencil-position))))
- (add-to-page stencil y)
- (if (and (ly:stencil? system-separator-stencil)
- last-system
- (not (ly:paper-system-title? system))
- (not (ly:paper-system-title? last-system)))
- (add-to-page
- system-separator-stencil
- (average (- last-y
- (car (ly:paper-system-staff-extents last-system)))
- (- y
- (cdr (ly:paper-system-staff-extents system))))))
- (set! last-system system)
- (set! last-y y)))))
+ lmargin
+ (/ (- hsize
+ (ly:output-def-lookup layout 'linewidth)) 2)))
+
+ (rightmargin (ly:output-def-lookup layout 'rightmargin))
+ (bottom-edge (- vsize
+ (ly:output-def-lookup layout 'bottommargin)))
+
+ (head (page-headfoot layout scopes number 'make-header 'headsep UP last?))
+ (foot (page-headfoot layout scopes number 'make-footer 'footsep DOWN last?))
+
+ (head-height (if (ly:stencil? head)
+ (interval-length (ly:stencil-extent head Y))
+ 0.0))
+
+ (height-proc (ly:output-def-lookup layout 'page-music-height))
+
+ (page-stencil (ly:make-stencil '()
+ (cons leftmargin hsize)
+ (cons (- topmargin) 0)))
+ (last-system #f)
+ (last-y 0.0)
+ (add-to-page (lambda (stencil y)
+ (set! page-stencil
+ (ly:stencil-add page-stencil
+ (ly:stencil-translate stencil
+ (cons
+ system-xoffset
+ (- 0 head-height y topmargin))
+
+ )))))
+ (add-system
+ (lambda (stencil-position)
+ (let* ((system (car stencil-position))
+ (stencil (ly:paper-system-stencil system))
+ (y (cadr stencil-position))
+ (is-title (ly:paper-system-title?
+ (car stencil-position))))
+ (add-to-page stencil y)
+ (if (and (ly:stencil? system-separator-stencil)
+ last-system
+ (not (ly:paper-system-title? system))
+ (not (ly:paper-system-title? last-system)))
+ (add-to-page
+ system-separator-stencil
+ (average (- last-y
+ (car (ly:paper-system-staff-extents last-system)))
+ (- y
+ (cdr (ly:paper-system-staff-extents system))))))
+ (set! last-system system)
+ (set! last-y y)))))
(if #f
(display (list
(module-define! mod 'dimension-variables
'(pt mm cm in staffheight staff-space
betweensystemspace betweensystempadding
- linewidth indent hsize vsize
+ linewidth indent hsize vsize horizontalshift
staffspace linethickness ledgerlinethickness
blotdiameter interscoreline leftmargin rightmargin)))