From 87d48c0b8a5c75a1476bbb88ca853de838f3c7ac Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 31 Mar 2005 13:09:53 +0000 Subject: [PATCH] * scm/page-layout.scm (default-page-make-stencil): only add header if existing and not empty. Fixes spurious programming error. * lily/span-bar.cc (print): don't make rounded edges for spanbars. --- ChangeLog | 7 +++++++ lily/bar-line.cc | 17 +++++++++++------ lily/include/bar-line.hh | 4 ++-- lily/span-bar.cc | 5 +++-- lily/stencil-scheme.cc | 1 + scm/output-ps.scm | 2 -- scm/output-svg.scm | 1 - scm/output-tex.scm | 2 -- scm/page-layout.scm | 14 ++++++++++---- 9 files changed, 34 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44b5b97e2a..260bf447a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-03-31 Han-Wen Nienhuys + + * scm/page-layout.scm (default-page-make-stencil): only add header + if existing and not empty. Fixes spurious programming error. + + * lily/span-bar.cc (print): don't make rounded edges for spanbars. + 2005-03-31 Erlend Aasland * scm/output-tex.scm: implement {re,}setcolor diff --git a/lily/bar-line.cc b/lily/bar-line.cc index fa803dbfdf..a6b5336202 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -33,13 +33,14 @@ Bar_line::print (SCM smob) if (sz <= 0) return SCM_EOL; - return compound_barline (me, str, sz).smobbed_copy (); + return compound_barline (me, str, sz, true).smobbed_copy (); } return SCM_EOL; } Stencil -Bar_line::compound_barline (Grob *me, String str, Real h) +Bar_line::compound_barline (Grob *me, String str, Real h, + bool rounded) { Real kern = robust_scm2double (me->get_property ("kern"), 1); Real thinkern = robust_scm2double (me->get_property ("thin-kern"), 1); @@ -54,8 +55,8 @@ Bar_line::compound_barline (Grob *me, String str, Real h) hair *= staffline; fatline *= staffline; - Stencil thin = simple_barline (me, hair, h); - Stencil thick = simple_barline (me, fatline, h); + Stencil thin = simple_barline (me, hair, h, rounded); + Stencil thick = simple_barline (me, fatline, h, rounded); Stencil dot = Font_interface::get_default_font (me)->find_by_name ("dots.dot"); int lines = Staff_symbol_referencer::line_count (me); @@ -142,9 +143,13 @@ Bar_line::compound_barline (Grob *me, String str, Real h) Stencil Bar_line::simple_barline (Grob *me, Real w, - Real h) + Real h, + bool rounded) { - Real blot = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter")); + Real blot = + rounded + ? me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter")) + : 0.0; return Lookup::round_filled_box (Box (Interval (0, w), Interval (-h / 2, h / 2)), blot); } diff --git a/lily/include/bar-line.hh b/lily/include/bar-line.hh index 657d95a493..fc613da48b 100644 --- a/lily/include/bar-line.hh +++ b/lily/include/bar-line.hh @@ -18,8 +18,8 @@ class Bar_line public: static bool has_interface (Grob *); - static Stencil compound_barline (Grob *, String, Real height); - static Stencil simple_barline (Grob *, Real wid, Real height); + static Stencil compound_barline (Grob *, String, Real height, bool rounded); + static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded); DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM)); diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 2d76103c38..4ed3029df7 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -94,7 +94,8 @@ Span_bar::print (SCM smobbed_me) { Stencil interbar = Bar_line::compound_barline (staff_bar, glyph_string, - l.length ()); + l.length (), + false); interbar.translate_axis (l.center (), Y_AXIS); span_bar_mol.add_stencil (interbar); } @@ -120,7 +121,7 @@ Span_bar::width_callback (SCM element_smob, SCM scm_axis) /* urg. */ - Stencil m = Bar_line::compound_barline (se, gl, 40 PT); + Stencil m = Bar_line::compound_barline (se, gl, 40 PT, false); return ly_interval2scm (m.extent (X_AXIS)); } diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index cfec55292a..e51fc41bcb 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -26,6 +26,7 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis", SCM_ASSERT_TYPE (scm_is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number"); Real real_amount = scm_to_double (amount); + #if 0 SCM_ASSERT_TYPE (!isinf (real_amount) && !isnan (real_amount), amount, SCM_ARG2, __FUNCTION__, "finite number"); diff --git a/scm/output-ps.scm b/scm/output-ps.scm index 51d6d968aa..dcfbfe0d1c 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -13,8 +13,6 @@ ;;;; * text setting, kerning. ;;;; * document output-interface -(debug-enable 'backtrace) - (define-module (scm output-ps) #:re-export (quote) diff --git a/scm/output-svg.scm b/scm/output-svg.scm index 56665a6a79..1e5d64b8c7 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -17,7 +17,6 @@ ;;;; * inkscape SVG-font support ;;;; - use fontconfig/fc-cache for now, see output-gnome.scm -(debug-enable 'backtrace) (define-module (scm output-svg)) (define this-module (current-module)) diff --git a/scm/output-tex.scm b/scm/output-tex.scm index 7d5bffda09..aec0f20357 100644 --- a/scm/output-tex.scm +++ b/scm/output-tex.scm @@ -6,8 +6,6 @@ ;;;; Han-Wen Nienhuys -;; (debug-enable 'backtrace) - ;; The public interface is tight. ;; It has to be, because user-code is evalled with this module. diff --git a/scm/page-layout.scm b/scm/page-layout.scm index fb32fb6eeb..bb288663dc 100644 --- a/scm/page-layout.scm +++ b/scm/page-layout.scm @@ -77,6 +77,7 @@ Offsets is a list of increasing numbers. They must be negated to create offsets. " + (let* ((topmargin (ly:output-def-lookup layout 'topmargin)) ;; TODO: naming vsize/hsize not analogous to TeX. @@ -142,13 +143,18 @@ create offsets. (if #f (display (list - "leftmargin" leftmargin "rightmargin" rightmargin))) + "leftmargin " leftmargin "rightmargin " rightmargin + ))) - (set! page-stencil (ly:stencil-combine-at-edge - page-stencil Y DOWN head 0. 0.)) + (if (and + (ly:stencil? head) + (not (ly:stencil-empty? head))) + (set! page-stencil (ly:stencil-combine-at-edge + page-stencil Y DOWN head 0. 0.))) (map add-system (zip lines offsets)) - (if (ly:stencil? foot) + (if (and (ly:stencil? foot) + (not (ly:stencil-empty? foot))) (set! page-stencil (ly:stencil-add page-stencil -- 2.39.5