From: hanwen <hanwen>
Date: Mon, 6 Jun 2005 15:38:28 +0000 (+0000)
Subject: (setcolor): implement (re)setcolor with <g>
X-Git-Tag: release/2.5.32^2~66
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6c99292f1ff373004e149721ad63bd688b58cba8;p=lilypond.git

(setcolor): implement (re)setcolor with <g>
change black to currentColor everywhere. This fixes color support
in SVG.
---

diff --git a/ChangeLog b/ChangeLog
index 1c6715ee6b..8b29879cb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,17 +1,21 @@
+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>
 
diff --git a/input/regression/backend-excercise.ly b/input/regression/backend-excercise.ly
index db00b35ecb..64033a88dd 100644
--- a/input/regression/backend-excercise.ly
+++ b/input/regression/backend-excercise.ly
@@ -8,21 +8,23 @@
 
 \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 
     }
   >>
diff --git a/ly/property-init.ly b/ly/property-init.ly
index 4611b020d2..a203c44d20 100644
--- a/ly/property-init.ly
+++ b/ly/property-init.ly
@@ -51,6 +51,7 @@ setEasyHeads = \sequential {
   \override NoteHead #'print-function = #Note_head::brew_ez_stencil
   \override NoteHead #'font-size = #-7
   \override NoteHead #'font-family = #'sans
+  \override NoteHead #'font-series = #'bold
 }
 
 aikenHeads = \set shapeNoteStyles = ##(do re mi fa #f la ti)
diff --git a/scm/output-svg.scm b/scm/output-svg.scm
index 368862de3b..be1bb04db6 100644
--- a/scm/output-svg.scm
+++ b/scm/output-svg.scm
@@ -144,6 +144,7 @@
 (define (fontify font expr)
   (entity 'text expr
 	  `(style . ,(svg-font font))
+	  '(fill . "currentColor")
 	  ))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -212,8 +213,8 @@
 	    '(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))
@@ -231,8 +232,8 @@
 	    '(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)
@@ -249,8 +250,8 @@
 	    '(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)))
 	    )))
@@ -269,7 +270,7 @@
 	  `((stroke-linejoin . "round")
 	    (stroke-linecap . "round")
 	    (stroke-width . ,thick)
-	    (stroke . "black")
+	    (stroke . "currentColor")
 	    (x1 . ,x1)
 	    (y1 . ,(- y1))
 	    (x2 . ,x2)
@@ -302,8 +303,8 @@
    '(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))))
    ))
@@ -330,8 +331,8 @@
    '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)))
 
@@ -341,3 +342,12 @@
 (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>")