X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fsnippets%2Fthree-sided-box.ly;h=dd7f46a30ac21376731c8c10f7e4dc4d99a3efeb;hb=5d84bfad4626892bcffd05adcced53c8a2329047;hp=572352448812a3a94c1e1144465e00dfafad49cf;hpb=8f6e4647c475ad911e15fdc26493f77e6c4a6088;p=lilypond.git diff --git a/Documentation/snippets/three-sided-box.ly b/Documentation/snippets/three-sided-box.ly index 5723524488..dd7f46a30a 100644 --- a/Documentation/snippets/three-sided-box.ly +++ b/Documentation/snippets/three-sided-box.ly @@ -1,10 +1,14 @@ -%% Do not edit this file; it is automatically -%% generated from LSR http://lsr.dsi.unimi.it -%% This file is in the public domain. -\version "2.13.16" +% DO NOT EDIT this file manually; it is automatically +% generated from Documentation/snippets/new +% Make any changes in Documentation/snippets/new/ +% and then run scripts/auxiliar/makelsr.py +% +% This file is in the public domain. +%% Note: this file works from version 2.18.0 +\version "2.18.0" \header { - lsrtags = "rhythms, text" + lsrtags = "rhythms, scheme-language, text" texidoc = " This example shows how to add a markup command to get a three sided box @@ -33,15 +37,13 @@ around some text (or other markup). % The corresponding markup command, based on the \box command defined % in scm/define-markup-commands.scm #(define-markup-command (NWS-box layout props arg) (markup?) + #:properties ((thickness 0.1) (font-size 0) (box-padding 0.2)) "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." - (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))) - (NWS-box-stencil m th pad))) + (let ((pad (* (magstep font-size) box-padding)) + (m (interpret-markup layout props arg))) + (NWS-box-stencil m thickness pad))) % Test it: @@ -49,4 +51,3 @@ thickness and padding around the markup." c1^\markup { \NWS-box ABCD } c1^\markup { \NWS-box \note #"4" #1.0 } } -