and not text.startswith ('(define (')):
return 0
+ if text.startswith ('(use-modules '):
+ return 0
+
if (text.startswith ('(define-public ')
and not text.startswith ('(define-public (')):
return 0
(cons 'font-size (+ fs increment )))))
(interpret-markup layout (cons entries props) arg)))
-
-
-;; FIXME -> should convert to font-size.
(define-builtin-markup-command (magnify layout props sz arg) (number? markup?)
"Set the font magnification for the its argument. In the following
example, the middle A will be 10% larger:
Use @code{\\fontsize} otherwise."
(interpret-markup
layout
- (prepend-alist-chain 'font-magnification sz props)
+ (prepend-alist-chain 'font-size (magnification->font-size sz) props)
arg))
(define-builtin-markup-command (bold layout props arg) (markup?)
"Century Schoolbook L"
"Sans" "Mono" factor))
-(define-public (magstep x)
- (exp (* (/ x 6) (log 2))))
+(define-public (magstep s)
+ (exp (* (/ s 6) (log 2))))
+
+(define-public (magnification->font-size m)
+ (* 6 (/ (log m) (log 2))))
(string<? (symbol->string (car x))
(symbol->string (car y))))
-(define-public (chain-assoc x alist-list)
- (if (null? alist-list)
- #f
- (let* ((handle (assoc x (car alist-list))))
- (if (pair? handle)
- handle
- (chain-assoc x (cdr alist-list))))))
-
(define-public (chain-assoc-get x alist-list . default)
"Return ALIST entry for X. Return DEFAULT (optional, else #f) if not
found."
"Replace MUS by RestEvent of the same duration if it is a
SkipEvent. Useful for extracting parts from crowded scores"
- (if (equal? (ly:music-property mus 'name) 'SkipEvent)
+ (if (memq (ly:music-property mus 'name) '(SkipEvent SkipMusic))
(make-music 'RestEvent 'duration (ly:music-property mus 'duration))
mus))
(ly:grob-property grob 'text))
))
-(define-public (music-cause grob)
- (let*
- ((event (event-cause grob)))
-
- (if (ly:stream-event? event)
- (ly:event-property event 'music-cause)
- #f)))
-
(define-public (event-cause grob)
(let*
((cause (ly:grob-property grob 'cause)))
(cond
((ly:stream-event? cause) cause)
-; ((ly:grob? cause) (music-cause cause))
(else
#f))))