Hi Rip_mus,

Bar Lines are not in fact glyphs, but drawn directly. We could recreate a 
drawing procedure for markups, but the easiest thing to do would probably be 
to use the \score markup command for this as seen in the appended file.

Cheers,
Valentin

Am Freitag, 3. Februar 2023, 10:50:30 CET schrieb Rip _Mus:
> Hi,
> is it possible to use a repeat barline glyph(opened or closed) in a markup?
> I'm trying to print it centered between two staves within a Dynamics
> context.
> Thank you in advance!
> 
> Rip_mus

#(define-markup-command (bar layout props type) (string?)
   #:properties ((font-size 0))
   (let* ((ref-fs (ly:output-def-lookup layout 'text-font-size 11))
          (unit (* 5 (/ ref-fs 11)))
          (tfs (* (magstep font-size) ref-fs))
          (fs (* tfs 0.722030560219551))
          (mu #{
     \markup\score {
       \layout {
         #(layout-set-staff-size (* 1.15 fs))
       }
       \new Staff \with {
         \remove Clef_engraver
         \remove Time_signature_engraver
         \remove Default_bar_line_engraver
         \omit StaffSymbol
       } { s \bar #type s }
     }
              #})
          (stc (interpret-markup layout props mu))
          (stc (ly:stencil-aligned-to stc X LEFT))
          (stc-height (interval-length (ly:stencil-extent stc Y)))
          (stc (ly:stencil-aligned-to stc Y CENTER))
          (stc (ly:stencil-translate-axis stc (/ fs unit 2)  Y)))
     stc))

\markup \column { \line { This is a BarLine: \bar "|" }
                  \line { This is section BarLine: \bar "||" }
                  \line { This is an end BarLine: \bar "|." }
                  \line { This is a repeat BarLine: \bar ":|." }
                  \line { This is a start repeat BarLine: \bar ".|:" }
                  \line { This is a double repeat BarLine: \bar ":|.|:" }
                  \line { This is a winged repeat BarLine: \bar ":|]" }
                  \line { This is a segno BarLine: \bar "S" } }

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to