Skip to content
Snippets Groups Projects
Commit aedfee0c authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Add functions for left/right parenthesize

parent 68ac7c1f
No related branches found
No related tags found
No related merge requests found
...@@ -1817,12 +1817,31 @@ divisi = #(define-music-function (parser location vc1 vc2) (ly:music? ly:music?) ...@@ -1817,12 +1817,31 @@ divisi = #(define-music-function (parser location vc1 vc2) (ly:music? ly:music?)
bracketify = #(define-music-function (parser loc arg) (ly:music?) bracketify = #(define-music-function (parser loc arg) (ly:music?)
(_i "Tag @var{arg} to be parenthesized.") (_i "Tag @var{arg} to be parenthesized.")
#{ #{
\once \override ParenthesesItem #'stencils = #bracket-stencils \tweak ParenthesesItem #'stencils #bracket-stencils \parenthesize $arg
\parenthesize $arg
#}) #})
#(define-public (parentheses-item::calc-parenthesis-left-stencils grob)
(let* ((font (ly:grob-default-font grob)))
(list (ly:font-get-glyph font "accidentals.leftparen") empty-stencil)))
#(define-public (parentheses-item::calc-parenthesis-right-stencils grob)
(let* ((font (ly:grob-default-font grob)))
(list empty-stencil (ly:font-get-glyph font "accidentals.rightparen"))))
parenthesizeLeft = #(define-music-function (parser loc arg) (ly:music?)
#{
-\tweak ParenthesesItem #'stencils #parentheses-item::calc-parenthesis-left-stencils
-\parenthesize $arg
#})
parenthesizeRight = #(define-music-function (parser loc arg) (ly:music?)
#{
-\tweak ParenthesesItem #'stencils #parentheses-item::calc-parenthesis-right-stencils
-\parenthesize $arg
#})
#(define-markup-command (hat layout props arg) (markup?) #(define-markup-command (hat layout props arg) (markup?)
"Draw a hat above the given string @var{arg}." "Draw a hat above the given string @var{arg}."
(interpret-markup layout props (markup #:combine #:raise 1.5 "^" arg))) (interpret-markup layout props (markup #:combine #:raise 1.5 "^" arg)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment