;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
(define-module (scm output-svg))
-(define this-module (current-module))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; globals
(define lily-unit-length 1.7573)
-(define (dispatch expr)
- (let ((keyword (car expr)))
- (cond ((eq? keyword 'some-func) "")
- (else (if (module-defined? this-module keyword)
- (apply (eval keyword this-module) (cdr expr))
- (begin (ly:warning (_ "undefined: ~S") keyword)
- ""))))))
-
;; Helper functions
(define-public (attributes attributes-alist)
(apply string-append
;;;
(define (char font i)
- (dispatch
- `(fontify ,font ,(entity 'tspan (char->entity (integer->char i))))))
+ (fontify font (entity 'tspan (char->entity (integer->char i)))))
(define (circle radius thick is-filled)
(entity
"")
(define (named-glyph font name)
- (dispatch `(fontify ,font ,name)))
+ (fontify font name))
(define (no-origin)
"")
x y))
(define (text font string)
- (dispatch `(fontify ,font ,(entity 'tspan (string->entities string)))))
+ (fontify font (entity 'tspan (string->entities string))))
(define (url-link url x y)
(string-append
(let ((escaped-string (string-regexp-substitute
"<" "<"
(string-regexp-substitute "&" "&" string))))
- (dispatch `(fontify ,pango-font-description
- ,(entity 'tspan escaped-string)))))
+ (fontify pango-font-description
+ (entity 'tspan escaped-string))))