|
From: | Knut Petersen |
Subject: | Re: C++ question: |
Date: | Sun, 22 Jan 2017 11:36:42 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
// A markup property whiteout-markup-wzd is implemented. // The following definition is used for that property: // \markup { \with-dimensions #'(0 . 0) #'(0 . 0) { // \filled-box #'(0.0 . 1.0) #'(-0.5 . 0.5) #0.0 } } SCM properties = Font_interface::text_font_alist_chain (me); SCM ws_zd_mod = Text_interface::interpret_markup ( me->layout ()->self_scm (), properties, me->get_property ("whiteout-markup-wzd")); Stencil wsa = *unsmob<Stencil> (ws_zd_mod);
// The following three lines should give an equivalent definition: Box wb (Interval (0.0, 1.0), Interval (-0.5, 0.5)); Stencil wsb (Lookup::round_filled_box (wb, 0));wsb.set_empty(false);
The difference between Stencil wsa and wsb is that \markup { \withdimensions #'(0 . 0) #'(0 . 0) ...} not only sets the dimensions : (define-markup-command (with-dimensions layout props x y arg) (number-pair? number-pair? markup?) #:category other " @cindex setting extent of text objects Set the dimensions of @var{arg} to @var{x} address@hidden@var{y}." (let* ((expr (ly:stencil-expr (interpret-markup layout props arg)))) (ly:stencil-add (make-transparent-box-stencil x y) (ly:make-stencil `(delay-stencil-evaluation ,(delay expr)) x y)))) Knut
[Prev in Thread] | Current Thread | [Next in Thread] |