From ff896fd78eb0a4b0ad68783c22ffc740ef4700e9 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 6 Jun 2005 15:38:28 +0000 Subject: [PATCH] (setcolor): implement (re)setcolor with change black to currentColor everywhere. This fixes color support in SVG. --- ChangeLog | 10 ++++++--- input/regression/backend-excercise.ly | 16 ++++++++------ ly/property-init.ly | 1 + scm/output-svg.scm | 32 ++++++++++++++++++--------- 4 files changed, 38 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c6715ee6b..8b29879cb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,17 +1,21 @@ +2005-06-06 Han-Wen Nienhuys + * scm/output-svg.scm (setcolor): implement (re)setcolor with + change black to currentColor everywhere. This fixes color support + in SVG. 2005-06-06 Carl Sorensen * 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 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) - + 4 + + \override TextScript #'color = #red + g4^"red" } - \skip 1 >> + \new Staff \relative c'' { - \makeClusters { 8 } + \makeClusters { 8 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 "" + (* 100 r) (* 100 g) (* 100 b) + )) + +(define (resetcolor) + "") -- 2.39.2