]> git.donarmstrong.com Git - lilypond.git/blob - scm/time-signature.scm
Add '-dcrop' option to ps and svg backends
[lilypond.git] / scm / time-signature.scm
1 ;;;; This file is part of LilyPond, the GNU music typesetter.
2 ;;;;
3 ;;;; Copyright (C) 2014--2015 Daniel Eble <dan@faithful.be>
4 ;;;;
5 ;;;; LilyPond is free software: you can redistribute it and/or modify
6 ;;;; it under the terms of the GNU General Public License as published by
7 ;;;; the Free Software Foundation, either version 3 of the License, or
8 ;;;; (at your option) any later version.
9 ;;;;
10 ;;;; LilyPond is distributed in the hope that it will be useful,
11 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 ;;;; GNU General Public License for more details.
14 ;;;;
15 ;;;; You should have received a copy of the GNU General Public License
16 ;;;; along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
17
18 (define-public (ly:time-signature::print grob)
19   "Print routine for time signatures."
20   (let* ((fraction (ly:grob-property grob 'fraction '(4 . 4)))
21          (style (ly:grob-property grob 'style 'default))
22          (proc (assoc-get style time-signature-style-markup-procedures))
23          (markup (if (procedure? proc)
24                      (proc fraction)
25                      (make-glyph-time-signature-markup style fraction))))
26     (grob-interpret-markup grob markup)))
27
28 (define-public (add-simple-time-signature-style style proc)
29   "Specify the procedure @{proc} returning markup for a time signature
30 style @var{style}.  The procedure is called with one argument, the
31 pair @code{(@var{numerator} . @var{denominator})}."
32   (set! time-signature-style-markup-procedures
33         (acons style proc time-signature-style-markup-procedures)))
34
35 (define-session time-signature-style-markup-procedures `())