+2005-06-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * scm/output-svg.scm (setcolor): implement (re)setcolor with <g>
+ change black to currentColor everywhere. This fixes color support
+ in SVG.
2005-06-06 Carl Sorensen <carldsorensen@comcast.net>
* input/regression/fret-diagrams.ly: new file to test fret diagram
- capability
+ capability
* scm/output-tex.scm: remove white-dot and white-text
* scm/output-ps.scm: remove white-dot and white-text
* scm/fret-diagrams.scm (sans-serif-stencil-white): removed --
- using ly:stencil-in-color instead
- (draw-dots) : remove call to white-dot
+ using ly:stencil-in-color instead
+ (draw-dots) : remove call to white-dot
2005-06-06 Han-Wen Nienhuys <hanwen@xs4all.nl>
\relative {
\new StaffGroup \new PianoStaff <<
- \new Staff <<
+ \new Staff
{
#(set-octavation 1)
\times 2/3 { c'8[\< f]( f''\!) }
#(set-octavation 0)
- <f \5>
+ <f,, \5>4
+
+ \override TextScript #'color = #red
+ g4^"red"
}
- \skip 1 >>
+
\new Staff \relative c'' {
- \makeClusters { <g a>8 <e a> }
+ \makeClusters { <g a>8 <e a> <g a>4 }
+
\override Glissando #'style = #'zigzag
f2 \glissando f'
- \override NoteHead #'print-function = #Note_head::brew_ez_stencil
- \override NoteHead #'Y-extent-callback = #'()
- \override NoteHead #'X-extent-callback = #'()
+ \setEasyHeads
f e
}
>>
(define (fontify font expr)
(entity 'text expr
`(style . ,(svg-font font))
+ '(fill . "currentColor")
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
'(stroke-linejoin . "round")
'(stroke-linecap . "round")
`(stroke-width . ,blot-diameter)
- '(stroke . "black")
- '(fill . "black")
+ '(stroke . "currentColor")
+ '(fill . "currentColor")
`(points . ,(string-join
(map offset->point
(list (cons (/ b 2) (/ t 2))
'(stroke-linejoin . "round")
'(stroke-linecap . "round")
`(stroke-width . ,blot-diameter)
- '(stroke . "black")
- '(fill . "black")
+ '(stroke . "currentColor")
+ '(fill . "currentColor")
`(d . ,(format #f "M ~S,~S l ~S,~S l ~S,~S l ~S,~S l ~S,~S"
(/ b 2) (/ t 2)
w (- h)
'(stroke-linejoin . "round")
'(stroke-linecap . "round")
`(stroke-width . ,thick)
- '(stroke . "black")
- '(fill . "black")
+ '(stroke . "currentColor")
+ '(fill . "currentColor")
`(d . ,(string-append (svg-bezier first #f)
(svg-bezier second first-c0)))
)))
`((stroke-linejoin . "round")
(stroke-linecap . "round")
(stroke-width . ,thick)
- (stroke . "black")
+ (stroke . "currentColor")
(x1 . ,x1)
(y1 . ,(- y1))
(x2 . ,x2)
'(stroke-linejoin . "round")
'(stroke-linecap . "round")
`(stroke-width . ,blot-diameter)
- `(fill . ,(if is-filled "black" "none"))
- '(stroke . "black")
+ `(fill . ,(if is-filled "currentColor" "none"))
+ '(stroke . "currentColor")
`(points . ,(string-join
(map offset->point (ly:list->offsets '() coords))))
))
'circle ""
'(stroke-linejoin . "round")
'(stroke-linecap . "round")
- `(fill . ,(if is-filled "black" "none"))
- `(stroke . "black")
+ `(fill . ,(if is-filled "currentColor" "none"))
+ `(stroke . "currentColor")
`(stroke-width . ,thick)
`(r . ,radius)))
(define (utf8-string pango-font-description string)
(dispatch `(fontify ,pango-font-description ,(entity 'tspan string))))
+
+
+(define (setcolor r g b)
+ (format "<g color=\"rgb(~a%,~a%,~a%)\">"
+ (* 100 r) (* 100 g) (* 100 b)
+ ))
+
+(define (resetcolor)
+ "</g>")