;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
-;;;; (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 1998--2007 Jan Nieuwenhuizen <janneke@gnu.org>
;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
(lambda (grob) (circle-stencil (callback grob) thickness padding)))
(define-public (print-circled-text-callback grob)
- (let* ((text (ly:grob-property grob 'text))
-
- (layout (ly:grob-layout grob))
- (defs (ly:output-def-lookup layout 'text-font-defaults))
- (props (ly:grob-alist-chain grob defs))
- (circle (ly:text-interface::interpret-markup
- layout props (make-circle-markup text))))
- circle))
-
-(define-public (music-cause grob)
- (let*
- ((event (event-cause grob)))
-
- (if (ly:stream-event? event)
- (ly:event-property event 'music-cause)
- #f)))
+ (grob-interpret-markup grob (make-circle-markup
+ (ly:grob-property grob 'text))
+ ))
(define-public (event-cause grob)
(let*
;; statement. -- jr
((xcircle) "2xcircle")
((harmonic) "0harmonic")
+ ((harmonic-black) "2harmonic")
+ ((harmonic-mixed) (if (<= log 1) "0harmonic"
+ "2harmonic"))
((baroque)
;; Oops, I actually would not call this "baroque", but, for
;; backwards compatibility to 1.4, this is supposed to take
;;
;; How should a bar line behave at a break?
-;;
-;; Why prepend `default-' to every scm identifier?
+(define bar-glyph-alist
+ '((":|:" . (":|" . "|:"))
+ ("||:" . ("||" . "|:"))
+ ("dashed" . ("dashed" . '()))
+ ("|" . ("|" . ()))
+ ("||:" . ("||" . "|:"))
+ ("|s" . (() . "|"))
+ ("|:" . ("|" . "|:"))
+ ("|." . ("|." . ()))
+
+ ;; hmm... should we end with a bar line here?
+ (".|" . ("|" . ".|"))
+ (":|" . (":|" . ()))
+ ("||" . ("||" . ()))
+ (".|." . (".|." . ()))
+ ("" . ("" . ""))
+ (":" . (":" . ""))
+ ("." . ("." . ()))
+ ("empty" . (() . ()))
+ ("brace" . (() . "brace"))
+ ("bracket" . (() . "bracket"))
+ ))
+
(define-public (bar-line::calc-glyph-name grob)
(let* (
(glyph (ly:grob-property grob 'glyph))
(dir (ly:item-break-dir grob))
- (result (assoc glyph
- '((":|:" . (":|" . "|:"))
- ("||:" . ("||" . "|:"))
- ("dashed" . ("dashed" . '()))
- ("|" . ("|" . ()))
- ("||:" . ("||" . "|:"))
- ("|s" . (() . "|"))
- ("|:" . ("|" . "|:"))
- ("|." . ("|." . ()))
-
- ;; hmm... should we end with a bar line here?
- (".|" . ("|" . ".|"))
- (":|" . (":|" . ()))
- ("||" . ("||" . ()))
- (".|." . (".|." . ()))
- ("" . ("" . ""))
- (":" . (":" . ""))
- ("." . ("." . ()))
- ("empty" . (() . ()))
- ("brace" . (() . "brace"))
- ("bracket" . (() . "bracket")) )))
+ (result (assoc glyph bar-glyph-alist))
(glyph-name (if (= dir CENTER)
glyph
(if (and result (string? (index-cell (cdr result) dir)))
(index-cell (cdr result) dir)
#f)))
)
-
- (if (not glyph-name)
- (ly:grob-suicide! grob))
-
glyph-name))
+(define-public (bar-line::calc-break-visibility grob)
+ (let* ((glyph (ly:grob-property grob 'glyph))
+ (result (assoc glyph bar-glyph-alist)))
+ (if result
+ (vector (string? (cadr result)) #t (string? (cddr result)))
+ #(#f #f #f))))
+
(define-public (shift-right-at-line-begin g)
"Shift an item to the right, but only at the start of the line."
;; Color
(define-public color? list?)
+(define-public (rgb-color r g b) (list r g b))
; predefined colors
(define-public black '(0.0 0.0 0.0))
(-3/4 . "accidentals.mirroredflat.flat")
))
+;; FIXME: standard vs default, alteration-FOO vs FOO-alteration
+(define-public alteration-default-glyph-name-alist standard-alteration-glyph-name-alist)
+
(define-public makam-alteration-glyph-name-alist
'((1 . "accidentals.doublesharp")
(8/9 . "accidentals.sharp.slashslashslash.stemstem")
))
(define-public alteration-hufnagel-glyph-name-alist
- '((1/2 . "accidentals.hufnagel-1")
+ '((-1/2 . "accidentals.hufnagelM1")
(0 . "accidentals.vaticana0")
- (-1/2 . "accidentals.mensural1")))
+ (1/2 . "accidentals.mensural1")))
(define-public alteration-medicaea-glyph-name-alist
- '((1/2 . "accidentals.medicaea-1")
+ '((-1/2 . "accidentals.medicaeaM1")
(0 . "accidentals.vaticana0")
- (-1/2 . "accidentals.mensural1")))
+ (1/2 . "accidentals.mensural1")))
(define-public alteration-vaticana-glyph-name-alist
- '((1/2 . "accidentals.vaticana-1")
+ '((-1/2 . "accidentals.vaticanaM1")
(0 . "accidentals.vaticana0")
- (-1/2 . "accidentals.mensural1")))
+ (1/2 . "accidentals.mensural1")))
(define-public alteration-mensural-glyph-name-alist
- '((1/2 . "accidentals.mensural-1")
+ '((-1/2 . "accidentals.mensuralM1")
(0 . "accidentals.vaticana0")
- (-1/2 . "accidentals.mensural1")))
+ (1/2 . "accidentals.mensural1")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(list lp rp)))
-(define (grob-text grob text)
+(define-public (grob-interpret-markup grob text)
(let*
((layout (ly:grob-layout grob))
(defs (ly:output-def-lookup layout 'text-font-defaults))
(define-public (parentheses-item::calc-angled-bracket-stencils grob)
(let* (
(font (ly:grob-default-font grob))
- (lp (ly:stencil-aligned-to (ly:stencil-aligned-to (grob-text grob (ly:wide-char->utf-8 #x2329))
+ (lp (ly:stencil-aligned-to (ly:stencil-aligned-to (grob-interpret-markup grob (ly:wide-char->utf-8 #x2329))
Y CENTER) X RIGHT))
- (rp (ly:stencil-aligned-to (ly:stencil-aligned-to (grob-text grob (ly:wide-char->utf-8 #x232A))
+ (rp (ly:stencil-aligned-to (ly:stencil-aligned-to (grob-interpret-markup grob (ly:wide-char->utf-8 #x232A))
Y CENTER) X LEFT))
)
"Allow interpretation of tildes as lyric tieing marks."
(let*
- ((text (ly:grob-property grob 'text))
- (layout (ly:grob-layout grob))
- (defs (ly:output-def-lookup layout 'text-font-defaults))
- (props (ly:grob-alist-chain grob defs)))
+ ((text (ly:grob-property grob 'text)))
- (ly:text-interface::interpret-markup layout
- props
- (if (string? text)
- (make-tied-lyric-markup text)
- text))))
+ (grob-interpret-markup grob
+ (if (string? text)
+ (make-tied-lyric-markup text)
+ text))))
(define-public ((grob::calc-property-by-copy prop) grob)
(ly:event-property (event-cause grob) prop))
(define-public (fret-board::calc-stencil grob)
(let* ((string-frets (ly:grob-property grob 'string-fret-finger-combinations))
- (string-count (ly:grob-property grob 'string-count))
- (layout (ly:grob-layout grob))
- (defs (ly:output-def-lookup layout 'text-font-defaults))
- (props (ly:grob-alist-chain grob defs)))
+ (string-count (ly:grob-property grob 'string-count)))
+
+ (grob-interpret-markup grob
+ (make-fret-diagram-verbose-markup
+ (string-frets->description string-frets string-count)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; scripts
- (make-fret-diagram layout props
- (string-frets->description string-frets 6))))
+(define-public (script-interface::calc-x-offset grob)
+ (ly:grob-property grob 'positioning-done)
+ (ly:self-alignment-interface::centered-on-x-parent grob))