(define fancy-format format)
(define format ergonomic-simple-format)
(define lily-unit-length 1.7573)
(define fancy-format format)
(define format ergonomic-simple-format)
(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)
- ""))))))
-
(string-join (helper lst) " "))
(define (svg-bezier lst close)
(let* ((c0 (car (list-tail lst 3)))
(string-join (helper lst) " "))
(define (svg-bezier lst close)
(let* ((c0 (car (list-tail lst 3)))
- (if (not close) "M" "L")
- (offset->point c0)
- "C" (string-join (map offset->point c123) " ")
- (if (not close) "" "z"))))
+ (if (not close) "M" "L")
+ (offset->point c0)
+ "C" (string-join (map offset->point c123) " ")
+ (if (not close) "" "z"))))
(define (set-attribute attr val)
(set! alist (assoc-set! alist attr val)))
(let* ((match-1 (regexp-exec pango-description-regexp-comma str))
(define (set-attribute attr val)
(set! alist (assoc-set! alist attr val)))
(let* ((match-1 (regexp-exec pango-description-regexp-comma str))
- (begin
- (set-attribute 'font-family (match:prefix match))
- (if (string? (match:substring match 1))
- (set-attribute 'font-weight "bold"))
- (if (string? (match:substring match 2))
- (set-attribute 'font-style "italic"))
- (if (string? (match:substring match 3))
- (set-attribute 'font-variant "small-caps"))
- (set-attribute 'font-size
- (/ (string->number (match:substring match 4))
- lily-unit-length))
- (set-attribute 'text-anchor "start")
- (set-attribute 'fill "currentColor"))
- (ly:warning (_ "cannot decypher Pango description: ~a") str))
+ (begin
+ (set-attribute 'font-family (match:prefix match))
+ (if (string? (match:substring match 1))
+ (set-attribute 'font-weight "bold"))
+ (if (string? (match:substring match 2))
+ (set-attribute 'font-style "italic"))
+ (if (string? (match:substring match 3))
+ (set-attribute 'font-variant "small-caps"))
+ (set-attribute 'font-size
+ (/ (string->number (match:substring match 4))
+ lily-unit-length))
+ (set-attribute 'text-anchor "start")
+ (set-attribute 'fill "currentColor"))
+ (ly:warning (_ "cannot decypher Pango description: ~a") str))
- (dy (cadr rest))
- (total-x (+ dx next-horiz-adv)))
- (if (or (not (zero? total-x))
- (not (zero? dy)))
- (let ((x (ly:format "~4f" total-x))
- (y (ly:format "~4f" dy)))
- (set-attribute 'transform
- (string-append
- "translate(" x ", " y ") "
- "scale(" scale ", -" scale ")")))
- (set-attribute 'transform
- (string-append
- "scale(" scale ", -" scale ")"))))
+ (dy (cadr rest))
+ (total-x (+ dx next-horiz-adv)))
+ (if (or (not (zero? total-x))
+ (not (zero? dy)))
+ (let ((x (ly:format "~4f" total-x))
+ (y (ly:format "~4f" dy)))
+ (set-attribute 'transform
+ (string-append
+ "translate(" x ", " y ") "
+ "scale(" scale ", -" scale ")")))
+ (set-attribute 'transform
+ (string-append
+ "scale(" scale ", -" scale ")"))))
- "(([[:space:]]+[-a-z]+=\"[^\"]*\")+)?"
- "[[:space:]]+glyph-name=\"("
- name
- ")\""
- "(([[:space:]]+[-a-z]+=\"[^\"]*\")+)?"
- "([[:space:]]+)?"
- "/>")))
+ "(([[:space:]]+[-a-z]+=\"[^\"]*\")+)?"
+ "[[:space:]]+glyph-name=\"("
+ name
+ ")\""
+ "(([[:space:]]+[-a-z]+=\"[^\"]*\")+)?"
+ "([[:space:]]+)?"
+ "/>")))
- (regexp (regexp-exec (glyph-element-regexp new-name) all-glyphs))
- (glyph (match:substring regexp))
- (unicode-attr (regexp-exec glyph-unicode-value-regexp glyph))
- (unicode-attr-value (match:substring unicode-attr 1))
- (unicode-attr? (regexp-match? unicode-attr))
- (d-attr (regexp-exec glyph-path-regexp glyph))
- (d-attr-value "")
- (d-attr? (regexp-match? d-attr))
- ;; TODO: not urgent, but do not hardcode this value
- (units-per-em 1000)
- (font-scale (ly:format "~4f" (/ size units-per-em)))
- (path ""))
+ (regexp (regexp-exec (glyph-element-regexp new-name) all-glyphs))
+ (glyph (match:substring regexp))
+ (unicode-attr (regexp-exec glyph-unicode-value-regexp glyph))
+ (unicode-attr-value (match:substring unicode-attr 1))
+ (unicode-attr? (regexp-match? unicode-attr))
+ (d-attr (regexp-exec glyph-path-regexp glyph))
+ (d-attr-value "")
+ (d-attr? (regexp-match? d-attr))
+ ;; TODO: not urgent, but do not hardcode this value
+ (units-per-em 1000)
+ (font-scale (ly:format "~4f" (/ size units-per-em)))
+ (path ""))
- ;; Glyph-strings with path data
- (and d-attr? (not (null? rest)))
- (begin
- (set! path (apply dump-path d-attr-value
- font-scale
- (list (cadr rest) (caddr rest))))
- (set! next-horiz-adv (+ next-horiz-adv
- (car rest)))
- path))
- ;; Glyph-strings without path data ("space")
- ((and (not d-attr?) (not (null? rest)))
- (begin
- (set! next-horiz-adv (+ next-horiz-adv
- (car rest)))
- ""))
- ;; Font smobs with path data
- ((and d-attr? (null? rest))
- (set! path (dump-path d-attr-value font-scale))
- path)
- ;; Font smobs without path data ("space")
- (else
- ""))))
+ ;; Glyph-strings with path data
+ (and d-attr? (not (null? rest)))
+ (begin
+ (set! path (apply dump-path d-attr-value
+ font-scale
+ (list (caddr rest) (cadddr rest))))
+ (set! next-horiz-adv (+ next-horiz-adv
+ (car rest)))
+ path))
+ ;; Glyph-strings without path data ("space")
+ ((and (not d-attr?) (not (null? rest)))
+ (begin
+ (set! next-horiz-adv (+ next-horiz-adv
+ (car rest)))
+ ""))
+ ;; Font smobs with path data
+ ((and d-attr? (null? rest))
+ (set! path (dump-path d-attr-value font-scale))
+ path)
+ ;; Font smobs without path data ("space")
+ (else
+ ""))))
(apply extract-glyph all-glyphs glyph-name size offsets)))
(define (svg-defs svg-font)
(let ((start (string-contains svg-font "<defs>"))
(apply extract-glyph all-glyphs glyph-name size offsets)))
(define (svg-defs svg-font)
(let ((start (string-contains svg-font "<defs>"))
(substring svg-font (+ start 7) (- end 1))))
(define (cache-font svg-font size glyph)
(let ((all-glyphs (svg-defs (cached-file-contents svg-font))))
(if (list? glyph)
(substring svg-font (+ start 7) (- end 1))))
(define (cache-font svg-font size glyph)
(let ((all-glyphs (svg-defs (cached-file-contents svg-font))))
(if (list? glyph)
- (scaled-size (modified-font-metric-font-scaling font))
- (font-file (ly:find-file (string-append name-style ".woff")))
- (charcode (ly:font-glyph-name-to-charcode font expr))
- (char-lookup (format #f "&#~S;" charcode))
- (glyph-by-name (eoc 'altglyph `(glyphname . ,expr)))
- (apparently-broken
- (comment "FIXME: how to select glyph by name, altglyph is broken?"))
- (text (string-regexp-substitute "\n" ""
- (string-append glyph-by-name apparently-broken char-lookup))))
- (define alist '())
- (define (set-attribute attr val)
- (set! alist (assoc-set! alist attr val)))
- (set-attribute 'font-family name-style)
- (set-attribute 'font-size scaled-size)
- (apply entity 'text text (reverse! alist))))
-
+ (scaled-size (modified-font-metric-font-scaling font))
+ (font-file (ly:find-file (string-append name-style ".woff")))
+ (charcode (ly:font-glyph-name-to-charcode font expr))
+ (char-lookup (format #f "&#~S;" charcode))
+ (glyph-by-name (eoc 'altglyph `(glyphname . ,expr)))
+ (apparently-broken
+ (comment "FIXME: how to select glyph by name, altglyph is broken?"))
+ (text (string-regexp-substitute "\n" ""
+ (string-append glyph-by-name apparently-broken char-lookup))))
+ (define alist '())
+ (define (set-attribute attr val)
+ (set! alist (assoc-set! alist attr val)))
+ (set-attribute 'font-family name-style)
+ (set-attribute 'font-size scaled-size)
+ (apply entity 'text text (reverse! alist))))
+
(define font-smob-to-text
(if (not (ly:get-option 'svg-woff))
font-smob-to-path woff-font-smob-to-text))
(define font-smob-to-text
(if (not (ly:get-option 'svg-woff))
font-smob-to-path woff-font-smob-to-text))
-(define (bezier-sandwich lst thick)
- (let* ((first (list-tail lst 4))
- (second (list-head lst 4)))
- (entity 'path ""
- '(stroke-linejoin . "round")
- '(stroke-linecap . "round")
- '(stroke . "currentColor")
- '(fill . "currentColor")
- `(stroke-width . ,thick)
- `(d . ,(string-append (svg-bezier first #f)
- (svg-bezier second #t))))))
-
- 'circle ""
- '(stroke-linejoin . "round")
- '(stroke-linecap . "round")
- `(fill . ,(if is-filled "currentColor" "none"))
- `(stroke . "currentColor")
- `(stroke-width . ,thick)
- `(r . ,radius)))
+ 'circle ""
+ '(stroke-linejoin . "round")
+ '(stroke-linecap . "round")
+ `(fill . ,(if is-filled "currentColor" "none"))
+ `(stroke . "currentColor")
+ `(stroke-width . ,thick)
+ `(r . ,radius)))
- (append
- `((stroke-linejoin . "round")
- (stroke-linecap . "round")
- (stroke-width . ,thick)
- (stroke . "currentColor")
- (x1 . ,x1)
- (y1 . ,(- y1))
- (x2 . ,x2)
- (y2 . ,(- y2)))
- alist)))
+ (append
+ `((stroke-linejoin . "round")
+ (stroke-linecap . "round")
+ (stroke-width . ,thick)
+ (stroke . "currentColor")
+ (x1 . ,x1)
+ (y1 . ,(- y1))
+ (x2 . ,x2)
+ (y2 . ,(- y2)))
+ alist)))
- 'ellipse ""
- '(stroke-linejoin . "round")
- '(stroke-linecap . "round")
- `(fill . ,(if is-filled "currentColor" "none"))
- `(stroke . "currentColor")
- `(stroke-width . ,thick)
- `(rx . ,x-radius)
- `(ry . ,y-radius)))
+ 'ellipse ""
+ '(stroke-linejoin . "round")
+ '(stroke-linecap . "round")
+ `(fill . ,(if is-filled "currentColor" "none"))
+ `(stroke . "currentColor")
+ `(stroke-width . ,thick)
+ `(rx . ,x-radius)
+ `(ry . ,y-radius)))
- ((new-start-angle (* PI-OVER-180 (angle-0-360 start-angle)))
- (start-radius (make-ellipse-radius x-radius y-radius new-start-angle))
- (new-end-angle (* PI-OVER-180 (angle-0-360 end-angle)))
- (end-radius (make-ellipse-radius x-radius y-radius new-end-angle))
- (epsilon 1.5e-3)
- (x-end (- (* end-radius (cos new-end-angle))
- (* start-radius (cos new-start-angle))))
- (y-end (- (* end-radius (sin new-end-angle))
- (* start-radius (sin new-start-angle)))))
- (if (and (< (abs x-end) epsilon) (< (abs y-end) epsilon))
- (entity
- 'ellipse ""
- `(fill . ,(if fill "currentColor" "none"))
- `(stroke . "currentColor")
- `(stroke-width . ,thick)
- '(stroke-linejoin . "round")
- '(stroke-linecap . "round")
- '(cx . 0)
- '(cy . 0)
- `(rx . ,x-radius)
- `(ry . ,y-radius))
- (entity
- 'path ""
- `(fill . ,(if fill "currentColor" "none"))
- `(stroke . "currentColor")
- `(stroke-width . ,thick)
- '(stroke-linejoin . "round")
- '(stroke-linecap . "round")
- (cons
- 'd
- (string-append
- (ly:format
+ ((new-start-angle (* PI-OVER-180 (angle-0-360 start-angle)))
+ (start-radius (make-ellipse-radius x-radius y-radius new-start-angle))
+ (new-end-angle (* PI-OVER-180 (angle-0-360 end-angle)))
+ (end-radius (make-ellipse-radius x-radius y-radius new-end-angle))
+ (epsilon 1.5e-3)
+ (x-end (- (* end-radius (cos new-end-angle))
+ (* start-radius (cos new-start-angle))))
+ (y-end (- (* end-radius (sin new-end-angle))
+ (* start-radius (sin new-start-angle)))))
+ (if (and (< (abs x-end) epsilon) (< (abs y-end) epsilon))
+ (entity
+ 'ellipse ""
+ `(fill . ,(if fill "currentColor" "none"))
+ `(stroke . "currentColor")
+ `(stroke-width . ,thick)
+ '(stroke-linejoin . "round")
+ '(stroke-linecap . "round")
+ '(cx . 0)
+ '(cy . 0)
+ `(rx . ,x-radius)
+ `(ry . ,y-radius))
+ (entity
+ 'path ""
+ `(fill . ,(if fill "currentColor" "none"))
+ `(stroke . "currentColor")
+ `(stroke-width . ,thick)
+ '(stroke-linejoin . "round")
+ '(stroke-linecap . "round")
+ (cons
+ 'd
+ (string-append
+ (ly:format
"M~4f ~4fA~4f ~4f 0 ~4f 0 ~4f ~4f"
(* start-radius (cos new-start-angle))
(- (* start-radius (sin new-start-angle)))
"M~4f ~4fA~4f ~4f 0 ~4f 0 ~4f ~4f"
(* start-radius (cos new-start-angle))
(- (* start-radius (sin new-start-angle)))
(if (> 0 (- new-start-angle new-end-angle)) 0 1)
(* end-radius (cos new-end-angle))
(- (* end-radius (sin new-end-angle))))
(if (> 0 (- new-start-angle new-end-angle)) 0 1)
(* end-radius (cos new-end-angle))
(- (* end-radius (sin new-end-angle))))
- (family-designsize (regexp-exec (make-regexp "(.*)-([0-9]*)")
- font-name))
- (family (if (regexp-match? family-designsize)
- (match:substring family-designsize 1)
- font-name))
- (design-size (if (regexp-match? family-designsize)
- (match:substring family-designsize 2)
- #f))
- (scaled-size (/ size lily-unit-length))
- (font (ly:paper-get-font paper `(((font-family . ,family)
- ,(if design-size
- `(design-size . design-size)))))))
- (define (glyph-spec w x y g)
+ (family-designsize (regexp-exec (make-regexp "(.*)-([0-9]*)")
+ font-name))
+ (family (if (regexp-match? family-designsize)
+ (match:substring family-designsize 1)
+ font-name))
+ (design-size (if (regexp-match? family-designsize)
+ (match:substring family-designsize 2)
+ #f))
+ (scaled-size (/ size lily-unit-length))
+ (font (ly:paper-get-font paper `(((font-family . ,family)
+ ,(if design-size
+ `(design-size . design-size)))))))
+ (define (glyph-spec w h x y g) ; h not used
- (char-lookup (format #f "&#~S;" charcode))
- (glyph-by-name (eoc 'altglyph `(glyphname . ,g)))
- (apparently-broken
- (comment "XFIXME: how to select glyph by name, altglyph is broken?")))
- ;; what is W?
- (ly:format
- "<text~a font-family=\"~a\" font-size=\"~a\">~a</text>"
- (if (or (> (abs x) 0.00001)
- (> (abs y) 0.00001))
- (ly:format " transform=\"translate(~4f,~4f)\"" x y)
- " ")
- name-style scaled-size
- (string-regexp-substitute
- "\n" ""
- (string-append glyph-by-name apparently-broken char-lookup)))))
+ (char-lookup (format #f "&#~S;" charcode))
+ (glyph-by-name (eoc 'altglyph `(glyphname . ,g)))
+ (apparently-broken
+ (comment "XFIXME: how to select glyph by name, altglyph is broken?")))
+ ;; what is W?
+ (ly:format
+ "<text~a font-family=\"~a\" font-size=\"~a\">~a</text>"
+ (if (or (> (abs x) 0.00001)
+ (> (abs y) 0.00001))
+ (ly:format " transform=\"translate(~4f,~4f)\"" x y)
+ " ")
+ name-style scaled-size
+ (string-regexp-substitute
+ "\n" ""
+ (string-append glyph-by-name apparently-broken char-lookup)))))
+ (and (ly:get-option 'point-and-click)
+ (let* ((cause (ly:grob-property grob 'cause))
+ (music-origin (if (ly:stream-event? cause)
+ (ly:event-property cause 'origin)))
+ (point-and-click (ly:get-option 'point-and-click)))
+ (and (ly:input-location? music-origin)
+ (cond ((boolean? point-and-click) point-and-click)
+ ((symbol? point-and-click)
+ (ly:in-event-class? cause point-and-click))
+ (else (any (lambda (t)
+ (ly:in-event-class? cause t))
+ point-and-click)))
+ (let* ((location (ly:input-file-line-char-column music-origin))
+ (raw-file (car location))
+ (file (if (is-absolute? raw-file)
+ raw-file
+ (string-append (ly-getcwd) "/" raw-file))))
+
+ (ly:format "<a style=\"color:inherit;\" xlink:href=\"textedit://~a:~a:~a:~a\">\n"
+ ;; Backslashes are not valid
+ ;; file URI path separators.
+ (ly:string-percent-encode
+ (ly:string-substitute "\\" "/" file))
+
+ (cadr location)
+ (caddr location)
+ (1+ (cadddr location))))))))
- (let*
- ((head (car exps))
- (rest (cdr exps))
- (arity
- (cond ((memq head '(rmoveto rlineto lineto moveto)) 2)
- ((memq head '(rcurveto curveto)) 6)
- ((eq? head 'closepath) 0)
- (else 1)))
- (args (take rest arity))
- (svg-head (assoc-get head
- '((rmoveto . m)
- (rcurveto . c)
- (curveto . C)
- (moveto . M)
- (lineto . L)
- (rlineto . l)
- (closepath . z))
- "")))
-
- (cons (format #f "~a~a" svg-head (number-list->point args))
- (convert-path-exps (drop rest arity))))
- '()))
+ (let*
+ ((head (car exps))
+ (rest (cdr exps))
+ (arity
+ (cond ((memq head '(rmoveto rlineto lineto moveto)) 2)
+ ((memq head '(rcurveto curveto)) 6)
+ ((eq? head 'closepath) 0)
+ (else 1)))
+ (args (take rest arity))
+ (svg-head (assoc-get head
+ '((rmoveto . m)
+ (rcurveto . c)
+ (curveto . C)
+ (moveto . M)
+ (lineto . L)
+ (rlineto . l)
+ (closepath . z))
+ "")))
+
+ (cons (format #f "~a~a" svg-head (number-list->point args))
+ (convert-path-exps (drop rest arity))))
+ '()))
- (line-join-styles '(miter round bevel))
- (cap-style (if (not (memv cap line-cap-styles))
- (begin
- (ly:warning (_ "unknown line-cap-style: ~S")
- (symbol->string cap))
- 'round)
- cap))
- (join-style (if (not (memv join line-join-styles))
- (begin
- (ly:warning (_ "unknown line-join-style: ~S")
- (symbol->string join))
- 'round)
- join)))
+ (line-join-styles '(miter round bevel))
+ (cap-style (if (not (memv cap line-cap-styles))
+ (begin
+ (ly:warning (_ "unknown line-cap-style: ~S")
+ (symbol->string cap))
+ 'round)
+ cap))
+ (join-style (if (not (memv join line-join-styles))
+ (begin
+ (ly:warning (_ "unknown line-join-style: ~S")
+ (symbol->string join))
+ 'round)
+ join)))
- `(stroke-width . ,thick)
- `(stroke-linejoin . ,(symbol->string join-style))
- `(stroke-linecap . ,(symbol->string cap-style))
- '(stroke . "currentColor")
- `(fill . ,(if fill? "currentColor" "none"))
- `(d . ,(apply string-append (convert-path-exps commands))))))
+ `(stroke-width . ,thick)
+ `(stroke-linejoin . ,(symbol->string join-style))
+ `(stroke-linecap . ,(symbol->string cap-style))
+ '(stroke . "currentColor")
+ `(fill . ,(if fill? "currentColor" "none"))
+ `(d . ,(string-concatenate (convert-path-exps commands))))))
- ((normal-element (regexp-exec svg-element-regexp expr))
- (scaled-element (regexp-exec scaled-element-regexp expr))
- (scaled? (if scaled-element #t #f))
- (match (if scaled? scaled-element normal-element))
- (string1 (match:substring match 1))
- (string2 (match:substring match 2)))
-
- (if scaled?
- (string-append string1
- (ly:format "translate(~4f, ~4f) " x (- y))
- string2
- "\n")
- (string-append string1
- (ly:format " transform=\"translate(~4f, ~4f)\" "
- x (- y))
- string2
- "\n")))))
+ ((normal-element (regexp-exec svg-element-regexp expr))
+ (scaled-element (regexp-exec scaled-element-regexp expr))
+ (scaled? (if scaled-element #t #f))
+ (match (if scaled? scaled-element normal-element))
+ (string1 (match:substring match 1))
+ (string2 (match:substring match 2)))
+
+ (if scaled?
+ (string-append string1
+ (ly:format "translate(~4f, ~4f) " x (- y))
+ string2
+ "\n")
+ (string-append string1
+ (ly:format " transform=\"translate(~4f, ~4f)\" "
+ x (- y))
+ string2
+ "\n")))))
- 'polygon ""
- '(stroke-linejoin . "round")
- '(stroke-linecap . "round")
- `(stroke-width . ,blot-diameter)
- `(fill . ,(if is-filled "currentColor" "none"))
- '(stroke . "currentColor")
- `(points . ,(string-join
- (map offset->point (ly:list->offsets '() coords))))))
-
-(define (repeat-slash width slope thickness)
- (define (euclidean-length x y)
- (sqrt (+ (* x x) (* y y))))
- (let* ((x-width (euclidean-length thickness (/ thickness slope)))
- (height (* width slope)))
- (entity
- 'path ""
- '(fill . "currentColor")
- `(d . ,(ly:format "M0 0l~4f 0 ~4f ~4f ~4f 0z"
- x-width width (- height) (- x-width))))))
+ 'polygon ""
+ '(stroke-linejoin . "round")
+ '(stroke-linecap . "round")
+ `(stroke-width . ,blot-diameter)
+ `(fill . ,(if is-filled "currentColor" "none"))
+ '(stroke . "currentColor")
+ `(points . ,(string-join
+ (map offset->point (ly:list->offsets '() coords))))))
- 'rect ""
- ;; The stroke will stick out. To use stroke,
- ;; the stroke-width must be subtracted from all other dimensions.
- ;;'(stroke-linejoin . "round")
- ;;'(stroke-linecap . "round")
- ;;`(stroke-width . ,blot)
- ;;'(stroke . "red")
- ;;'(fill . "orange")
-
- `(x . ,(- breapth))
- `(y . ,(- height))
- `(width . ,(+ breapth width))
- `(height . ,(+ depth height))
- `(ry . ,(/ blot-diameter 2))
- '(fill . "currentColor")))
+ 'rect ""
+ ;; The stroke will stick out. To use stroke,
+ ;; the stroke-width must be subtracted from all other dimensions.
+ ;;'(stroke-linejoin . "round")
+ ;;'(stroke-linecap . "round")
+ ;;`(stroke-width . ,blot)
+ ;;'(stroke . "red")
+ ;;'(fill . "orange")
+
+ `(x . ,(- breapth))
+ `(y . ,(- height))
+ `(width . ,(+ breapth width))
+ `(height . ,(+ depth height))
+ `(ry . ,(/ blot-diameter 2))
+ '(fill . "currentColor")))
- (format #f "<g color=\"rgb(~a%, ~a%, ~a%)\">\n"
- (* 100 r) (* 100 g) (* 100 b)))
+ (ly:format "<g color=\"rgb(~4f%, ~4f%, ~4f%)\">\n"
+ (* 100 r) (* 100 g) (* 100 b)))
;; rotate around given point
(define (setrotation ang x y)
(ly:format "<g transform=\"rotate(~4f, ~4f, ~4f)\">\n"
;; rotate around given point
(define (setrotation ang x y)
(ly:format "<g transform=\"rotate(~4f, ~4f, ~4f)\">\n"
- `(x . ,(car x))
- `(y . ,(car y))
- `(width . ,(- (cdr x) (car x)))
- `(height . ,(- (cdr y) (car y)))
- '(fill . "none")
- '(stroke . "none")
- '(stroke-width . "0.0"))
+ `(x . ,(car x))
+ `(y . ,(car y))
+ `(width . ,(- (cdr x) (car x)))
+ `(height . ,(- (cdr y) (car y)))
+ '(fill . "none")
+ '(stroke . "none")
+ '(stroke-width . "0.0"))
- "<" "<"
- (string-regexp-substitute "&" "&" string))))
- (dispatch `(fontify ,pango-font-description
- ,(entity 'tspan escaped-string)))))
+ "<" "<"
+ (string-regexp-substitute "&" "&" string))))
+ (fontify pango-font-description
+ (entity 'tspan escaped-string))))