]> git.donarmstrong.com Git - lilypond.git/commitdiff
(setcolor): implement (re)setcolor with <g>
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 6 Jun 2005 15:38:28 +0000 (15:38 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 6 Jun 2005 15:38:28 +0000 (15:38 +0000)
change black to currentColor everywhere. This fixes color support
in SVG.

ChangeLog
input/regression/backend-excercise.ly
ly/property-init.ly
scm/output-svg.scm

index 1c6715ee6bb8daa4e1293bab973ca3c6b6594dff..8b29879cb8ec19c9ccc0f2752f739e54697d0dc9 100644 (file)
--- 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>
 
index db00b35ecb4260966fdacc20e09c053d63d0da7d..64033a88dd28c49bcae95d24aeda77735bca7f60 100644 (file)
@@ -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 
     }
   >>
index 4611b020d2bd1bb21099b62e1e20b200c290acd0..a203c44d20a43ef05b77f68b0142459cd7a4357b 100644 (file)
@@ -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)
index 368862de3b7f922ecaeda0824b0eaf90241a7e8c..be1bb04db65d04567b4488c13e74ecba1157a9ed 100644 (file)
 (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>")