From 840b51809efb0ae5e42e946b8e1aed7b9778a8f6 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 30 Jan 2006 00:39:04 +0000 Subject: [PATCH] * Documentation/topdocs/NEWS.tely (Top): simplify NEWS entry, add Nicolas. * scm/define-markup-commands.scm (epsfile): add scaling to \epsfile. * ps/lilyponddefs.ps: remove start-system, stop-system, start-page fluff. This saves putting { } code on the stack, fixing stack overflows when including EPS files. --- ChangeLog | 13 ++++++++ Documentation/topdocs/NEWS.tely | 17 ++++++----- input/regression/completion-heads.ly | 13 +++----- input/regression/grob-tweak.ly | 2 +- lily/slur-scoring.cc | 1 + ps/lilyponddefs.ps | 35 ---------------------- scm/define-markup-commands.scm | 44 ++++++++++++++-------------- scm/framework-ps.scm | 8 ++--- scm/output-ps.scm | 19 ++++++++---- 9 files changed, 67 insertions(+), 85 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8620b8b7d3..2c11907350 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-01-30 Han-Wen Nienhuys + + * Documentation/topdocs/NEWS.tely (Top): simplify NEWS entry, add + Nicolas. + + * scm/define-markup-commands.scm (epsfile): add scaling to \epsfile. + + * ps/lilyponddefs.ps: remove start-system, stop-system, + start-page fluff. This saves putting { } code on the stack, fixing + stack overflows when including EPS files. + 2006-01-29 Graham Percival * Documentation/user/putting.itely: minor fixes (comments on -devel). @@ -16,6 +27,8 @@ 2006-01-28 Han-Wen Nienhuys + * input/regression/completion-heads.ly (texidoc): fix. + * lily/staff-symbol-referencer.cc (on_staff_line): idem. * lily/tie-formatting-problem.cc diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index cfc81ec629..5e3fd267ff 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -47,29 +47,30 @@ the @uref{../,LilyPond Documentation} @itemize @bullet -@item Parallel editing is possible using the \parallelMusic function: +@item +Music may for multiple parts can be interleaved, similar to MUP input. +This is done with the \parallelMusic function, + @lilypond[verbatim,raggedright] -\parallelMusic #'(voiceA voiceB voiceC) { +\parallelMusic #'(voiceA voiceB) { %% first bar group r8 g'16[ c''] e''[ g' c'' e''] r8 g'16[ c''] e''[ g' c'' e''] | - r16 e'8. ~ e'4 r16 e'8. ~ e'4 | c'2 c'2 | - %% second bar group r8 a'16[ d''] f''[ a' d'' f''] r8 a'16[ d''] f''[ a' d'' f''] | - r16 d'8. ~ d'4 r16 d'8. ~ d'4 | c'2 c'2 | } \new StaffGroup << \context Staff = "up" << - \new Voice { \voiceOne \voiceA } - \new Voice { \voiceTwo \voiceB } + \new Voice \voiceA >> \context Staff = "down" << - \new Voice { \clef bass \voiceC } + \new Voice \voiceC >> >> @end lilypond +This feature was contributed by Nicolas Sceaux. + @item Alignments of staves may be tuned per system. @lilypond[] #(set-global-staff-size 13) diff --git a/input/regression/completion-heads.ly b/input/regression/completion-heads.ly index 509ca914da..831c6d86cf 100644 --- a/input/regression/completion-heads.ly +++ b/input/regression/completion-heads.ly @@ -11,16 +11,11 @@ If the @code{Note_heads_engraver} is replaced by the @code{Completion_heads_engr \layout { raggedright= ##t } - -\relative c'{ +\new Voice \with { + \remove "Note_heads_engraver" + \consists "Completion_heads_engraver" +} \relative c'{ \time 2/4 c2. c8 d4 e f g a b c2.. b8 a g16 f4 e d c8. c2 } -\layout{ - \context{ - \Voice - \remove "Note_heads_engraver" - \consists "Completion_heads_engraver" - } -} diff --git a/input/regression/grob-tweak.ly b/input/regression/grob-tweak.ly index baf6ef1d6a..1ade70ea22 100644 --- a/input/regression/grob-tweak.ly +++ b/input/regression/grob-tweak.ly @@ -1,7 +1,7 @@ \header { - texidoc = "With the @code{\tweak} function, individual grobs that + texidoc = "With the @code{\\tweak} function, individual grobs that are directly caused by events may be tuned directly." } diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index 769f84f633..88d528e34f 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -538,6 +538,7 @@ Slur_score_state::get_base_attachments () const && !Stem::is_invisible (stem) && extremes_[d].stem_dir_ == dir_ && Stem::get_beaming (stem, -d) + && Stem::get_beam (stem) && (!spanner_less (slur_, Stem::get_beam (stem)) || has_same_beam_)) y = extremes_[d].stem_extent_[Y_AXIS][dir_]; diff --git a/ps/lilyponddefs.ps b/ps/lilyponddefs.ps index 536e7c36f4..9672572c99 100644 --- a/ps/lilyponddefs.ps +++ b/ps/lilyponddefs.ps @@ -27,41 +27,6 @@ grestore } bind def - -/place-box { - /object exch def - gsave - % exch translate - translate - 0 0 moveto - object - grestore -} bind def - - -% start-system -/start-system { - gsave -} bind def - -/start-page { - gsave - 0 - vsize translate -} bind def - - -/stop-system { - /the-line exch def - the-line stroke grestore -} bind def - - -/end-lilypond-output { -% showpage -} bind def - - /init-lilypond-parameters { staff-line-thickness setlinewidth staff-height init-paper diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index a914e69888..6d9d03cf16 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -190,43 +190,43 @@ normally inserted before elements on a line. #f))) -(def-markup-command (epsfile layout props file-name) (string?) - "Inline an EPS image. The image is scaled such that 10 PS units is -one staff-space." +(def-markup-command (epsfile layout props axis size file-name) (number? number? string?) + "Inline an EPS image. The image is scaled along @var{axis} to +@var{size}." (if (ly:get-option 'safe) (interpret-markup layout props "not allowed in safe") (let* ((contents (ly:gulp-file file-name)) (bbox (get-postscript-bbox contents)) + (bbox-size (if (= axis X) + (- (list-ref bbox 2) (list-ref bbox 0)) + (- (list-ref bbox 3) (list-ref bbox 1)) + )) + (factor (exact->inexact (/ size bbox-size))) (scaled-bbox - (if bbox - (map (lambda (x) (/ x 10)) bbox) - (begin - (ly:warning (_ "can't find bounding box of `~a'") - file-name) - '())))) - + (map (lambda (x) (* factor x)) bbox))) (if bbox - (ly:make-stencil (list 'embedded-ps - (string-append - - ; adobe 5002. - "BeginEPSF " - "0.1 0.1 scale " - (format "\n%%BeginDocument: ~a\n" file-name) - contents - "%%EndDocument\n" - "EndEPSF\n" - )) + (format + + "BeginEPSF +~a ~a scale +%%BeginDocument: ~a +~a +%%EndDocument +EndEPSF" + factor factor + file-name + contents)) (cons (list-ref scaled-bbox 0) (list-ref scaled-bbox 2)) (cons (list-ref scaled-bbox 1) (list-ref scaled-bbox 3))) - (ly:make-stencil "" '(0 . 0) '(0 . 0)))))) + (ly:make-stencil "" '(0 . 0) '(0 . 0))) + ))) (def-markup-command (postscript layout props str) (string?) diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 6ec77e7ad4..2961be4727 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -122,11 +122,11 @@ "") "%%EndPageSetup\n" - "start-page { " + "gsave 0 vsize translate " "set-ps-scale-to-lily-scale " "\n")) (ly:outputter-dump-stencil outputter page) - (ly:outputter-dump-string outputter "} stop-system \nshowpage\n")) + (ly:outputter-dump-string outputter "stroke grestore \nshowpage\n")) (define (supplies-or-needs paper load-fonts?) (define (extract-names font) @@ -492,9 +492,9 @@ (display header port) (write-preamble paper load-fonts? port) - (display "start-system { set-ps-scale-to-lily-scale \n" port) + (display "gsave set-ps-scale-to-lily-scale \n" port) (ly:outputter-dump-stencil outputter dump-me) - (display "} stop-system\n%%Trailer\n%%EOF\n" port) + (display "stroke grestore\n%%Trailer\n%%EOF\n" port) (ly:outputter-close outputter))) (define-public (output-preview-framework basename book scopes fields) diff --git a/scm/output-ps.scm b/scm/output-ps.scm index 03d6e29ebd..04de883e6a 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -176,10 +176,10 @@ (if (and (< 0 (interval-length x-ext)) (< 0 (interval-length y-ext))) (format "~a ~a ~a ~a (textedit://~a:~a:~a:~a) mark_URI\n" - (+ (car offset) (car x-ext)) - (+ (cdr offset) (car y-ext)) - (+ (car offset) (cdr x-ext)) - (+ (cdr offset) (cdr y-ext)) + (ly:number->string (+ (car offset) (car x-ext))) + (ly:number->string (+ (cdr offset) (car y-ext))) + (ly:number->string (+ (car offset) (cdr x-ext))) + (ly:number->string (+ (cdr offset) (cdr y-ext))) ;; TODO ;; full escaping. @@ -206,8 +206,15 @@ "") (define (placebox x y s) - (string-append - (ly:number->string x) " " (ly:number->string y) " { " s " } place-box\n")) + (format + "gsave ~a ~a translate +0 0 moveto +~a +grestore\n" + + (ly:number->string x) + (ly:number->string y) + s)) (define (polygon points blotdiameter filled?) (string-append -- 2.39.2