* ps/lilyponddefs.ps: Use only very small top-marging.
(init-paper): Also pop page size string.
(start-page, stop-page): New function.
* scm/output-ps.scm (header-end): Remove stray exec commands.
\score {
\context Staff \notes \relative c' {
c2-\sizeTest c2-\spaceTest
- \break c2-\latinTest c2
}
}
\score {
\context Staff \notes \relative c' {
\repeat unfold 10 { a b c d \break }
+ c1
}
}
papers_[0]->self_scm (),
scm_variable_ref (s)));
- /* match systems, which are also aligned to center */
- //(ly:stencil-align-to! header-stencil Y CENTER)
- title->align_to (Y_AXIS, CENTER);
+ title->align_to (Y_AXIS, UP);
return title;
}
if (page->height_ + h <= text_height || page->height_ == 0)
{
if (j == 0 && title)
- page->lines_
- = ly_snoc (scm_cons (ly_offset2scm (Offset (0, 0)),
- scm_list_1
- (scm_cons
- (ly_offset2scm (Offset (0, 0)),
- title->smobbed_copy ()))),
+ {
+ Offset dim = Offset (title->extent (X_AXIS).length (),
+ title->extent (Y_AXIS).length ());
+ page->lines_
+ = ly_snoc (scm_cons (ly_offset2scm (dim),
+ scm_list_1
+ (scm_cons
+ (ly_offset2scm (Offset (0, 0)),
+ title->smobbed_copy ()))),
page->lines_);
+ }
page->lines_ = ly_snoc (line, page->lines_);
page->height_ += h;
h = 0;
IMPLEMENT_TYPE_P (Paper_book, "ly:paper_book?")
SCM
-Paper_book::mark_smob (SCM)
+Paper_book::mark_smob (SCM smob)
{
+ Paper_book *b = (Paper_book*) SCM_CELL_WORD_1 (smob);
+
+#if 0 //TODO
+ scm_gc_mark (b->scores_);
+ scm_gc_mark (b->global_headers_);
+ scm_gc_mark (b->headers_);
+ scm_gc_mark (b->papers_);
+#endif
+
return SCM_EOL;
}
if (systems != SCM_UNDEFINED)
{
Paper_score *ps = dynamic_cast<Paper_score*> (output);
- // Hmmr
+#if 1
paper_book->protect_ = scm_cons (systems, paper_book->protect_);
paper_book->protect_ = scm_cons (global_input_file->header_,
paper_book->protect_);
paper_book->protect_ = scm_cons (header, paper_book->protect_);
paper_book->protect_ = scm_cons (ps->paper_->smobbed_copy (),
paper_book->protect_);
-
+#endif
paper_book->papers_.push (ps->paper_);
paper_book->scores_.push (systems);
paper_book->global_headers_.push (global_input_file->header_);
-%!PS-Adobe-1.0: lilyponddefs.ps
+%!PS-Adobe-2.0: lilyponddefs.ps
%
% Functions for direct PostScript output
-% hmm
% /setgray { 1 add } bind def
% To let gs load fonts from builddir, do:
/lily-output-units 2.83464 def %% milimeter
% /lily-output-units 0.996264 def %% true points.
-/output-scale
-lilypondpaperoutputscale lily-output-units mul
-def
+/output-scale lilypondpaperoutputscale lily-output-units mul def
-/set-ps-scale-to-lily-scale
-{
-output-scale output-scale scale
-} bind def
+/set-ps-scale-to-lily-scale { output-scale output-scale scale } bind def
/paper-size { lilypondpaperpapersize } bind def
%% FIXME: base-line-skip is too big, is this RIGHT?
%% /base-line-skip lilypondpaperlineheight def
-/base-line-skip lilypondpaperlineheight lilypondpaperoutputscale div def
+%%/base-line-skip lilypondpaperlineheight lilypondpaperoutputscale div def
+/base-line-skip 0 def
/init-paper {
gsave
.1 setlinewidth
clippath pathbbox newpath
/vsize exch def
- /hsize exch def pop pop pop
-
- %FIXME:
- %vsize text-height sub 2 div /top-margin exch def
- % 144 2 div /top-margin exch def
- /top-margin 100 def
+ /hsize exch def pop pop pop pop
+ % FIXME
+ /top-margin 2 def
hsize line-width sub 2 div /left-margin exch def
grestore
} bind def
end
} bind def
+/start-page
+{
+ /line-x left-margin output-scale div def
+ /line-y vsize top-margin sub def
+} bind def
+
+/stop-page
+{
+ showpage
+} bind def
+
+% dump using baselineskip, fold to new page
/start-system % height
{
dup base-line-skip gt {
% initialise paper dimensions
staff-height init-paper
-/line-x left-margin output-scale div def
-/line-y vsize top-margin sub def
-
-% FIXME: testing \markup titles
-% make-lilypond-title
-
-% see if we're there...
-% 10 setlinewidth 0 0 moveto 400 800 lineto stroke
-
% end lilyponddefs.ps
(define (header-end)
(string-append
- ;; URG: now we can't use scm output without Lily
(ly:gulp-file "lilyponddefs.ps")
- "{exch pop //systemdict /run get exec}\n\n"
- (ly:gulp-file "music-drawing-routines.ps")
- "{ exch pop //systemdict /run get exec }\n\n"
- ;; ps-testing wreaks havoc when used with lilypond-book.
- ;; -- is this still true with new modules system?
-;; (if (defined? 'ps-testing) "\n /testing true def" "")
- ; "\n /testing true def"
- ))
+ (ly:gulp-file "music-drawing-routines.ps")))
(define (horizontal-line x1 x2 th)
(draw-line th x1 0 x2 0))
(string-append
"\n" (ly:number->string height)
" start-system\n"
+ ;;(draw-line 2 0 (* OUTPUT-SCALE height) 100 0)
+ (draw-line 2 0 0 50 (- 0 (* OUTPUT-SCALE height)))
"{\n"
"set-ps-scale-to-lily-scale\n"))
" draw_zigzag_line "))
(define (start-page)
- "\n%start page\n")
+ "\nstart-page\n")
(define (stop-page last?)
- "\n%showpage\n")
+ "\nstop-page\n")