X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Flsr%2Fthree-sided-box.ly;h=9e94044ccd491153ad7d5b699df28602d7735968;hb=5b2bdf8c532aa1b4aa8626f6847938f2ef4ba1be;hp=3be893fcd64c5c4098fdc1420426b99c5243c165;hpb=24d7a2abc788061a4f7a81ee3c2a9f330ddca93f;p=lilypond.git diff --git a/input/lsr/three-sided-box.ly b/input/lsr/three-sided-box.ly index 3be893fcd6..9e94044ccd 100644 --- a/input/lsr/three-sided-box.ly +++ b/input/lsr/three-sided-box.ly @@ -1,6 +1,6 @@ %% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it %% This file is in the public domain. -\version "2.11.38" +\version "2.12.0" \header { lsrtags = "rhythms, text" @@ -12,19 +12,20 @@ around some text (or other markup). " doctitle = "Three-sided box" } % begin verbatim + % New command to add a three sided box, with sides north, west and south % Based on the box-stencil command defined in scm/stencil.scm -% Note that you use ";" to comment a line in Scheme +% Note that ";" is used to comment a line in Scheme #(define-public (NWS-box-stencil stencil thickness padding) "Add a box around STENCIL, producing a new stencil." (let* ((x-ext (interval-widen (ly:stencil-extent stencil 0) padding)) - (y-ext (interval-widen (ly:stencil-extent stencil 1) padding)) - (y-rule (make-filled-box-stencil (cons 0 thickness) y-ext)) - (x-rule (make-filled-box-stencil - (interval-widen x-ext thickness) (cons 0 thickness)))) + (y-ext (interval-widen (ly:stencil-extent stencil 1) padding)) + (y-rule (make-filled-box-stencil (cons 0 thickness) y-ext)) + (x-rule (make-filled-box-stencil + (interval-widen x-ext thickness) (cons 0 thickness)))) ; (set! stencil (ly:stencil-combine-at-edge stencil X 1 y-rule padding)) (set! stencil (ly:stencil-combine-at-edge stencil X -1 y-rule padding)) - (set! stencil (ly:stencil-combine-at-edge stencil Y 1 x-rule 0.0)) + (set! stencil (ly:stencil-combine-at-edge stencil Y 1 x-rule 0.0)) (set! stencil (ly:stencil-combine-at-edge stencil Y -1 x-rule 0.0)) stencil)) @@ -33,19 +34,18 @@ around some text (or other markup). #(define-markup-command (NWS-box layout props arg) (markup?) "Draw a box round @var{arg}. Looks at @code{thickness}, @code{box-padding} and @code{font-size} properties to determine line -thickness and padding around the markup." - +thickness and padding around the markup." (let* ((th (chain-assoc-get 'thickness props 0.1)) - (size (chain-assoc-get 'font-size props 0)) - (pad (* (magstep size) - (chain-assoc-get 'box-padding props 0.2))) - (m (interpret-markup layout props arg))) + (size (chain-assoc-get 'font-size props 0)) + (pad (* (magstep size) + (chain-assoc-get 'box-padding props 0.2))) + (m (interpret-markup layout props arg))) (NWS-box-stencil m th pad))) - % Test it: -\relative c' { +\layout { ragged-right = ##f } +\relative c' { c2^\markup { \NWS-box ABCD } - c^\markup { \NWS-box \note #"4" #1.0 } + c2^\markup { \NWS-box \note #"4" #1.0 } }