From 38189e6a227753ee6dca31aac448d97071a8551d Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 13 Apr 2005 00:15:06 +0000 Subject: [PATCH] * input/regression/markup-syntax.ly: remove \score. * scm/define-markup-commands.scm (draw-circle): add fill argument * scm/stencil.scm (make-circle-stencil): add fill argument * ps/music-drawing-routines.ps: add fill argument. * ps/music-drawing-routines.ps: new routine BeginEPSF / EndEPSF. * scm/output-ps.scm (glyph-string): break lines. 255 chars is max for EPS files. * scm/define-markup-commands.scm (epsfile): add epsfile command. --- ChangeLog | 9 +++- input/regression/markup-syntax.ly | 78 +++++++++++++++---------------- ps/music-drawing-routines.ps | 7 ++- scm/define-markup-commands.scm | 9 ++-- scm/output-ps.scm | 8 +++- scm/stencil.scm | 6 +-- 6 files changed, 66 insertions(+), 51 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0670538b67..bbd18f77a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2005-04-13 Han-Wen Nienhuys + * input/regression/markup-syntax.ly: remove \score. + + * scm/define-markup-commands.scm (draw-circle): add fill argument + + * scm/stencil.scm (make-circle-stencil): add fill argument + + * ps/music-drawing-routines.ps: add fill argument. + * ly/performer-init.ly: add CueVoice to MIDI too. * ps/music-drawing-routines.ps: new routine BeginEPSF / @@ -82,7 +90,6 @@ * GNUmakefile.in: Bugfix: also link .map files. ->>>>>>> 1.3423 2005-04-09 Nicolas Sceaux * scm/music-functions.scm (music->make-music): generate diff --git a/input/regression/markup-syntax.ly b/input/regression/markup-syntax.ly index b4ac17530a..a2f474d5a3 100644 --- a/input/regression/markup-syntax.ly +++ b/input/regression/markup-syntax.ly @@ -1,47 +1,47 @@ \header { -texidoc = "With the new markup syntax, text may be written in various manners." -} -\version "2.5.2" + texidoc = "Demo of markup texts, using LilyPond syntax. " +} -\score { - - { - f'1-\markup { - foo - \raise #0.2 \hbracket \bold bar - \override #'(baseline-skip . 4) +\version "2.5.2" - \bracket \column { baz bazr bla } - \hspace #2.0 - \override #'(font-encoding . fetaMusic) { - \lookup #"noteheads-0" - } - \semiflat +{ + f'1-\markup { + foo + \raise #0.2 \hbracket \bold bar + \override #'(baseline-skip . 4) - { } - - \combine "X" "+" - \combine "o" "/" - } - g'1-\markup { -% \char-number #"abc1234abc" - \box \column { \line { "string 1" } \line { "string 2" } } - "$\\emptyset$" - \draw-circle #1 #0.3 - " " - \italic Norsk - \super "2" - " " - \raise #3.0 \whiteout white-out - \circle \dynamic p - \with-color #green Green - \dynamic sfzp - \huge { "A" \smaller "A" \smaller \smaller "A" - \smaller \smaller \smaller "A" } - \sub "alike" - } - c''4 + \bracket \column { baz bazr bla } + \hspace #2.0 + \override #'(font-encoding . fetaMusic) { + \lookup #"noteheads-0" } + \semiflat + + { } + + \combine "X" "+" + \combine "o" "/" + } + g'1-\markup { + % \char-number #"abc1234abc" + \box \column { \line { "string 1" } \line { "string 2" } } + " " + \draw-circle #1 #0.3 ##f + " " + \draw-circle #1 #0.3 ##t + " " + \italic Norsk + \super "2" + " " + \raise #3.0 \whiteout white-out + \circle \dynamic p + \with-color #green Green + \dynamic sfzp + \huge { "A" \smaller "A" \smaller \smaller "A" + \smaller \smaller \smaller "A" } + \sub "alike" + } + c''4 } diff --git a/ps/music-drawing-routines.ps b/ps/music-drawing-routines.ps index 8627ea5e11..53dc007fc2 100644 --- a/ps/music-drawing-routines.ps +++ b/ps/music-drawing-routines.ps @@ -284,12 +284,15 @@ bind def 0 360 arc closepath fill stroke } bind def -/draw_circle % R T +/draw_circle % R T F { + /filled exch def setlinewidth dup 0 moveto 0 exch 0 exch - 0 360 arc closepath stroke + 0 360 arc closepath + gsave stroke grestore + filled { fill } if } bind def /draw_white_dot % x1 y2 R diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 14de51a7ad..7ae27aa261 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -19,10 +19,11 @@ "Stencil as markup" stil) -(def-markup-command (draw-circle layout props radius thickness) - (number? number?) - "A circle of radius @var{radius} and thickness @var{thickness}" - (make-circle-stencil radius thickness)) +(def-markup-command (draw-circle layout props radius thickness fill) + (number? number? boolean?) + "A circle of radius @var{radius}, thickness @var{thickness} and +optionally filled." + (make-circle-stencil radius thickness fill)) (def-markup-command (circle layout props arg) (markup?) "Draw a circle around @var{arg}. Use @code{thickness}, diff --git a/scm/output-ps.scm b/scm/output-ps.scm index ceaf44306b..6183c28995 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -107,9 +107,13 @@ (list arch_angle arch_width arch_height height arch_thick thick)) " draw_bracket")) -(define (circle radius thick) +(define (circle radius thick fill) (format - "~a ~a draw_circle" radius thick)) + "~a ~a ~a draw_circle" radius thick + (if fill + "true " + "false ") + )) (define (char font i) (string-append diff --git a/scm/stencil.scm b/scm/stencil.scm index 8b193ce15d..81e1d9a40c 100644 --- a/scm/stencil.scm +++ b/scm/stencil.scm @@ -57,10 +57,10 @@ (- (car yext)) (cdr yext)) xext yext)) -(define-public (make-circle-stencil radius thickness) +(define-public (make-circle-stencil radius thickness fill) "Make a circle of radius @var{radius} and thickness @var{thickness}" (ly:make-stencil - (list 'circle radius thickness) + (list 'circle radius thickness fill) (cons (- radius) radius) (cons (- radius) radius))) @@ -100,7 +100,7 @@ encloses the contents. (- (cdr y-ext) (car y-ext)))) (radius (+ (/ diameter 2) padding thickness))) (ly:stencil-add - (centered-stencil stencil) (make-circle-stencil radius thickness)))) + (centered-stencil stencil) (make-circle-stencil radius thickness #f)))) (define-public (fontify-text font-metric text) "Set TEXT with font FONT-METRIC, returning a stencil." -- 2.39.2