lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strike-through markup


From: Thomas Morley
Subject: Re: Strike-through markup
Date: Mon, 9 Jul 2012 00:52:59 +0200

2012/7/8 Apos <address@hidden>:
>
> Hello everyone! I have been playing a lot with Lilypond lately and have
> managed to write quite a lot of partitions with it. Today, while browsing
> though some old partition that I had, I found the following measure:
>
> http://old.nabble.com/file/p34130677/Capture.png
>
> I was wondering if it was possible to reproduce the text strike-through that
> you can see in the picture using Lilypond. I have already searched through
> the markup documentation. I have found how to add "italic", "bold",
> "underline", etc... but I haven't been able to find any strike-through as
> shown in the picture above.
>
> Thanks a lot already!

Hi Apos,

I altered \underline from /scm/define-markup-commands.scm

If you want to change the height of the line, adjust the value of the
offset-property in the definition or use an override as shown in the
second example.

\version "2.14.2"

#(define-markup-command (strike-through layout props arg)
  (markup?)
  #:properties ((thickness 1) (offset 6))
  (let* ((thick (ly:output-def-lookup layout 'line-thickness))
         (underline-thick (* thickness thick))
         (markup (interpret-markup layout props arg))
         (x1 (car (ly:stencil-extent markup X)))
         (x2 (cdr (ly:stencil-extent markup X)))
         (y (* thick offset))
         (line (make-line-stencil underline-thick x1 y x2 y)))
    (ly:stencil-add markup line)))

% --- examples
\markup \strike-through "some text"

\markup \override #'(offset . 8) \strike-through "some text"


HTH,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]