@cindex clefs, visibility of octavation
The small octavation symbol on octavated clefs is produced by the
-@code{OctavateEight} layout object. Its visibility is controlled
-independently from that of the @code{Clef} object, so it is
-necessary to apply any required @code{break-visibility} overrides
-to both the @code{Clef} and the @code{OctavateEight} layout objects
-to fully suppress such clef symbols at the start of each line.
+@code{OctavateEight} layout object. Its visibility is automatically
+inherited from the @code{Clef} object, so it is not necessary to apply
+any required @code{break-visibility} overrides to the @code{OctavateEight}
+layout objects to suppress octavation symbols for invisible clefs.
For explicit clef changes, the @code{explicitClefVisibility}
property controls both the clef symbol and any octavation symbol
--- /dev/null
+\version "2.13.45"
+
+\header {
+
+ texidoc = "Octavation signs may be added to clefs. By default,
+their break-visibility is derived from the associated clef, but it may
+be overridden explicitly. The initial treble_8 clef should not have an
+8, while the treble_8 clef after the tenor clef should.
+These settings also need to apply to clefs on new lines."
+
+}
+\layout { ragged-right = ##t }
+
+
+\relative c' {
+ \override Staff.OctavateEight #'break-visibility = #all-invisible
+
+ \clef "treble_8"
+ c2 c |
+ c c | \break
+ c \clef "tenor" c |
+ \revert Staff.OctavateEight #'break-visibility
+ \clef "treble_8"
+ c2 c |
+ c c | \break
+ c c
+}
+
vis = get_property ("explicitClefVisibility");
if (vis)
- {
- clef_->set_property ("break-visibility", vis);
- if (octavate_)
- octavate_->set_property ("break-visibility", vis);
- }
+ clef_->set_property ("break-visibility", vis);
clef_ = 0;
(OctavateEight
. (
- (break-visibility . ,begin-of-line-visible)
+ (break-visibility . ,inherit-x-parent-visibility)
(font-shape . italic)
(font-size . -4)
(self-alignment-X . ,CENTER)
(define-public center-visible #(#f #t #f))
(define-public end-of-line-visible #(#t #f #f))
(define-public all-invisible #(#f #f #f))
+(define-public (inherit-x-parent-visibility grob)
+ (let ((parent (ly:grob-parent grob X)))
+ (ly:grob-property parent 'break-visibility all-invisible)))
+
(define-public spanbar-begin-of-line-invisible #(#t #f #f))