Reviewers: ,
Message:
Please review
Description:
Issue 4983 Let crossStaff hide non-default-style flags
Return empty-stencil for all flags using the code provided in
flag-styles.scm, if the style property is 'no-flag as set by
the crossStaff-function.
Please review this at https://codereview.appspot.com/315330043/
Affected files (+18, -21 lines):
M scm/flag-styles.scm
Index: scm/flag-styles.scm
diff --git a/scm/flag-styles.scm b/scm/flag-styles.scm
index
a2ddf3a9dd0bd8d728b2352c5ea7d03dbcc2b324..b17b3fc2abd62d3ed45e0d6853a44f126916590c
100644
--- a/scm/flag-styles.scm
+++ b/scm/flag-styles.scm
@@ -20,11 +20,6 @@
;;;; styles.
-(define-public (no-flag grob)
- "No flag: Simply return empty stencil."
- empty-stencil)
-
-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Straight flags
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -97,14 +92,16 @@ All lengths are scaled according to the font size of
the note."
;; Log for 1/8 is 3, so we need to subtract 3
(flag-stencil (buildflag stencil (- log 3) stencil spacing))
(stroke-style (ly:grob-property grob 'stroke-style)))
- (if (equal? stroke-style "grace")
- (add-stroke-straight flag-stencil grob
- dir log
- stroke-style
- flag-end flag-length
- thickness
- (* half-stem-thickness 2))
- flag-stencil))))
+ (cond ((eq? (ly:grob-property grob 'style) 'no-flag)
+ empty-stencil)
+ ((equal? stroke-style "grace")
+ (add-stroke-straight flag-stencil grob
+ dir log
+ stroke-style
+ flag-end flag-length
+ thickness
+ (* half-stem-thickness 2)))
+ (else flag-stencil)))))
(define-public (modern-straight-flag grob)
"Modern straight flag style (for composers like Stockhausen, Boulez,
etc.).
@@ -174,10 +171,12 @@ flag stencil."
(dir (if (eqv? (ly:grob-property stem-grob 'direction)
UP) "u" "d"))
(flag (retrieve-glyph-flag flag-style dir dir-modifier grob))
(stroke-style (ly:grob-property grob 'stroke-style)))
- (if (null? stroke-style)
- flag
- (add-stroke-glyph flag grob dir stroke-style flag-style))))
-
+ (cond ((eq? (ly:grob-property grob 'style) 'no-flag)
+ empty-stencil)
+ ((null? stroke-style)
+ flag)
+ (else
+ (add-stroke-glyph flag grob dir stroke-style flag-style)))))
(define-public (mensural-flag grob)
@@ -205,7 +204,6 @@ a flag always touches a staff line."
(create-glyph-flag "mensural" modifier grob)))
-
(define ((glyph-flag flag-style) grob)
"Simulatesthe default way of generating flags: Look up glyphs
@code{flags.style[ud][1234]} from the feta font and use it for the flag
@@ -214,13 +212,11 @@ stencil."
(export glyph-flag)
-
(define-public (normal-flag grob)
"Create a default flag."
(create-glyph-flag "" "" grob))
-
(define-public (default-flag grob)
"Create a flag stencil for the stem. Its style will be derived from the
@code{'style} Flag property. By default, @code{lilypond} uses a
@@ -242,5 +238,6 @@ at will. The correct way to do this is:
(cond
((equal? flag-style "") (normal-flag grob))
((equal? flag-style "mensural") (mensural-flag grob))
- ((equal? flag-style "no-flag") (no-flag grob))
+ ((equal? flag-style "no-flag") empty-stencil)
(else ((glyph-flag flag-style) grob)))))
+
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel