* lily/paper-book.cc: junk stencil2line.
* lily/paper-line.cc (Paper_line): construct from Stencil
directly. No futzing with the dimensions.
* lily/include/paper-line.hh (class Paper_line):
* lily/stencil.cc (interpret_stencil_expression): combine-stencil
takes arbitrary number of arguments.
* input/test/markup-score.ly (tuning): simplify example.
-
+2004-06-01 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/lexer.ll: lex \score separately.
+
+ * lily/paper-book.cc: junk stencil2line.
+
+ * lily/paper-line.cc (Paper_line): construct from Stencil
+ directly. No futzing with the dimensions.
+
+ * lily/include/paper-line.hh (class Paper_line):
+
+ * lily/stencil.cc (interpret_stencil_expression): combine-stencil
+ takes arbitrary number of arguments.
+
+ * input/test/markup-score.ly (tuning): simplify example.
+
+2004-05-31 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/score.cc (LY_DEFINE): ly:score-embedded-format, new function.
+
+ * scm/define-markup-commands.scm (score): define score-markup
+
+ * lily/parser.yy (markup): use score-markup.
+
+ * lily/score.cc: add ly:score?
+
2004-05-30 Carl Sorensen <carl_sorensen@byu.edu>
* scm/fret-diagrams.scm: add fret-diagram-verbose markup; modified
-\header {
-
- %% When vertical dimension and stacking works properly, this
- %% should be broken up into a few regression tests.
- %% Too bad that '{' is overloaded, we need something (the bit arbitrary
- %% `\score' now, to introduce to-markup-stencil-rendered music.
-
+\header {
texidoc = "Use \\score block as markup command."
-
}
\version "2.3.2"
-%%;; Hmm - why is stencil so tall?
-#(define (page-stack-lines page)
- (stack-stencils Y 1 0
- (map ly:paper-line-stencil (ly:page-paper-lines page))))
-
-#(define (page-stack-lines page)
- (let* ((urg-stencil (ly:stencil-align-to! (stack-stencils Y DOWN 0
- (map ly:paper-line-stencil (ly:page-paper-lines page)))
- Y DOWN))
- (expr (ly:stencil-expr urg-stencil))
- (xext (ly:stencil-extent urg-stencil X))
- (yext (ly:stencil-extent urg-stencil Y)))
- (ly:stencil-align-to!
- ;; urgr
- (ly:make-stencil expr xext (cons (* -0.25 (cdr yext)) 0))
- Y CENTER)))
-
-inBed = \paper {
- %% can't do this, this paper('s fonts) must be notified to the
- %% main/current book, and e output in the header.
- %% #(paper-set-staff-size (* 11.0 pt))
-
- raggedright = ##t
- linewidth = 0\mm
- indent = 0 \mm
-
- #(define page-to-stencil page-stack-lines)
- %%#(define (page-to-stencil page)
- %% (box-stencil (page-stack-lines page) 0.1 0.5))
-
- \context {
- \Staff
- minimumVerticalExtent = ##f
- }
-}
-
-noCruft = \paper {
- \context {
- \Staff
- %% Hmm, no effect ?
- %% \override StaffSymbol #'print-function = ##f
- %% Clef = \turnOff
- %% StaffSymbol = \turnOff
- %% TimeSignature = \turnOff
- \override Clef #'print-function = ##f
- \override StaffSymbol #'line-count = #0
- \override TimeSignature #'print-function = ##f
- }
-}
-
-noCruftInBed = \paper {
- \inBed
-
- %%\noCruft
- %%URGHSr
- \context {
- \Staff
- %% Hmm, no effect ?
- %% \override StaffSymbol #'print-function = ##f
- %% Clef = \turnOff
- %% StaffSymbol = \turnOff
- %% TimeSignature = \turnOff
- \override Clef #'print-function = ##f
- \override StaffSymbol #'line-count = #0
- \override TimeSignature #'print-function = ##f
- }
-}
-
tuning = \markup {
- \score { { \clef bass <c, g, d g>1 } \paper{ \inBed }}
+ \score {
+ \new Staff \with {
+ \remove Time_signature_engraver
+ } {
+ \clef bass <c, g, d g>1
+ }
+ \paper { raggedright = ##t }
+ }
}
-#(define-public (my-footer paper page-number)
- (let ((props (page-properties paper)))
- (interpret-markup paper props
- (markup #:fill-line ( #:line ( "Tuning: " tuning) "")))))
-
-tempoChange = \markup {
- %% wtf, no horizontal shift?
- "" %%\kern #-10
- \translate #'(-15 . 0)
- \score { \times 2/3 { c'8 c' c' } \paper { \noCruftInBed }}
- " ="
- \score { { c'8[ c'] } \paper { \noCruftInBed } }
-}
\header {
title = "Solo Cello Suites"
subsubtitle = \markup { \fill-line < { "Originalstimmung: " \tuning } > }
}
-\paper {
- #(define make-footer my-footer)
-}
-
\relative {
\time 4/8
\times 2/3 { c'8 d e } \times 2/3 {c d e}
\time 4/8
- g8^\tempoChange a8 g8 a \break
+
+ % todo: tempo change example.
+
+ g8 a8 g8 a \break
}
{
start_main_input ();
main_input_b_ = true;
+/*
+This is broken - we should switch to \notes when the pitchnames are loaded.
+Then we get spanish etc. correct. --hwn.
+
+*/
SCM nn = lookup_identifier ("pitchnames");
push_note_state (alist_to_hashq (nn));
}
"Stencil as markup"
stil)
+
+(def-markup-command (score paper props score) (ly:score?)
+ (let*
+ ((systems (ly:score-embedded-format score paper))
+ (1st (vector-ref systems 0))
+ (stencil (ly:paper-line-stencil 1st)) )
+
+ (ly:stencil-align-to! stencil Y CENTER)
+ (display (ly:stencil-extent stencil X))
+ (display (ly:stencil-extent stencil Y))
+; (set! stencil (ly:stencil-translate-axis stencil -20 X))
+; (set! stencil (ly:stencil-translate-axis stencil 20 Y))
+ stencil))
+
(def-markup-command (simple paper props str) (string?)
"A simple text string; @code{\\markup @{ foo @}} is equivalent with
@code{\\markup @{ \\simple #\"foo\" @}}."
(line-stencils (if (= word-count 1)
(map (lambda (x) (interpret-markup paper props x))
(list (make-simple-markup "")
- (car markups)
+ (make-stencil-markup (car stencils))
(make-simple-markup "")))
stencils)))
(stack-stencil-line fill-space line-stencils)))
(def-markup-command (combine paper props m1 m2) (markup? markup?)
"Print two markups on top of each other."
- (ly:stencil-add
- (interpret-markup paper props m1)
- (interpret-markup paper props m2)))
+ (let*
+ ((s1 (interpret-markup paper props m1))
+ (s2 (interpret-markup paper props m2)))
+
+ (ly:stencil-add s1 s2)))
(def-markup-command (finger paper props arg) (markup?)
"Set the argument as small numbers."
-
-
(define-module (scm framework-tex))
(use-modules (ice-9 regex)
"}\\vss\n}\n\\vfill\\lilypondpagebreak\n")))
-(define (dump-line putter line last?)
- (ly:outputter-dump-string
- putter
- (string-append "\\leavevmode\n\\lybox{0}{0}{0}{"
- (ly:number->string (ly:paper-line-extent line Y))
- "}{"))
-
- (ly:outputter-dump-stencil putter (ly:paper-line-stencil line))
- (ly:outputter-dump-string
- putter
- (if last?
- "}%\n"
- "}\\interscoreline\n"
- )) )
(define-public (output-framework-tex outputter book scopes fields basename)
(let*
(ly:outputter-dump-string outputter "\\lilypondend\n")
))
+(define (dump-line putter line last?)
+ (ly:outputter-dump-string
+ putter
+ (string-append "\\leavevmode\n\\lybox{0}{0}{0}{"
+ (ly:number->string (ly:paper-line-extent line Y))
+ "}{"))
+
+ (ly:outputter-dump-stencil putter (ly:paper-line-stencil line))
+ (ly:outputter-dump-string
+ putter
+ (if last?
+ "}%\n"
+ "}\\interscoreline\n"
+ )) )
+
(define-public (output-classic-framework-tex outputter book scopes fields basename)
(let*
((bookpaper (ly:paper-book-book-paper book))
(define-public (stack-stencil-line space stencils)
+ "DOCME"
(if (and (pair? stencils)
(ly:stencil? (car stencils)))
(make-column-markup
(list
(markup #:fill-line
- (#:large #:bigger #:bigger #:bold (get 'subtitle))
- #:fill-line (#:bigger #:bigger #:bold (get 'subsubtitle)))
+ (#:large #:bigger #:bigger #:bold (get 'subtitle)))
+ (markup #:fill-line (#:bigger #:bigger #:bold (get 'subsubtitle)))
(markup #:override '(baseline-skip . 5)
#:column ("")))
;;;; (c) 2003--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
(define-public (stack-stencils axis dir padding stils)
- "Stack stencils STILS in direction AXIS,DIR, using PADDING."
+ "Stack stencils STILS in direction AXIS, DIR, using PADDING."
(if (null? stils)
'()
(if (pair? stils)